Download the PHP package vivait/tenant-bundle without Composer

On this page you can find all versions of the php package vivait/tenant-bundle. 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 tenant-bundle

TenantBundle Scrutinizer Code Quality Build Status

Allows separate Symfony environments per tenant

Installation

Step 1: Download the Bundle

Open a command console, enter your project directory and execute the following command to download the latest stable version of this bundle:

This command requires you to have Composer installed globally, as explained in the installation chapter of the Composer documentation.

Step 2: Enable the Bundle

Then, enable the bundle by adding the following line in the app/AppKernel.php file of your project:

Step 3: Altering your kernel to be tenanted

Because a kernel environment is immutable, we need to decipher the tenant before booting the kernel. We have created a tenanted kernel for your AppKernel to extend, which acts as a middleware to Symfony's Kernel. When using this middleware, you will need to implement a couple of methods.

The first abstract method, is used to return an array of Tenant objects. A number of providers are provided, although this could also implement custom logic, if needed.

The second abstract method, is used to locate the current tenant, so the kernel can alter the environment based on this. A number of locators are provided, although this could also implement custom logic, if needed.

Below is an example of the implementation of both of these, and if you're unsure what any of this means, is an advised starting point:

Step 4: Creating environments for each tenant

An environment will be automatically created for each tenant by Symfony. However, if you choose to use the default method, as provided by Symfony, then you will need to create a new config file for each tenant environment. Each tenant environment is prefixed with 'tenant_', so if you have a tenant called 'mytenant', then you'd need to create 'app/config/config_tenant_mytenant.yml'. You can configure this behaviour by changing your method, but you will also need to customise the patterns used in ConfigProvider to match the change in config structure.

You could also use an alternative provider to provide a list of tenants, for example there is a YamlProvider that retrieves a list of tenants from a YAML file.

Running commands against tenants

Since each tenant now runs under a separate environment, when updating your application you'll need to run commands such as cache clear or doctrine migrations against each tenant's environment. A special binary has been provided to make this easier and is used by simply prefixing your usual command with the tenant binary:

This will automatically run the cache clear command against all tenants.

Parallel commands & daemons

If you want to run a command in parallel, for example a daemon command, then you can specify this using the -P option:

In the example above, this will run the cache clear command for up to 10 tenants in parallel. If you specify -P as 0 then the binary will automatically set the number of processes to match the number of tenants.

Specifying specific tenants

You can specify specific tenants to run commands against using the -t option:

Other options

You can get a full list of options using -h:


All versions of tenant-bundle with dependencies

PHP Build Version
Package Version
Requires php Version >=5.3.2
symfony/framework-bundle Version ~2.3|~3.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 vivait/tenant-bundle contains the following files

Loading the files please wait ....