Download the PHP package geeshoe/db-connector without Composer

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

db-connector

Build Status

Db-Connector is a tool set to help manage and provide database connection's within your PHP application.

Support for PHP 7.1 ended on December 1st, 2019. Please upgrade to the latest version of db-connector.

Getting Started

Db-Connector is intended to be fully compliant with PSR-1, PSR-2, & PSR-4

Latest Recommended version: v2.1.0 Released May 2nd, 2019

Test coverage: 99% Includes Unit and Functional Tests.

Prerequisites

Db-Connector works with both MySQL and MariaDb database's. Support for other database's is intended to be implemented in future releases.

To check if the above PHP extension's are enabled, run the following command in the CLI or use phpinfo() in a non-public page on your web server.

Installing

To add Db-Connector to your project, run:

Configure

Db-Connector configuration parameters can be set using various methods. JSON, Array, and Environment configuration adapters are available out of the box. Other formats are soon to follow.

It is possible to brew your own config adapter by extending the AbstractConfigObject.


Environment Variable Config

The EnvConfigAdapter parse's the following environment variable's for the database connection:

GSD_DB_CA, GSD_DB_CERT, GSD_DB_KEY, & GSD_DB_VERIFY are only required if GSD_DB_SSL is set to true.


JSON Config

Copy the included dbConnector_DIST.json to a secure location outside of your projects public web root.

Change the values to reflect your database configuration.

The param is not required but must be declared in the config file. If you prefer to handle which database to use within your application, simply set to .

Persistent connections can be enabled by setting to .

are only required if is set to true. , , , & are all optional depending on your environment.


Array Config

Using an array of configuration param's is possible by using the ArrayConfigAdapter. An array of connection param's is required by the ArrayConfigAdapter __construct() method.

For more information on Persistent Connections.

Usage

Determine which method you want to use for parsing the database credentials.

Using the EnvConfigAdapter:

Using the JsonConfigAdapter:

Using the ArrayConfigAdapter:

After calling getParams() from either of the above method's, create a new PDO database connection as follow's:

getConnection() return's a new PDO object that is ready to use.

Documentation

More extensive documentation on Db-Connector is to be released soon. In the meantime, all of the methods and properties are well documented within the code base.

Authors

Source available at (https://github.com/geeshoe/db-connector)

For questions, comments, or rant's, drop me a line at


All versions of db-connector with dependencies

PHP Build Version
Package Version
Requires php Version ^7.1
ext-pdo_mysql Version *
ext-pdo Version *
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 geeshoe/db-connector contains the following files

Loading the files please wait ....