shaunfreeman / php-mysql-xdevapi
PSR-11 library for easy setup of MySQL X DevAPI into Laminas.
Requires
- php: ^7.3
- ext-json: *
- ext-mysql_xdevapi: *
- laminas/laminas-hydrator: ^3.0
- laminas/laminas-paginator: ^2.8
- psr/container: ^1.0
Requires (Dev)
- ext-uopz: *
- codeclimate/php-test-reporter: ^0.3
- dg/bypass-finals: ^1.1
- phpspec/prophecy-phpunit: ^2.0
- phpunit/phpunit: ^9.0
- squizlabs/php_codesniffer: 3.5.0
README
This is a PSR-11 library for easy setup of MySQL XDevAPI into Laminas. To use this library you must have the PECL mysql_xdevapi installed, see https://www.php.net/manual/en/book.mysql-xdevapi.php on how to install this extension.
Installation
Run the following to install this library:
$ composer require shaunfreeman/php-mysql-xdevapi
if you haven't got the 'laminas/laminas-component-installer' installed then in your config/config.php
file add \XDevApi\ConfigProvider::class
to the ConfigAggregator like:
... $aggregator = new ConfigAggregator([ \ShaunFreeman\PhpMysqlXdevapi\ConfigProvider::class, ...
Configuration
After installing php-mysql-xdevapi, you will need to first enable the component, and then optionally configure it.
We recommend adding a new configuration file to your autoload directory,
config/autoload/xdevapi.local.php
. To begin with, use the following contents:
<?php declare(strict_types=1); /** * Change the values to match your mysql login **/ return [ 'xdevapi' => [ 'user' => 'dbuser', 'password' => '654321', 'host' => 'mysql', 'schema' => 'dbname', 'port' => 33060 ], ];
Support
- Issues https://github.com/shaunfreeman/php-mysql-xdevapi/issues
- Source https://github.com/shaunfreeman/php-mysql-xdevapi
Known Issues
There seems to be a bug when running mysql_devapi
with OPcache
, where CollectionFind::limit()
and CollectionFind::offset()
will return bool
when the OPcache
is enabled.
To workaround this make sure the OPcache
extension is loaded before the mysql_xdevapi
extension.
You may also need to add the line below to your opcache.ini
file or at the end of your php.ini
file
opcache.optimization_level=0