Download the PHP package cymapgt/db without Composer

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

DB

Description

Light Wrapper around Docrines DBAL to handle management of configuration settings for various database types

Installing

Install application via Composer

require "cymapgt/db": "1.*"

Usage

The DB package is built for building database connection settings for various database types supported by Doctrine DBAL

Overview

Getters and Setters

Setting The Database Type

DB::setDbType('mysql');

Replace mysql with either of the following: oracle, mssql, sqlite, sybase, drizzle, postgres

Getting The Database Type of a Connection

DB::getDbType();

Get Database Parameters

DB::getDatabaseParameters();

Return an array of the database parameters stored in the web server / operating system environment. The array is an associative array whose indices vary depending on the database type. Database configuration array keys match the Doctrine DBAL database connection settings listed on the documentation for DBAL (http://docs.doctrine-project.org/projects/doctrine-dbal/en/latest/reference/configuration.html).

An example for MySQL is the array would contain user, password, host, port, dbname, driver, unix_socket and charset indices.

Quality Check on the Configuration Settings

Validating Configuration Settings

DB::validateDbParameters($dbParams);

Accepts an array of the DB parameters. It then does two checks. It ensures that the driver which DBAL will use for the database is actually loaded. It then checks that any of the default settings any of the various databases DBAL can load are present in the array. If any of the two checks fails a cymapgt\Exception\DBException will be thrown.

DB::sanitizeDbParameters($dbParams);

Accepts an array of the DB parameters. Some of the DB connection settings are optional e.g. the charset in mysql. This method discards empty configurations prior to the DB connection being instantiated.

Making DB connection and returning a DBAL instance

Connecting from Environment Settings

//dbObj is an instance of DBAL loading your favourite DB . You can make your queries
$dbObj = DB::connectDb();

Connecting with an Array of config settings

DB::setDbType('mysql');

//define settings in array
$mysqlSettings = array (
 'user' => 'cr7',
 'password' => 'valdebas',
 'host' => 'localhost',
 'port' => '3306',
 'dbname' => 'undecima'
);

//return dbal instance with the mysql dbl loaded
$dbObj = DB::connectDbNew($mysqlSettings);

Closing Database Connections

//Part of resource management and ensuring sensitive information is discarded is destroying resources after use
DB::closeDbConnection();

Testing

DB Tests are provided with the package. SQLITE db is used in the testsuite.

Contribute

License

BSD 3 CLAUSE


All versions of db with dependencies

PHP Build Version
Package Version
Requires php Version >=7.2.0
doctrine/dbal Version ~2.9.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 cymapgt/db contains the following files

Loading the files please wait ....