Download the PHP package symbiotic/database without Composer
On this page you can find all versions of the php package symbiotic/database. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download symbiotic/database
More information about symbiotic/database
Files in symbiotic/database
Package database
Short Description Database connection configurator with the ability to define a connection by namespace.
License BSD-3-Clause
Informations about the package database
Symbiotic Database
README.RU.md РУССКОЕ ОПИСАНИЕ
Database connection configuration package with the ability to select a connection depending on the namespace.
Installing
Description
The package contains two main interfaces and a manager:
ConnectionsConfigInterface
- Responsible for storing connectionsNamespaceConnectionsConfigInterface
- Responsible for storing namespace connectionsDatabaseManager
- Manager, contains all two interfaces, \ArrayAccess , \Stringable-
Usage
Initializing Connections:
Methods ConnectionsConfigInterface
и \ArrayAccess
:
Methods NamespaceConnectionsConfigInterface
:
Behavioral Features
Additionally, there is a smart __toString() method. If namespace search is enabled isActiveNamespaceFinder()
,
it looks for a connection by namespace via the findNamespaceConnectionName()
method
or returns the default connection from the getDefaultConnectionName()
method
Also pay attention to the behavior when the definition of connections by namespaces is disabled!
Examples:
For Symbiotic Applications
Symbiotic framework applications have a provider to automatically establish a connection from the application settings relative to the base nemspace of the package.
-
To add a database selection field, create a field named
database_connection_name
in the package settings fields: - In the application section
"app"
add the provider \Symbiotic\Database\AppNamespaceConnectionProvider