Skip to content

Commit 031ba65

Browse files
committed
Updated docs
1 parent 6fc3662 commit 031ba65

File tree

1 file changed

+19
-12
lines changed

1 file changed

+19
-12
lines changed

README.md

Lines changed: 19 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,11 @@ To install Zephir Parser on Windows:
3434

3535
1. Download [Zephir Parser for Windows][:latest-release:]
3636
2. Extract the DLL file and copy it to your PHP extensions directory
37-
3. Edit your php.ini file and add this line:
37+
3. Edit your `php.ini` file and add this line:
3838
```ini
3939
[Zephir Parser]
4040
extension=php_zephir_parser.dll
4141
```
42-
4. Finally, restart your web server
4342

4443
### Linux
4544

@@ -83,7 +82,8 @@ make
8382
sudo make install
8483
```
8584

86-
If you have specific PHP versions running:
85+
If you have multiple/specific PHP versions installed, you may be able to specify for which installation you'd like to
86+
build by using the `--with-php-config` option during configuration. For example:
8787

8888
```bash
8989
git clone git://github.com/phalcon/php-zephir-parser.git
@@ -94,29 +94,36 @@ make
9494
sudo make install
9595
```
9696

97-
Add the extension to your php.ini:
97+
Add the extension to your `php.ini`:
9898

9999
```ini
100100
[Zephir Parser]
101101
extension=zephir_parser.so
102102
```
103103

104-
Finally, **restart the web server**.
105-
106104
## Usage
107105

108106
```php
109-
$path = __DIR__ . '/test.zep';
110-
$retval = zephir_parse_file(file_get_contents($path), $path);
107+
$program = <<<EOF
108+
namespace Acme;
109+
110+
class Greeting
111+
{
112+
public static function say() -> void
113+
{
114+
echo "hello world!";
115+
}
116+
}
117+
EOF;
118+
119+
$retval = zephir_parse_file($program, '(eval code)');
111120

112-
echo PHP_EOL;
113-
var_export($retval);
114-
echo PHP_EOL;
121+
var_dump($retval);
115122
```
116123

117124
## License
118125

119-
This project is open source software licensed under the MIT License.
126+
Zephir Parser is open source software licensed under the MIT License (MIT).
120127
See the [LICENSE][:ext-license:] file for more information.
121128

122129
[:badge-travis:]: https://travis-ci.org/phalcon/php-zephir-parser.svg?branch=development

0 commit comments

Comments
 (0)