diff --git a/README.md b/README.md index cbc25e7..c788800 100644 --- a/README.md +++ b/README.md @@ -1,17 +1,73 @@ -# ext-helloworld +# HelloWorld PHP Extension -## Install +[![Build and Test PHP Extension](https://github.com/koriym/ext-helloworld/actions/workflows/build.yml/badge.svg)](https://github.com/koriym/ext-helloworld/actions/workflows/build.yml) -```sh -# git clean -fd -# phpize --clean -phpize -./configure -make -``` +A simple PHP extension that demonstrates basic and advanced "Hello World" functionality. + +## Features + +- Basic `helloworld()` function +- Advanced `helloworld_advanced()` function with configurable greeting ## Run -```sh -php -dextension=helloworld.so helloworld.php +1. Compile the extension: + + ``` + // make clean + // phpize --clean + phpize + ./configure --enable-helloworld-advanced + make + ``` + +2. Run + + ``` + % php -d extension=./modules/helloworld.so -i | grep hello + + helloworld + helloworld support => enabled + helloworld.greeting => Hello World! => Hello World! + + % php -d extension=./modules/helloworld.so php/helloworld.php + Hello World! + Hello World! + ``` + +## Usage + +### Basic Function + +```php +