Download the PHP package wikibase/database without Composer

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

DEPRECATED: This library is no longer developed and maintained.

Wikibase Database

Build Status Scrutinizer Quality Score

On Packagist: Latest Stable Version Download count

Wikibase Database provides a simple interface for database interaction. This interface is inspired by the MediaWiki database abstraction layer.

Wikibase Database does not do any of the hard work itself, but rather contains adapters to existing database abstraction layers, such as Doctrine DBAL and the MediaWiki database abstraction layer.

View the release notes for recent changes to Wikibase Database.

Requirements

Installation

You can use Composer to download and install this package as well as its dependencies. Alternatively you can simply clone the git repository and take care of loading yourself.

Composer

To add this package as a local, per-project dependency to your project, simply add a dependency on wikibase/database to your project's composer.json file. Here is a minimal example of a composer.json file that just defines a dependency on Wikibase Database 0.1:

Manual

Get the Wikibase Database code, either via git, or some other means. Also get all dependencies. You can find a list of the dependencies in the "require" section of the composer.json file. Load all dependencies and the load the Wikibase Database library by including its entry point: WikibaseDatabase.php.

Tests

This library comes with a set up PHPUnit tests that cover all non-trivial code. You can run these tests using the PHPUnit configuration file found in the root directory. The tests can also be run via TravisCI, as a TravisCI configuration file is also provided in the root directory.

Running the tests

The tests in tests/phpunit can be run without any setup (with the exception of tests/phpunit/MediaWiki). You can run these with:

To include the PDO based integration tests, first setup the test database (if not already done so):

Then run:

The test database can be removed with:

To also run the MediaWiki based tests, create a MediaWiki install, and include Wikibase Database as an extension to it. Then run

Using the abstraction layer

This section serves to give you a quick idea. For more detailed documentation, see the definitions of the individual interfaces.

QueryInterface:

Abstraction layer structure

All classes of this component reside in the Wikibase\Database namespace, which is PSR-0 mapped onto the src/ directory. The component has several sub packages:

QueryInterface

The main interface of this component is QueryInterface. It defines methods for interacting with a database. These methods include insert, update, delete and select. When using this component, you will likely be passing around an instance of an implementation of this interface.

This package is mostly abstract, fully public and has no dependencies outside of its own namespace.

Plugins

Plugins depend on Wikibase Database. NOTHING in Wikibase Database depends on them.

Plugins are typically both concrete and public.

Plugin: MediaWiki

MediaWiki implementations of various interfaces. Most of these are adapters for MediaWikis DatabseBase interface that abstract away the bad design this one contains.

Top level namespace

The top level namespace, Wikibase\Database, contains some interfaces that do not fit in any of the more specific packages.

Currently it contains DBConnectionProvider and LazyDBConnectionProvider which both depend on MediaWiki. This is due to legacy reasons, and should not be relied upon, as these will be moved.

Authors

Wikibase Database has been written by Jeroen De Dauw and Adam Shorland as Wikimedia Germany employees for the Wikidata project.

Contributions where also made by several others.

Links

Bugs on Phabricator

https://phabricator.wikimedia.org/project/view/117/


All versions of database with dependencies

PHP Build Version
Package Version
Requires php Version >=5.3.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 wikibase/database contains the following files

Loading the files please wait ....