|Welcome to the php-saurus project.|
|WHAT IS php-saurus?|
php-saurus is a PHP extension codes in ANSI C that provides language bindings for the Aiksaurus thesaurus to your PHP installation. It binds to the open source GPLed Aiksaurus library. Through the php-saurus extension API, you will be able to obtain phonetically similar words and/or generate synonyms to a query word in two ways: a) either as a single-dimensional array containing the synonyms; b) a two-dimensional array holding arrays of groups with synonym families. The latter feature was hacked from the original aiksaurus command-line utility (which is cotained in the standard Aiksaurus library distribution), and was adopted to this PHP extension (the Aiksaurus library is rather undocumented, so I had to look at a sample first!). You can grab the sources of Aiksaurus from http://www.sourceforge.net/projects/aiksaurus/ and those from the php-saurus project at http://www.sourceforge.net/projects/php-saurus/, and compile the extension. If you want to deploy php-saurus on a Debian or Ubuntu Linux box, you'll be lucky enough to download a Debian package for easy installation; this saves you from the dependency/compilation hassle. RPM packages to php-saurus from people who want to join the project are welcome; if you feel you need to contribute a package, feel free to attach it to me via mail. The php-saurus project is lead by Sotirios L Karavarsamis. Sotirios can be reached via mail at firstname.lastname@example.org; his website is www.cshell.gr.
|DOWNLOAD and MIRRORS|
|The latest php-saurus source distribution, or packages can be obtained from http://www.sourceforge.net/projects/php-saurus/. You can select between a bunch of available mirrors, but the files (even the Debian packages) are still too small. At the moment, this PHP extension has been packaged for Debian/Ubuntu systems.|
|In order to compile this extension, you will need: a) PHP 5 or a greater version; b) the the Aiksaurus library and its development files (if you build php-saurus from source and not from available packages) . You can either build Aiksaurus from source by downloading the source code from the abovementioned URL, or maybe there is a binary release for your distribution; just look at the downlods page . At the time, I've packaged php-saurus for Debian and Ubuntu. In the latter case, all the dependency hassle is coped internally. The code as is compiles fine under Linux, and I have not tested it under Windows (but should compile well) .|
|INSTALLATION ON UNIX/LINUX|
In order to compile the php-saurus extension and integrate it in the PHP intepreter, you will at first have to download the php-saurus source code distribution on your local file system. After that, you will have to change to the directory where the compressed code resides, and perform the following steps (provided that you uncompress the sources appropriately):
cd <PATH_TO_SOURCE> && tar xvzf php-saurus-<VERSION>.tar.gz && cd php-saurus-<VERSION> && phpize && ./configure --with-aiksaurus=<PATH_TO_AIKSAURUS_LIBRARY> && make.
Finally, to install the generated shared library to your systems's PHP shared libraries repository (e.g /usr/lib/php5/libexec), you must become root (by issuing su - or sudo bash, it depends solely on your system) and hit make install. To allow PHP to load this library dynamically, you will have to tell php.ini! This could be accompished by issuing (as root) the command echo "extension=Aiksaurus.so" >> /path/to/your/php.ini, which appends a directive to PHP so as to load the library dynamically, or edit your php.ini with an editor like vi, nano or gedit. Note that if you want to access the library from within Apache with mod_php, you will have to restart the server after you have updated your php.ini. This could be accomplished by issuing /etc/init.d/apache restart or apache2ctl -k stop && apache2ctl -k start; this also depends solely on your distribution!
|TESTING YOUR INSTALLATION|
|If the compilation/installation process went fine, you will be able to call the exported php-saurus functions from your PHP intepreter (either from the CLI interface, within the Apache mod_php, cgi SAPI module or anything ) from your userspace code. You can find sample source code for the PHP API included within the source tarball, so you need not hack it yourself -- last! So, to verify that everything went ok, you can: a) copy Aiksaurus.php or Aiksaurus_OO.php (or any sample code file contained in the php-saurus archive) to your PHP enabled web server's root directory, and check the output. If everything went well, you will see normal output from the script; eitherwise, you will get errors such as "Called to undefined function..." or a message that informs you that something went bad. b) try to execute Aiksaurus.php (or any of the sample script files) from a PHP CLI interface. This could be done by issuing php Aiksaurus.php from your shell prompt, if you fall into the first case!|
|CREDITS & LICENSING|
|php-saurus is distributed under the GNU General Public Licence, since Aiksaurus is distributed under this licence. You can contact me at email@example.com, but please do not ask for help regarding extension installation or anything. Please respect my limited time. However, any other request for information (e.g bugs, general problems) is always welcome! Please do not forget to visit my website (www.cshell.gr) for annouces (e.g. bug fixes, etc).|
|I have lately packaged php-saurus for php-saurus0.2beta (and future releases will be available packaged, too) in Debian package format. So you can now install php-saurus through Debian or Ubuntu, without the hassle of installing dependencies manually. Take a look at the Debian packages category in the project's download page.|
|Documentation on the php-saurus (Aiksaurus) extension regarding installation and development can be obtained at http://sourceforge.net/docman/index.php?group_id=196482. From versions 0.2beta and beyond, documentation is / may be contained within the extension's sources under the documentation/ directory.|