Download the PHP package clagiordano/weblibs-dbabstraction without Composer

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

BuildStatus License

weblibs-dbabstraction

weblibs-dbabstraction is an simple and lightweight Abstraction library for the database and ORM modules.

SensioLabsInsight

Why use weblibs-dbabstraction ?

The purpose of this project is to propose a simple and lightweight alternative solution instead of more big and complex projects such as Doctrine.

Installation

The recommended way to install weblibs-dbabstraction is through Composer.

Description of the main components

Adapter description

Is a persistence layer which interact with database or other backends. An adapter class must be implements the DatabaseAdapterInterface for compatibility with other components.
The default adapter is the already defined PDOAdapter wich simplify the access to PDO object and related methods.
Other specific adapters can be implemented to easily access to other backends.

Adapter usage

See PDOAdapterTest class (phpunit test class) for full sample usage into tests folder.

Entity description

An entity is an object which expose properties dynamically generated from an array of fields. It is a simple class which have defined the magic methods (set, get ... ).
The entity is automatically used by the mapper class for the operations and can be used to gets and sets its properties.
For more details please see the SampleEntity class into testdata folder.

Entity usage

An entity class must be extends AbstractEntity as:

Then can be used:

Mapper description

A mapper is a glue between Entity and Adapter objects which expose high level method to use and persists data.
A mapper class must be extends the AbstractMapper:

then must be declare two protected properties to connect database table for persistence and the related entity class:

therefore must be implements the abstract method createEntity for the correct mapping between table fields and the desidered entity properties:

You can also define additional methods if necessary or override existing ones such as insert, update, delete etc to modify its behavior.

Mapper usage

To improve control and security AbstractMapper's methods can be overrided:

As you can see, this overrided method require explicitly an instance of SampleEntity to works, the same way you can run a validation or additional arguments formatting/sanitizing or whatever you want.

Legal

Copyright (C) Claudio Giordano [email protected]


All versions of weblibs-dbabstraction with dependencies

PHP Build Version
Package Version
Requires php Version >=5.4
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 clagiordano/weblibs-dbabstraction contains the following files

Loading the files please wait ....