Download the PHP package vertilia/pdo-wrap without Composer

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

pdo-wrap - PDO wrapper library to simplify basic DB operations

PDO (PHP Data Objects) is a standard interface to work with databases from PHP applications. Although it provides a full set of DB-related features for large list of providers, some basic operations seem to lack simplicity.

This package adds some form of simplicity and elegance to your work with PDO-based DB connections from PHP code.

It features:

Example

Quick example for fetching a record set of several rows with inbound named parameter with PDO:

Yes, there is no standard PDO way of having automatic array unfolding when specifying lists...

Compare the same operation with PdoWrap:

Two main PdoWrap concepts implemented in one example. First, we provided type information by appending [i] suffix to the name in the list of parameters. Second, :acls named parameter was unfurled to include several elements from array, since the [i] suffix indicates that corresponding value must be represented as a list of integers.

Also note: :acls placeholder is in the standard PDO form of named parameters, it will be automatically recognized by IDEs as such.

See below for the full list of available types.

Types reference

PdoWrap extends PDO class and adds 3 helper methods that you will use on daily basis:

All these methods receive as their first argument an SQL statement with either question-mark placeholders (as in ?) or named placeholders (as in :name). Second argument is an array with values to use for corresponding placeholders. Additional arguments representing PDO fetch modes may follow, they will be transmitted to corresponding PDOStatement::fetchAll() or PDOStatement::fetch() methods.

For question-mark placeholders typing can not be provided, so the values are stored in a numeric array, exactly like in standard PDO form PDO::prepare()->execute(). This form is kept for compatibility.

For named placeholders, values are passed in associative array, where keys correspond to the name of placeholder in SQL statement, but have type indicator suffix, like in :acls[i].

Type indicator is a suffix appended to parameter name in the list of parameters passed to corresponding query*() method, and it may be in one of two forms, either in angle brackets (like <TYPE>), to specify a single value of specified type, or in square brackets (like [TYPE]), to specify an array of values of specified type.

The following type indicators are available:

sufix param type example
<i> PDO::PARAM_INT "... WHERE id = :id", [":id<i>" => 42]
<s> PDO::PARAM_STR "... WHERE name = :name", [":name<s>" => 'Mary']
<b> PDO::PARAM_BOOL "... WHERE active = :active", [":active<b>" => true]
[i] PDO::PARAM_INT "... WHERE id IN(:ids)", [":ids[i]" => [42, 43]]
[s] PDO::PARAM_STR "... WHERE name IN(:names)", [":names[s]" => ['Mary', 'Juliette']]
[b] PDO::PARAM_BOOL "... WHERE (active, connected) IN((:flags))", [":flags[b]" => [true, false]]

Some examples

Please look into /tests/ for more examples.

More functionality to come, please stay tuned ;-)


All versions of pdo-wrap with dependencies

PHP Build Version
Package Version
Requires php Version >=8
ext-pdo Version *
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 vertilia/pdo-wrap contains the following files

Loading the files please wait ....