Download the PHP package grithin/phpdb without Composer

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

PHP Database Tools

Purpose

A convenience wrapper over PDO that has lazy loading and singletons, allows for backup connections, and attempts to reconnect on connection loss

Appetizer

The intent of the Db class is to reduce the amount of time coding common database operations.

Output

One common issue is formatting. Say I want only a column in a database, and I want it as an array

Say I want an array of rows, but I want it keyed on the user id

What if I just want a single, non array value of some column, in some record?

Special Query

For a query, the normal ['id'=> 2] array does not suit for situations of non-equal operators. What if I wanted name is null or id > 10? This is built in to Db

This will result in SQL like

This special type of array interpretation allows the full set of complex query filters to be maintained in an array, instead of having to construct the SQL piece by piece.

The query array can be used on all of the methods

Optional Use

There are a variety of ways you can present your SQL. Db supports

Use

Connecting

The first argument to init is the name of the singleton instance (see SingletonDefault or SDLL class in phpbase).

When Db is called statically, it defaults to the primary singleton instance, which is usually the first initialised.

If you want a instance variable for the primary singleton (the singleton default), you can get it

This is useful for looped code (since there is overhead in using static methods).

You can also get an instance by name

Basic Use

There are two flavors of use

  1. quoted queries
  2. prepared statements

Query

Quoting

All user input placed in raw sql should be quoted or conformed. You can quote with

You can also quote database identities, with

This is sometimes useful when the identity has a name conflicting with a reserved database identity

SQL
Shortcuts

Short cut parameters are automatically quoted if necessary

There are many additional helper functions like the above. I recommended looking through the code. Create a github issue if you require one to be further documented.

Shortcut Magic

Using a custom comparater

There is various behavior based on these rules:

Prepared Statements

The exec function is overloaded to accept three forms. The end result of the forms is to have one joined sql string and one merged variable array.

You can either use pdo statment methods, or you can use Db helper functions. Most of the query based functions have corresponding methods prefixed with as_


All versions of phpdb with dependencies

PHP Build Version
Package Version
Requires php Version >=5.5.9
ext-pdo Version *
grithin/phpbase Version >=2.0.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 grithin/phpdb contains the following files

Loading the files please wait ....