Download the PHP package ksfraser/ksf-common-db without Composer

On this page you can find all versions of the php package ksfraser/ksf-common-db. 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 ksf-common-db

ksf_common_db

Generic, transport-agnostic data dictionary + SQL query builder for KSF PHP projects. DAO/Repository classes are written once against DbConnectionInterface; DI selects the runtime adapter.

Hard rule: FA MUST use native db_* calls

Inside FrontAccounting, the adapter must translate every operation to FA's procedural db_query() / db_fetch_assoc() / db_num_rows() / db_num_affected_rows() / db_insert_id() / db_begin|commit|rollback_transaction() — never a PDO handle, never raw mysqli_* connect/query.

PDO lives only in PdoDbAdapter, for the standalone/portable side (unit tests, CLI tooling, non-FA embedding). PDO is the contract shape, not an FA runtime transport. In production FA, always construct FaDbAdapter.

DI selection

Both implement the same DbConnectionInterface, so repository code is identical in either context. Parameter binding accepts positional ? or named :name placeholders: PdoDbAdapter uses native prepared statements; FaDbAdapter escapes and inlines values (since FA has no prepared statements).

End-to-end example

Notes on namespacing / table prefixing

Heritage

FaDbAdapter is the generalized/moved implementation of the RBAC module's Ksfraser\FrontAccounting\Rbac\Adapter\FaDbAdapter (that interface+adapter pair was the proof of concept for this package). The TableDefinition/QueryBuilder are the generic, parameterized rewrite of the legacy ksf_modules_common MODEL data dictionary / clause builders.

Testing

The FA adapter is tested against in-memory stubs for the FA db_* functions (tests/Support/fa_stubs.php); the PDO adapter is tested against in-memory SQLite.


All versions of ksf-common-db with dependencies

PHP Build Version
Package Version
Requires php Version >=7.3
ext-pdo Version *
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 ksfraser/ksf-common-db contains the following files

Loading the files please wait ...