Download the PHP package benclerc/datamanagement without Composer

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

Data Management

PHP Class providing simple and compact database requests. Useful for small projects without ORM. With this class you can :

This class was not tested on PHP version < 7.3, thus it is not recommended to use this class on < 7.3 PHP projects.

Table of contents

Getting started

  1. Get Composer
  2. Install the library using composer composer require benclerc/datamanagement.
  3. Add the following to your application's main PHP file require 'vendor/autoload.php';.
  4. Instanciate the class with the database's connection information $db = \DataManagement\DataManagement('pgsql', 'localhost', 5432, 'myDb', 'myUser', 'myUserPassword');.
  5. Start using the library $books = $db->select('BOOKS');.

Documentation

You can find a full documentation here.

connector()

This method returns the PDO object connected to the database.

beginTransaction()

This method starts a SQL transaction. Every call to other methods following this one will be in the transaction until you end it with commit() or rollback().

commit()

This method ends a SQL transaction by applying the changes. Be careful, this method won't return the state of the commit ; even if it returns TRUE it does not mean the commit was successful, it means the commit was successfully sent to the database. You must check the state of every request you do during the transaction if you want to know if your transaction was successful.

rollback()

This method ends a SQL transaction by rolling back the changes. Nothing done during the transaction will be applied.

debug()

This method is used to enable debug mode for the next request (only works on methods forging SQL request like select(), insert(), update(), delete(), count(), sum()). instead of executing the forged request, it will be returned as a string.

Parameters :

Return value : itself.

Examples :

select()

This method is used to retrieve data from the database. It can be a very simple request like getting a whole table or a more complex request with ordering, table joins, filters, limits and offsets.

Parameters :

Return value : If debug set to TRUE : return forged SQL request, else returns the fetchAll results.

Examples :

customSelect()

This method is used to retrieve data from the database using a custom SQL request.

Parameters :

Return value : Array of the fetchAll results.

Examples :

insert()

This method is used to insert data in the database. It is highly recommended to use transaction when inserting data.

Parameters :

Return value : If debug set to TRUE : return forged SQL request, else returns array with 2 rows : 'raw' => the database's raw response, 'lastInsertId' => the last insert id.

Examples :

customInsert()

This method is used to insert data in the database using a custom SQL request.

Parameters :

Return value : an array with 2 rows : 'raw' => the database's raw response, 'lastInsertId' => the last insert id.

Example :

update()

This method is used to update data in the database. It is highly recommended to use transaction when updating data.

Parameters :

Return value : If debug set to TRUE : return forged SQL request, else returns request's status as boolean.

Example :

delete()

This method is used to delete data from the database. It is highly recommended to use transaction when deleting data.

Parameters :

Return value : If debug set to TRUE : return forged SQL request, else returns request's status as boolean.

Example :

count()

This method is used to count how many rows match the criterias.

Parameters :

Return value : If debug set to TRUE : return forged SQL request, else returns request's status as boolean on fail or int on success.

Example :

sum()

This method is used to get the sum of several rows matching criterias.

Parameters :

Return value : If debug set to TRUE : return forged SQL request, else returns request's status as boolean on fail or int on success.

Example :

customSQL()

This method is used to execute a custom SQL request.

Parameters :

Return value : the array of the raw response.

Example :


All versions of datamanagement with dependencies

PHP Build Version
Package Version
Requires php Version >=7.3.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 benclerc/datamanagement contains the following files

Loading the files please wait ....