Download the PHP package ad7six/dsn without Composer

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

PHP DSN #ARCHIVED

A utility for parsing and generating service DSNs

What is a DSN?

A data source name (DSN) is a string which defines how to connect to a service. Since it's a string, it's portable, not language or implementation dependent and anything capable of parsing it can know how to connect to the service it points at.

What does this repo do?

This repo only provides a means of converting a DSN string into an array and vice versa.

Wrapper classes?

When using a wrapper class, this repo provides an array in the format expected by a particular consumer. So for example, the CakePHP wrapper classes provide arrays in the format the framework understands for a given DSN string.

Basic usage

The main dsn class implements a parse function which returns a dsn instance:

use \AD7six\Dsn\Dsn;

$url = $_ENV['SOME_SERVICE_URL'];
$dsn = Dsn::parse($url);

The class of the returned object is dependent upon the scheme of the service url, for example:

// $dsn is an instance of \AD7six\Dsn\Db\MysqlDsn;
$dsn = Dsn::parse('mysql://host/dbname');

// $dsn is an instance of \AD7six\Dsn\Db\SqliteDsn;
$dsn = Dsn::parse('sqlite:///path/to/name.db');

For unknown schemes - the an instance of the called class is returned. This also means that a more specific instance can be obtained by using a less-generic class where appropriate:

// $dsn is an instance of \AD7six\Dsn\Dsn;
$dsn = Dsn::parse('newdb://host/dbname');

// $dsn is an instance of \AD7six\Dsn\DbDsn;
$dsn = DbDsn::parse('newdb://host/dbname');

In all of the above cases, the returned instance is the "raw" dsn data:

// $dsn is an instance of \AD7six\Dsn\Db\MysqlDsn;
$dsn = Dsn::parse('mysql://host/dbname');

$dsn->toArray();
[
    'scheme' => 'mysql',
    'host' => 'host',
    'port' => 3306,
    'database' => 'dbname'
]

If the behavior of the raw dsn needs to be modified - use a wrapper implementation

References

12 factor applications


All versions of dsn with dependencies

PHP Build Version
Package Version
Requires php Version >=5.4.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 ad7six/dsn contains the following files

Loading the files please wait ....