Skip to content

Commit 92c4df6

Browse files
committed
Add install instructions with Windows DLLs
1 parent 466fc56 commit 92c4df6

File tree

1 file changed

+21
-3
lines changed

1 file changed

+21
-3
lines changed

README.md

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,24 @@ This extension exposes the abstract syntax tree generated by PHP 7.
22

33
This extension is experimental and the representation of the syntax tree is not final.
44

5+
Installation
6+
------------
7+
8+
**On Windows**: Download a [prebuilt Windows DLL](http://windows.php.net/downloads/pecl/snaps/ast/)
9+
and move it into the `ext/` directory of your PHP instalation. Furthermore add
10+
`extension=php_ast.dll` to your `php.ini` file.
11+
12+
**On Unix**: Compile and install the extension as follows.
13+
14+
```sh
15+
phpize
16+
./configure
17+
make
18+
sudo make install
19+
```
20+
21+
Additionally add `extension=ast.so` to your `php.ini` file.
22+
523
API overview
624
------------
725

@@ -21,12 +39,12 @@ Usage
2139

2240
Code can be parsed using either `ast\parse_code()`, which accepts a code string, or
2341
`ast\parse_file()`, which accepts a file path. Additionally both functions require a `$version`
24-
argument to ensure forward-compatibility. The current version is 15.
42+
argument to ensure forward-compatibility. The current version is 20.
2543

2644
```php
27-
$ast = ast\parse_code('<?php ...', $version=15);
45+
$ast = ast\parse_code('<?php ...', $version=20);
2846
// or
29-
$ast = ast\parse_file('file.php', $version=15);
47+
$ast = ast\parse_file('file.php', $version=20);
3048
```
3149

3250
The abstract syntax tree returned by these functions consists of `ast\Node` objects.

0 commit comments

Comments
 (0)