Download the PHP package kingsoft/persist-db without Composer

On this page you can find all versions of the php package kingsoft/persist-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 persist-db

DB implementation of Persist

This implementation of the abstract Persist/Base uses a Db connection to make tables in the database available as persistent PHP objects. This generates a class for every table or view in the database extracting PK, possibly with auto increment from tables. With Mariadb it is not possible to extract PK from a view so manual setting the getPrimaryKey() is needed.

Setup

To create the PHP proxies to the tables and views use

which only works if the proper global SETTINGS array is available. (See Kingsoft\Utils. Specifically it requires the proper DB settings and a namespace= setting under [api] to generate the classses in the required PHP namespace. The location can later be added to the composer.json file for autoload. If a PK is not auto increment, a string is generated with bin2hex(random_bytes(12)) with the tablename- as prefix. The atrribute should be larger than CHAR(str_len(tablename) + 1 + 24).

This will create a folder discovered in the root with subfolders based on namespace in the settings file. It also responds with a page listing what is available. To have the proxies autoloaded add the psr-4 section to your composer.jsonand run

The allowedEndPoints array can be used for a persist-rest settings section.

The proxy objects work as a facade for database tables and can now used to (CRUD)

We have turened a normal PHP object in a CRUD object in this way. Yaj!

Searching

Searching is also possible be setting a where and order with a static findall which gets a Generator interface to use with foreach. A findFirst, fineNext, can be used in an Iterator context using the Persist\IteratorTrait. The object itself is a generater and can be used in a yield loop.

Services


All versions of persist-db with dependencies

PHP Build Version
Package Version
Requires php Version >=8.2
kingsoft/db Version >=2.7
kingsoft/persist Version ^3.2
kingsoft/utils Version ^2.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 kingsoft/persist-db contains the following files

Loading the files please wait ....