Download the PHP package topolis/database-connector without Composer

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

DatabaseConnector

Connectors for SQL Databases with parameter binding, escaping and mapping. Also provides interfaces for debugging and profiling.

This class does not feature:

This page shows the basic usage and binding mechanics. If you need more information, please consult the code documentation of the IConnector interface. All database connectors will implement this interface.

Configuration

Configuration is done via a array of parameters that is passed to the ConnectorFactory when a new connection is requested.

Instantiation

A database connector is requested via the generic factory class ConnectorFactory. This class then requests a type specifig connector from the respectife connector factory.

SQL Query

To execute a query, you need to provide a string with the SQL statement containing only static values or placeholders for binding, and an array with all values for your placeholders. The connector will then replace all placeholders with properly escaped, cast and quoted values from this array.

Placeholders are written as a leading colon and the name of the placeholder.

Supported Types for Binding:

Note Placeholders are replaced with str_replace. This means that if you have two placeholders ":street" and ":streetnumber", the first replaceing might also hit :streetnumber, leaving you with something like "'123'number" which breaks your SQL. This can be avoided either by using unique placeholder names or by plaing ":streetnumber" before ":street" in your placeholders array.

Simple Select

The connector can also provide the result of a select query as a already fetched multi-dimensional array. First dimension is the row-number (or index column, if specified) and second dimension is the rows as usual.

The third parameter optionally specifies the column to use as first dimension. If not specified, all rows get a numerical index.

Note If you use a query that does not return a result set, this function will generate an error.

Insert with LastId

If you insert a row into a table with an auto incrementing index column, you can get this id as follows:

Enforcing Parameters with Mapper

The connector has an optional Mapper class, that can be used to specify rules for all given parameters for binding. The $map array used during a query has to follow this format:


All versions of database-connector 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 topolis/database-connector contains the following files

Loading the files please wait ....