Download the PHP package stefangabos/zebra_database without Composer

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

zebrajs

Zebra Database  Tweet

A PHP MySQLi database wrapper that's lightweight, secure and feature-rich, providing methods for interacting with MySQL databases that are more secure, powerful and intuitive than PHP's default ones.

Latest Stable Version Total Downloads Monthly Downloads Tests PHP License

Zebra_Database supports transactions and provides ways for caching query results either by saving cached data to the disk, in the session, by using memcache or redis.

The library provides a comprehensive debugging interface with detailed information about the executed queries: execution time, returned/affected rows, excerpts of the found rows, error messages, backtrace information, etc. It can also automatically EXPLAIN SELECT queries (so you don't miss those keys again!).

Provides debugging information when called from CLI (command-line interface) and supports logging queries done through AJAX requests.

It encourages developers to write maintainable code and provides a better default security layer through parameterized queries, where values are given separately from the SQL and are automatically escaped and quoted for you.

The code is heavily commented and generates no warnings/errors/notices when PHP's error reporting level is set to E_ALL.


:microscope: See the debugging console in action

Key Features of this PHP MySQLi Wrapper

zebra database debugging console showing query details

:notebook_with_decorative_cover: Documentation

Check out the comprehensive PHP MySQLi wrapper documentation.

🎂 Support the development of this project

Your support is greatly appreciated and it keeps me motivated continue working on open source projects. If you enjoy this project please star it by clicking on the star button at the top of the page. If you're feeling generous, you can also buy me a coffee through PayPal or become a sponsor. Thank you for your support! 🎉

Star it on GitHub Donate

Requirements

PHP 7.4.0+ with the mysqli extension activated, MySQL 4.1.22+

The library itself still runs on PHP 5.6.40 and newer, and this is verified on every change with PHPCompatibility via composer check-compat-legacy, and by linting and smoke-testing it on a real PHP 5.6.40 via tests/run-legacy.sh. The supported version is given as 7.4 because that is the oldest version the test suite runs on, and supported should mean tested. If you are on PHP 5.6.40 to 7.3 the library will very likely work, but you are on your own.

For using memcache as caching method, PHP must have the memcache extension installed. The memcache_compressed property, which hands the compressing over to memcache instead of doing it in the library, additionally requires that extension to have been built with zlib support

For using redis as caching method, PHP must have the redis extension installed. The redis_compressed property, which hands the compressing over to the extension instead of doing it in the library, additionally requires that extension to have been built with --enable-redis-lzf

Query results are compressed either way - the two _compressed properties only decide whether the library or the caching server does it, and caching works without either of them.

Installation

You can install Zebra Database via Composer

Or you can install it manually by downloading the latest version, unpacking it, and then including it in your project

How to use

Connecting to a database
Running queries
An INSERT statement
An UPDATE statement

There are over 40 methods and 20 properties that you can use and lots of things you can do with this library. I've prepared an awesome documentation so that you can easily get an overview of what can be done. Go ahead, check it out!

Running the tests

The test suite is not part of the released package - if you want to run them you need a git checkout of the repository.

The tests run against a real MySQL instance and drop and recreate their tables at the start of every run - test_users, test_products and test_categories, in a database of their own - so point them at a server you are happy for them to write to.

Running them wants MySQL 5.7 or newer - a requirement of the suite, not of the library, which still supports 4.1.22+. What sets that floor is strict mode: the suite asserts what MySQL does with a value too long for its column, and that is one thing under STRICT_TRANS_TABLES and quite another without it, so rather than have tests that pass either way the requirement is checked before the first test runs and reported if the server does not meet it. 5.7 is simply where strict mode became the default - an older server will do if it is switched on there, and the tables themselves only need 5.5.3 for utf8mb4 - but 5.7 and up is what this is run against.

On Windows use tests\run-tests.bat, which does the same things in the same order.

Run it with no arguments and it checks everything - the suite, then the PHP compatibility, static analysis and coding standard checks. Give it any argument and it runs only the tests you asked for, which is what you want while working on something:

The suite needs PHP 7.4 or newer. The library goes back further than that, and tests/run-legacy.sh is what backs that claim up - it lints everything that ships and round-trips a row on a real PHP 5.6.40 in a container, against a MySQL of its own, so it needs Docker running:

The three checks are also available on their own, and those are the ones to reach for while working through whatever they report, since they take arguments of their own:

A handful of tests cover the memcache and redis caching backends and skip themselves unless both the extension and a running server are found. Neither needs any configuration:

Two of those go further and skip unless the redis extension was built with --enable-redis-lzf, since what they check is that compression is handed over to the extension rather than done twice. All of them run on every push through GitHub Actions, against PHP 7.4 through 8.5 with both servers alongside.

Coverage is not produced on an ordinary run. Asking for it requires either pcov or Xdebug to be installed - without one of them PHPUnit reports "No code coverage driver available", runs the tests anyway and writes no report:


All versions of zebra_database with dependencies

PHP Build Version
Package Version
Requires php Version >=7.3.0
ext-mysqli 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 stefangabos/zebra_database contains the following files

Loading the files please wait ...