Skip to content

Commit 98bb074

Browse files
committed
Merge branch 'master' of github.com:php-ds/ds
2 parents 9554d13 + e8b5dfa commit 98bb074

File tree

1 file changed

+25
-17
lines changed

1 file changed

+25
-17
lines changed

README.md

Lines changed: 25 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,26 @@
11
# Data Structures for PHP
2-
## Extension
32

43
[![Build Status](https://travis-ci.org/php-ds/extension.svg?branch=master)](https://travis-ci.org/php-ds/extension)
54
[![Build status](https://ci.appveyor.com/api/projects/status/dbcssp6flml2gher?svg=true)](https://ci.appveyor.com/project/rtheunissen/extension)
5+
[![PECL](https://img.shields.io/badge/PECL-1.0.2-blue.svg)](https://pecl.php.net/package/ds)
66

7-
---
7+
## Documentation
8+
9+
Documentation is available on [php.net](http://docs.php.net/manual/en/book.ds.php). You can include the [polyfill](https://github.com/php-ds/polyfill) in your project for IDE integration and autocomplete support. The polyfill will not be loaded if the extension is enabled, but it's still useful to have the PHP source in your working directory.
10+
11+
## Installation
12+
13+
The easiest way to install the extension is to use PECL:
14+
15+
```
16+
pecl install ds
17+
```
818

9-
[**Blog post**](https://medium.com/@rtheunissen/efficient-data-structures-for-php-7-9dda7af674cd) that covers the behaviour and performance benefits of each data structure.
1019

11-
### Installation
20+
You can also build directly from source:
1221

1322
```bash
1423
# Dependencies you might need to install
15-
# sudo add-apt-repository ppa:ondrej/php
16-
# sudo apt-get update
1724
# sudo apt-get install git build-essential php7.0-dev
1825

1926
git clone https://github.com/php-ds/extension "php-ds"
@@ -22,18 +29,19 @@ cd php-ds
2229
# Build and install the extension
2330
phpize
2431
./configure
25-
sudo make install
32+
make
33+
make install
2634

2735
# Clean up the build files
2836
make clean
2937
phpize --clean
3038
```
3139

32-
### Usage
33-
34-
##### Enabling the extension
40+
If you're on Windows, you can [download a compiled .dll on PECL](https://pecl.php.net/package/ds).
41+
## Enable
3542

36-
The best way to enable the extension is to create an *ini* file.
43+
You'll need to add `extension=ds.so` (or .dll if you're on Windows) to your primary *ini* file.
44+
You can also create a separate *ini* file for the extension, which allows you to control load order.
3745

3846
```bash
3947
# To see where additional .ini files are located
@@ -51,20 +59,20 @@ You can also enable the extension temporarily using the command line:
5159
php -d extension=ds.so
5260
```
5361

54-
### Testing
62+
## Testing
5563

5664
There is a suite of PHPUnit tests that can be installed using [**Composer**](https://getcomposer.org/doc/00-intro.md#installation-linux-unix-osx).
5765

58-
The extension has to be installed to run the tests.
59-
60-
#### Running the tests
61-
6266
``` bash
6367
composer install
6468
composer test
6569
```
6670

67-
### Contributing
71+
## Compatibility
72+
73+
It's highly recommended that you include the [polyfill](https://github.com/php-ds/polyfill) as a dependency in your project. This allows your codebase to still function in an environment where the extension is not installed.
74+
75+
## Contributing
6876

6977
Please see [CONTRIBUTING](CONTRIBUTING.md) for more information.
7078

0 commit comments

Comments
 (0)