Download the PHP package bmware/dmk without Composer

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

BMware DMK

BMware database management kit

composer: composer require bmware/dmk

there are currently 2 basic setup examples, the first is the normal db setup:

DatabaseConfig::create() takes in an array of arguments.

The second one is a WordPress based setup.

other than then the setup, using either class is the same. however, under the hood, the WordpressDatabase uses the global wpdb to make queries to the database


Queries

there are currently 4 query actions prebuild with this library:

each action has its own query object with its own modifiers. all insert and where statements will automatically be turned into prepared statements.

every object has the create(string $table) function wich sets the table and returns a instance of the given query object.

every object has the union(string $table = "") function which if used creates a new instance of the given query object, and returns it. then on the end of the query, the bot of them will be put toghetter with a union. Will use the previous queries' table name if none is given

CreateQuery, ReadQuery and DeleteQuery have 3 "where" functions which are:

ReadQuery has a join function which takes in 3 arguments, to produce a join SQL statement

the define function also accepts just the query as a argument

aditionally, a custom query can be made in the following way

note that when using the function method, the query needs to be returned


DatabaseResult

Every Query result will return a DatabaseResult object, which holds either a success message, or the rows of the query. You will also have access to various different result modifiers from that point, in order to select one out of the many results. This will allow you to query all of the data once, and internally select what you want to see at any given point. the data is never overridden so you will always have the result of query

example of the result modifiers in work

$result->setUseModified(boolean $value) sets the $result->useModified variable to the value of $value, which will make all modifier functions use the $result->modifiedRows as the base point for the function

$result->getUseModified() returns the current value of $result->useModified

$result->getRowByIndex(int $index) returns the row with the given $index

$result->getRowsByFieldValue(string $field, string $value) returns all rows where the given $field has the same value as $value

$result->selectfields(string ...$fields) returns only the fields specified in this function

$result->getRows(string $flag) depending on the value of $flag returns either the previous modified rows, base rows or current modified rows, the flags are: "previous" for the previous modified rows or "modified" for the current modified rows, anything else will just return the queries base result


Something to talk about

In my eyes, what makes this library "good" is that the query definitions are done in functions. meaning that you can let your programming spirit loose on it, and set up all kind of conditional checks on for example the schema. before the query is even excecuted this means that you can do just about everything before the query is excecuted.

Planning

  1. Migration support, make migration a thing that is easy to do
  2. Schema support, make a standard schema definition that can be automatically transformed into a Create migration
  3. CLI tool, a cli tool to make migrations easier.

any and all suggestions are welcome.


All versions of dmk with dependencies

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

Loading the files please wait ....