Skip to content
This repository was archived by the owner on Dec 15, 2020. It is now read-only.

wmde/DataTypes

Repository files navigation

DataTypes

PHP library defining the DataTypes\DataType class of which instances represent a type of value, such as "positive integer" or "percentage".

Build Status Dependency Status Scrutinizer Quality Score

On Packagist: Latest Stable Version Download count

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 data-values/data-types to your project's composer.json file. Here is a minimal example of a composer.json file that just defines a dependency on DataTypes 0.1.0:

{
    "require": {
        "data-values/data-types": "0.1.*"
    }
}

Manual

Get the DataTypes 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 DataTypes library by including its entry point: DataTypes.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.

Authors

DataTypes has been written by the Wikidata team at Wikimedia Germany for the Wikidata project.

Release notes

0.2 (2014-03-14)

Breaking changes

  • dataTypes.DataType JavaScript object may not be initialized providing a dataValues.DataValue object anymore.
  • Removed dataTypes.DataType.getLabel().
  • Removed global DataType registration in the dataTypes object; DataTypeStore is to be used instead.
  • Split up generic "dataTypes" ResourceLoader module into "dataTypes.DataType" and "dataTypes.DataTypeStore".

Enhancements

  • Removed MediaWiki and DataValues dependencies from JavaScript code.
  • Made code PSR-4 compliant
  • Removed ResourceLoader dependency of QUnit tests.
  • Implemented DataTypeStore.

0.1.1 (2013-12-23)

  • Remove assumption about where the extension is installed in the resource loading paths.

0.1 (2013-12-15)

Initial release.

Links

About

[READ-ONLY] This component has been converted to a MediaWiki extension and is hosted on Gerrit now.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 20