Download the PHP package simplon/db without Composer

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

     _                 _                   _ _     
 ___(_)_ __ ___  _ __ | | ___  _ __     __| | |__  
/ __| | '_ ` _ \| '_ \| |/ _ \| '_ \   / _` | '_ \ 
\__ \ | | | | | | |_) | | (_) | | | | | (_| | |_) |
|___/_|_| |_| |_| .__/|_|\___/|_| |_|  \__,_|_.__/ 
                |_|                                

Simplon/Db

Version 1.1.0

Intro

Most of my projects require data from at least one type of database. In order to handle all communications I wrote some interface libraries which help me to deal with my daily coding fun. I worked with all supported databases hence all these interfaces were written.

For the last months I am running mostly with a MySQL setup supported with Redis as a cache store. I worked with Memcached before which I believe is stable on what its supposed to do. I closed the Couchbase chapter for now although I believe its a great idea. However, I wasnt really happy with its performance respectively its immature behaviour compared to e.g. Redis.

Supported databases

Dependecies

Big parts of all libraries will work with PHP 5.3. However since I am transitioning to PHP 5.4 you will find partly PHP 5.4 only code. This will grow depending how much time I find. Find all dependencies below:

Installing

You can install Simplon/Db either via package download from github or via composer install. I encourage you to do the latter:

Depending on which database you would like to use pay attention to the above listed dependencies.

1. Usage MySQL

Lets do some coding given that all desired databases and its dependencies were installed.

1.1 MySQL connection

Lets create a MySQL connection instance:

Another way to create a mysql instance is via the . This class creates the instance and holds it as Singleton throughout runtime within a pool of other connections - in case you have to keep more than one connection:

1.2 MySQL query

When querying a database we have again two options. The first option is to access the database directly via EasyPDO which is a PDO wrapper:

The other option requires the use of the . In order to use this class we need to pass a builder pattern class, , to communicate with our database. What advantage does that offer? Well in case that we want to do more things with our query before sending it off we encapsule it as an object within the . From there on we could pass it throughout our application to add more data or alike before sending the query finally to the database:

What both options have in common are the named parameters which are identified by the conditions- / data-array keys.

1.3 MySQL insert/update

The way how to insert/update datasets differs for both options. Again see the following examples for better understanding:

Here goes our SqlManager solution with SqlQueryBuilder:

Difference is that for the latter method we don't need to write any repetitive SQL which in turn results in better maintenance and general code overview.

1.4 MySQL remove datasets

From time to time we also need to remove a couple of datasets. Again, two examples:

SqlManager with SqlQueryBuilder:

1.5 MySQL summary: direct access

1.6 MySQL summary: access via SqlManager with SqlQueryBuilder

2. Usage Redis

Work in progress ...

Changelog

Version 1.1.0


All versions of db with dependencies

PHP Build Version
Package Version
Requires php Version >=5.4
fightbulc/easy_pdo Version 0.1.*
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 simplon/db contains the following files

Loading the files please wait ....