Download the PHP package bentools/pdoextended without Composer

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

PDO Extended

A PDO extension that will help your developer's life.

Features :

Full Example usage :



define('PDO_DSN', 'mysql:host=localhost;dbname=test');
define('PDO_USERNAME', 'root');
define('PDO_PASSWORD', null);

// Normal call
$cnx    =   new PDOExtended(PDO_DSN, PDO_USERNAME, PDO_PASSWORD);

// Let's create our working table...
$cnx->sql("CREATE TABLE IF NOT EXISTS
                        TVSeries (
                            Id TINYINT(3) UNSIGNED NOT NULL AUTO_INCREMENT,
                            Name VARCHAR(255),
                            Channel VARCHAR(40),
                            PRIMARY KEY (Id),
                            UNIQUE (Name)
                        ) ENGINE=InnoDb");

// Example of insert with a prepared statement
$insertStmt =   $cnx->Prepare("INSERT IGNORE INTO TVSeries SET Name = ?");
$tvSeries   =   Array('Games Of Thrones', 'The Big Bang Theory', 'Dexter');

// For each Series, we play the insert statement with a different value
foreach ($tvSeries AS $series)
    $insertStmt->sql($series);
    // $series is mapped to the "Name" bound value - since it's a string, it'll be bound as PDO::PARAM_STR
    // If $series was an integer, it'd be bound as PDO::PARAM_INT automatically

// The expected parameter may also be an array, in case you have more values to bind
$insertStmt =   $cnx->Prepare("INSERT IGNORE INTO TVSeries SET Name = :Name");
foreach ($tvSeries AS $series)
    $insertStmt->sql(Array('Name' => $series));

// Now, let's update the previous rows with the Channel info.
$channels    =   Array('HBO', 'CBS', 'ShowTime');

// You're not obliged to prepare your statement before executing them. It's the sql() method's job.
$cnx->sql("UPDATE TVSeries SET Channel = ? WHERE Name = ?", Array($channels[0], $tvSeries[0]));
$cnx->sql("UPDATE TVSeries SET Channel = :Channel WHERE Name LIKE :Name", Array('Channel' => $channels[1], 'Name' => $tvSeries[1]));
$cnx->sql("UPDATE TVSeries SET Channel = :Channel WHERE Id = :Id", Array('Channel' => $channels[2], 'Id' => 3)); // Id will be cast as PDO::PARAM_INT because 2 is a PHP integer

// Now, let's easily retrieve some infos.

// All the table into a multidimensionnal array.
var_dump($cnx->sqlArray("SELECT * FROM TVSeries"));

// Juste the Big bang theory row
var_dump($cnx->sqlRow("SELECT * FROM TVSeries WHERE Id = ?", 2));

// A list of series
var_dump($cnx->sqlColumn("SELECT Name FROM TVSeries WHERE Channel IN (". PDOStatementExtended::PlaceHolders($channels) .")", $channels)); // PlaceHolders function will output "IN (?, ?, ?)";

// What's the channel of Dexter ?
var_dump($cnx->sqlValue("SELECT Channel FROM TVSeries WHERE Name LIKE :Name", Array('Name' => 'Dexter')));

// Another way to request it
var_dump($cnx->sqlValue("SELECT Channel FROM TVSeries WHERE Name LIKE ?", Array('Dexter')));

// Another way to request it
var_dump($cnx->sqlValue("SELECT Channel FROM TVSeries WHERE Name LIKE ?", 'Dexter'));

// Association key => value
var_dump($cnx->sqlAssoc("SELECT Channel, Name FROM TVSeries WHERE Id = ?", 3));

// Association key => associative array
var_dump($cnx->sqlAssoc("SELECT Channel, Id, Name FROM TVSeries WHERE Id = ?", 3, PDOExtended::TO_ARRAY_ASSOC));

// Association key => indexed array
var_dump($cnx->sqlAssoc("SELECT Channel, Id, Name FROM TVSeries WHERE Id = ?", 3, PDOExtended::TO_ARRAY_INDEX));

// Association key => stdClass
var_dump($cnx->sqlAssoc("SELECT Channel, Id, Name FROM TVSeries WHERE Id = ?", 3, PDOExtended::TO_STDCLASS));

// Association key => value, multiline version (array of keys => values)
var_dump($cnx->sqlMultiAssoc("SELECT Channel, Name FROM TVSeries WHERE Id IN (?, ?)", Array(1, 2)));

// Association key => associative array, multiline version (array of keys => associative arrays)
var_dump($cnx->sqlMultiAssoc("SELECT Channel, Id, Name FROM TVSeries WHERE Id IN (?, ?)", Array(1, 2), PDOExtended::TO_ARRAY_ASSOC));

// Association key => indexed array, multiline version (array of keys => indexed arrays)
var_dump($cnx->sqlMultiAssoc("SELECT Channel, Id, Name FROM TVSeries WHERE Id IN (?, ?)", Array(1, 2), PDOExtended::TO_ARRAY_INDEX));

// Association key => stdClass, multiline version (array of keys => stdClasses)
var_dump($cnx->sqlMultiAssoc("SELECT Channel, Id, Name FROM TVSeries WHERE Id IN (?, ?)", Array(1, 2), PDOExtended::TO_STDCLASS));

// You can also invoke all theses methods from a PDOStatementExtended object
var_dump($cnx->prepare("SELECT Channel, Id, Name FROM TVSeries WHERE Id IN (?, ?)")->sqlMultiAssoc(Array(2, 3), PDOExtended::TO_STDCLASS));

// How long the query has taken ?
$stmt   =   $cnx->prepare("SELECT * FROM TVSeries WHERE Id = :Id OR Name LIKE :Name");
$res    =   $stmt->sqlArray(Array('Id' => 1, 'Name' => 'Dexter'));
var_dump($stmt->getDuration());

// What was the real query played ?
var_dump($stmt->debug()->preview());

// You can disconnect : every call afterwards will result in a PDO Exception until you invoke the Reconnect() method
$cnx->disconnect();

// You can also Pause the connection. It actually disconnects from MySQl, but on the next call (sql, query, sqlArray etc) the connect() method will automatically be called so you never have a "not connected" exception thrown
$cnx->pause();

// Why doing this ? When you have a big treatment to do (parsing a big xml for instance), this prevents from getting "sleep connections" issues

// Every other PDO method is available... $cnx->query() ou $cnx->setAttribute(), etc.

Installation
------------
Add the following line into your composer.json :

    {
        "require": {
            "bentools/pdoextended": "dev-master"
        }
    }  

Enjoy.

All versions of pdoextended with dependencies

PHP Build Version
Package Version
Requires php Version >=5.3
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 bentools/pdoextended contains the following files

Loading the files please wait ....