mediawiki / doctrine-connection
Tiny library for creating a Doctrine DBAL Connection from a MediaWiki Database object
Requires
- php: ^5.6.99|^7.0
- doctrine/dbal: ~2.5
Requires (Dev)
- doctrine/dbal: ~2.5.13
- mediawiki/mediawiki-codesniffer: ~23.0
- ockcyp/covers-validator: ~1.1
- phpunit/phpunit: ^6.5.14
- slevomat/coding-standard: ^3.0|~4.5
- squizlabs/php_codesniffer: ~3.3
This package is auto-updated.
Last update: 2021-04-16 20:30:41 UTC
README
DISCONTINUED: This library was a proof of concept created in 2019, and has never been used in production code.
MediaWiki Doctrine Connection
Tiny library for creating a Doctrine DBAL Connection from a MediaWiki Database object.
Supported databases are:
- Mysqli
- SQLite (PDO)
Usage
Connections are constructed via the DoctrineConnectionFactory
:
$factory = new DoctrineConnectionFactory(); $doctrineConnection = $factory->connectionFromDatabase( $mwDatabase );
Installation
To use the MediaWiki Doctrine Connection library in your project, simply add a dependency on mediawiki/doctrine-connection
to your project's composer.json
file. Here is a minimal example of a composer.json
file that just defines a dependency on MediaWiki Doctrine Connection 1.x:
{ "require": { "mediawiki/doctrine-connection": "~1.0" } }
Development
Start by installing the project dependencies by executing
composer update
You can run the style checks by executing
make cs
Since the library depends on MediaWiki, you need to have a working MediaWiki installation to run the tests. You need these two steps to run the tests:
- Load
vendor/autoload.php
of this library in your MediaWiki'sLocalSettings.php
file - Execute
maintenance/phpunit.php -c /path/to/this/lib/phpunit.xml.dist
For an example see the TravisCI setup (.travis.yml
and .travis.install.sh
)