Download the PHP package brainstormit/bitbuilder without Composer

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

BITBUILDER

About BITbuilder

BITbuilder is a MySQL querybuilder created by software development interns at Brainstorm IT and uses the PHP Data Objects extension (PDO) for accessing databases. This querybuilder is designed to be as simple as possible with almost no learning curve attached. Laravels querybuilder has been an inspiration to how we wanted the BITbuilder syntax to look like, so syntax wise a few comparisons can be made.

Requirements

Installation

You can install BITbuilder through composer:

Get started!

First things first! We need a PDO Database object for BITbuilder to work.
The Database helper class can easily create one (You don't necessarily need to use this).
Navigate to src/helpers/Database.php and edit your database configurations:

With the database configurations all set up we can create our database object, and even more important: our first BITbuilder object!

Selecting your table

Before we start with the fun stuff we need to select
the table we want to work with.
Let's assume we want to select the users table:

SELECT statements

If you want to select all users in the users table we can perform an
SELECT * with the following:

It's also possible to provide an array with all the fields you want to select:

WHERE clauses

You can add a WHERE clause to your statement with the following:

A different operator can be provided as second parameter.
The third parameter then becomes the value:

Valid operators: = != < > >= <=

AND & OR operators

OR & AND operators can be added to your clauses with the following:

and_ and or_ have an underscore after their method name because PHP doesn't allow PHP reserved names to be used as method names.

ORDER BY keyword

Ordering a selected record can be done with the following:

The default order is ascending. This can easily be changed by adding DESC as second parameter:

GROUP BY keyword

Grouping a selected record can be done with the following:

LIMIT keyword

Limiting the amount of items in a record can be done by adding a LIMIT to your query:

INSERT statements

Inserting a new record into the users table would look similar to this:

The array which contains your insert info has to be associative.
The array key represents the table field, and the array value represents
the value you want to insert into your table.

DELETE statements

Deleting a record from the users table would look similar to this:

The second and third parameter represents the WHERE clause.
A where clause can also be added manually:

The exec() method is needed to manually execute the query.

UPDATE statements

Updating a record in the users table would look similar to this:

The array which contains your update info has to be associative, just like the insert() method.
The array key represents the table field you want to update, and the array value represents
the value.

Just like the delete() method it's possible to manually add a WHERE clause if you'd like:

Joins

Let's assume we want to develop a platform where users can post pictures.
If you want to select all pictures that belong to a certain user, your join would look similar to this:

The table yould want to join with should be passed as the first parameter.
The second and third parameter represent the ON of the join

Available joins: INNER JOIN (join()), LEFT JOIN (leftJoin()), RIGHT JOIN (rightJoin()), OUTER JOIN (outerJoin())

Executing raw queries

Raw queries can be executed as well:

or:

License

BITbuilder is open-sourced software licensed under the MIT license.


All versions of bitbuilder with dependencies

PHP Build Version
Package Version
Requires php Version >=5.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 brainstormit/bitbuilder contains the following files

Loading the files please wait ....