Download the PHP package bakeoff/multitenancy without Composer

On this page you can find all versions of the php package bakeoff/multitenancy. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package multitenancy

Multitenancy for CakePHP 5

This plugin extends cakedc/users and introduces customer accounts and ability to scope application tables by specific customers (tenants).

For CakePHP 3, see (now archived) pronique/multitenant.

Read more about Multitenancy: en.wikipedia.org/wiki/Multitenancy.

Use case

You're building a SaaS application, and you want records in some tables to belong to multiple users through shared accounts. You want every query to these tables to by default check ownership.

Installation

Require this plugin using composer:

Create required tables:

In your application's src/Application.php:

Usage

Configuring tables

Add the TenantScope Behavior to a table where records should belong to an account. The account ID may be stored in a column in the same table, or it may be stored in another table, associated with the current one.

Either of the above will ensure a where() condition is added to every find() call on the current table, except e.g. uniqueness checks which use [exists()](https://api.cakephp.org/5.0/class-Cake.ORM.Table.html#exists()) internally.

User interface

Once the Behavior is added to a table, every find() call to that table will include a condition for accountField. The account it will be looking for needs to be in a user session: either set directly by user, or automatically by just looking up the last accessed account for that user.

Choosing an account

Direct your users to \Cake\Routing\Router::url(['_name' => 'Bakeoff/Multitenancy:ChooseAccount']) where they can choose an existing accout or create a new one.

Use <?= $this->element('Bakeoff/Multitenancy.account') ?> in your view templates to display current account or link to the Choose Account page.

Setting an account

If you wish to manually set a specific account to be used.

Automatically picking up last used account (Default)

See \Bakeoff\Multitenancy\Model\Behavior\TenantScopeBehavior::detectAccount()

Stopping the Behavior

In some cases you would want to stop checking the ownership for records in a specific table, and just get all entries instead. To do that, simply remove the behavior from that table.


All versions of multitenancy with dependencies

PHP Build Version
Package Version
Requires cakephp/cakephp Version ^5.0
cakedc/users Version ^14.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package bakeoff/multitenancy contains the following files

Loading the files please wait ...