Download the PHP package piotr-cz/cockpit-sql-driver without Composer

On this page you can find all versions of the php package piotr-cz/cockpit-sql-driver. 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 cockpit-sql-driver

SQL Driver for Cockpit CMS

Latest Version Build status

This addon allows to use MySQL/ MariaDB/ PostgreSQL databases instead of default MongoDB/ SQLite.

Requirements

Compatibility

To run Cockpit 0.9.2+ at least version 1.0.0-beta.2+ is required.

Installation

Note:

If you installed addon before ever starting Cockpit, some errors may come up once you start it.

To solve it, start Cockpit with database configuration it supports out of the box to trigger Cockpit warmup and then set configuration specific for this addon.

Manual

Download latest release and extract to COCKPIT_PATH/addons/SqlDriver directory

Using Cockpit CLI (development version)

Using Composer

  1. Make sure path to cockpit addons are defined in your projects' composer.json file

  2. In your project root run command

Configuration

Example configuration for COCKPIT_PATH/config/config.php file:

Rererence: Cockpit docs > Configuration

Database content migration (Cockpit v0.6.0+)

  1. Export data to COCKPIT_PATH/migration subdirectory

  2. Switch database to sqldriver (see Configuration)

  3. Import data from COCKPIT_PATH/migration subdirectory

Reference: Cockpit docs > CLI

Testing

There are integration tests included in the package. These require Cockpit CMS as a dev dependency and use it's MongoHybrid\Client API to run actions on database.

To run tests

  1. Install dependencies

  2. Configure test database

    copy configuration

  3. Run tests with PHPUnit

Drawbacks

Cockpit doesn't provide public API to register custom database drivers so this addon monkey-patches Cockpit Driver selector client (MongoHybrid Client). This means that there is no guarantee that this addon will work in future versions of Cockpit.

Collection filters

Not implemented

Work differently

Manual database optimizations

By default package creates virtual column _id with unique index on every created collection.

If you would like to speed up filters on other collection fields - add virtual column with suitable index and type.

For example to add virtual column of integer type for field FIELD_NAME in TABLE_NAME collection, use

Known issues

Error: Call to a member function toArray() on null

This happens when starting cockpit for the first time and this addon is installed. The reason is in that native Cockpit modules try to accesss storage which is initialized later (during custom modules bootstrap).

Cockpit must be started for the first time without being configured to use SQL driver.

Solution 1 Start Cockpit with database configuration it supports out of the box and than switch to sqldriver as described here

Solution 2 Manually create file COCKPIT_STORAGE_FOLDER/tmp/webhooks.cache.php with content

Copyright and license

Copyright since 2019 Piotr Konieczny under the MIT license.


All versions of cockpit-sql-driver with dependencies

PHP Build Version
Package Version
Requires php Version >= 7.1
ext-json Version *
ext-pdo Version *
composer/installers Version ^1.2
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 piotr-cz/cockpit-sql-driver contains the following files

Loading the files please wait ....