Download the PHP package kazimolmez/ezsql-fixed without Composer
On this page you can find all versions of the php package kazimolmez/ezsql-fixed. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download kazimolmez/ezsql-fixed
More information about kazimolmez/ezsql-fixed
Files in kazimolmez/ezsql-fixed
Package ezsql-fixed
Short Description Advance database access library. Make interacting with a database ridiculously easy. An universal interchangeable CRUD system.
License LGPL-3.0-or-later MIT
Informations about the package ezsql-fixed
ezsql-fixed
A class to make it very easy to deal with database connections. An universal interchangeable CRUD system.
Mainly by:
-
The use of
namespacein theglobalfunctions ezFunctions.php file. Usage of the global functions will require the user to begin a.phpfile something like: - Class properties that was accessible by magic methods
get/set, now PSR 1 camelCase. - Renamed
selectofez_mysqlitodbSelect. - Renamed class method and behavior of
selectingtoselect. selecting, and newinsertingmethods, can be called without table name, only the other necessary parameters:- The table name with prefix, can be preset/stored with methods
tableSetup(name, prefix), or setTable(name), setPrefix(append), if called without presetting,falseis returned. - This feature will be added to all database CRUD access methods , each method name will have an
ingending added.
- The table name with prefix, can be preset/stored with methods
- Removed global functions where
tablename passed in, use functions using preset table names ending withing. - renamed cleanInput to clean_string
- renamed createCertificate to create_certificate
- added global get_results to return result sets in different formats
This library has an Database class, an combination of the Factory pattern with an Dependency Injection container hosting. This library now is following many OOP principles, one in which, the methods properties public access has been removed. This library also following PSR-2, PSR-4, PSR-11 conventions, and mostly PSR-1, that's still an work in progress.
- More Todo...
For an full overview see documentation Wiki, which is not completely finish.
Installation
composer require kazimolmez/ezsql-fixed
Usage
This library will assume the developer is using some sort of IDE with intellisense enabled. The comments/doc-block area will hold any missing documentations. For additional examples see phpunit tests, The tests are fully functional integration tests, meaning the are live database tests, no mocks.
The following has been added since version 2.1.7.
General Methods
to_string($arrays, $separation = ',');
clean($string);
create_cache(string $path = null);
secureSetup(string $key = 'certificate.key',
string $cert = 'certificate.crt',
string $ca = 'cacert.pem',
string $path = '.'._DS
);
secureReset();
create_certificate(string $privatekeyFile = certificate.key,
string $certificateFile = certificate.crt,
string $signingFile = certificate.csr,
string $ssl_path = null, array $details = [commonName => localhost]
);
Shortcut Table Methods
create(string $table = null, ...$schemas);// $schemas requires... column()
column(string $column = null, string $type = null, ...$args);
primary(string $primaryName, ...$primaryKeys);
index(string $indexName, ...$indexKeys);
drop(string $table);
Example
innerJoin(string $leftTable = null, string $rightTable = null,
string $leftColumn = null, string $rightColumn = null, string $tableAs = null, $condition = EQ);
leftJoin(string $leftTable = null, string $rightTable = null,
string $leftColumn = null, string $rightColumn = null, string $tableAs = null, $condition = EQ);
rightJoin(string $leftTable = null, string $rightTable = null,
string $leftColumn = null, string $rightColumn = null, string $tableAs = null, $condition = EQ);
fullJoin(string $leftTable = null, string $rightTable = null,
string $leftColumn = null, string $rightColumn = null, string $tableAs = null, $condition = EQ);
Shortcut SQL Methods
having(...$having);groupBy($groupBy);union(string $table = null, $columnFields = '*', ...$conditions);unionAll(string $table = null, $columnFields = '*', ...$conditions);orderBy($orderBy, $order);limit($numberOf, $offset = null)where( ...$whereConditions);select(string $table = null, $columnFields = '*', ...$conditions);create_select(string $newTable, $fromColumns, $oldTable = null, ...$conditions);select_into(string $newTable, $fromColumns, $oldTable = null, ...$conditions);update(string $table = null, $keyAndValue, ...$whereConditions);delete(string $table = null, ...$whereConditions);replace(string $table = null, $keyAndValue);insert(string $table = null, $keyAndValue);create(string $table = null, ...$schemas);drop(string $table = null);alter(string $table = null, ...$alteringSchema);insert_select(string $toTable = null, $toColumns = '*', $fromTable = null, $fromColumns = '*', ...$conditions);
Example for using prepare statements indirectly, with above shortcut SQL methods
Example for using prepare statements directly, no shortcut SQL methods used
Most of shortcut methods have counter global functions available.
They can only be access by beginning your .php file like:
For the functions usage/docs see ezFunctions.php.
For Authors and Contributors
License
ezsql-fixed is open-sourced software licensed originally under (LGPL-3.0), and the addon parts under (MIT).