Download the PHP package techmobi/multidb without Composer

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

OctoberCMS Multi Databases

OctoberCMS Plugin to create SaaS applications in different databases, making it easier to manage multiple clients. To develop this plugin I reused several classes that OctoberCMS itself has, trying to create the simplest code possible.

Important This plugin is still in the testing and development stages, use at your own risk.

REQUERIMENTS

Multisite

Usage

Installation

You can install this plugin either via composer.

With Composer

Execute below at the root of your project.

Configuring file database.php

You will need to make a small change to the file in config/database.php

Settings MultiDB - Backend

To use MultiDB you will need to follow the steps below.

Important It is necessary to have a user in the database who can Read, Edit and Update data, as well as create new databases.

MultiDB Plugin

First Navigate to Settings -> MultiDB -> Settings Plugin, in this place you can configure the prefixes that the databases may have, configure what will be the names of each databases, and also, you can select which plugins will be replicated for the new created instances.

Save changes to update data

Added new Hosts MultiDB

Navigate to Settings -> MultiDB -> Hosts, in this place you can add new databases and list which domains will be used. At this point comes the multisite relationship. With this configuration, it will be possible to identify the databases according to each domain accessed.

Using in PHP Code

After making the configurations mentioned above, it is necessary to edit the models of the plugins.

Trait UsesMultiConnection

This trait is responsible for managing the data that will be saved in the databases. It will be necessary to add the following trait to all models that have the replicated database, example below:

Trait UsesMainConnection

This Trait allows you to relate a table from the main database to the child database, for example, you have a Customers plugin, this plugin is using the UsesMultiConnection trait, however ou have a Core plugin that has a Country Model, this plugin you are not replicating, but you need to relate the country_id attribute of the customers table to the country table, in this situation there would be an error because MultiDB change connections momentarily, so as not to have a problem, you need to add in your model Country the trait below.

BONUS: MultiFiles with MultiDB

If in case you want to save the files in the new database, you will need to use the model Techmobi\Multidb\Models\File, example use:

MediaLibrary

For now I was unable to make a class to manage MediaLibrary, however you can change the file System\Classes\MediaLibrary, adding the following codes:

Events Change Schema

An event has been added to force a database schema change, how does it work? Imagine that you have several databases created, however you do not want to be connecting at each URL, with that a database session was implemented, and below there is an event that you can pass a schema.


All versions of multidb with dependencies

PHP Build Version
Package Version
No informations.
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 techmobi/multidb contains the following files

Loading the files please wait ....