1This is a standalone PHP extension created using CodeGen_PECL 1.0.0 2 3HACKING 4======= 5 6There are two ways to modify an extension created using CodeGen_PECL: 7 81) you can modify the generated code as with any other PHP extension 9 102) you can add custom code to the CodeGen_PECL XML source and re-run pecl-gen 11 12The 2nd approach may look a bit complicated but you have be aware that any 13manual changes to the generated code will be lost if you ever change the 14XML specs and re-run PECL-Gen. All changes done before have to be applied 15to the newly generated code again. 16Adding code snippets to the XML source itself on the other hand may be a 17bit more complicated but this way your custom code will always be in the 18generated code no matter how often you rerun CodeGen_PECL. 19 20 21BUILDING ON UNIX etc. 22===================== 23 24To compile your new extension, you will have to execute the following steps: 25 261. $ ./phpize 272. $ ./configure [--with-mecab] 283. $ make 29[4. $ make test ] # NOTE: this doesn't work right now *) 305. $ [sudo] make install 31 32*) this is a general problem with "make test" and standalone extensions 33 (that is being worked on) so please don't blame CodeGen_PECL for this 34 35 36 37BUILDING ON WINDOWS 38=================== 39 40The extension provides the VisualStudio V6 project file 41 42 mecab.dsp 43To compile the extension you open this file using VisualStudio, 44select the apropriate configuration for your installation 45(either "Release_TS" or "Debug_TS") and create "php_mecab.dll" 46 47After successfull compilation you have to copy the newly 48created "php_mecab.dll" to the PHP 49extension directory (default: C:\PHP\extensions). 50 51 52TESTING 53======= 54 55You can now load the extension using a php.ini directive 56 57 extension="php_mecab.[so|dll]" 58 59or load it at runtime using the dl() function 60 61 dl("php_mecab.[so|dll]"); 62 63The extension should now be available, you can test this 64using the extension_loaded() function: 65 66 if (extension_loaded(mecab)) 67 echo "mecab loaded :)"; 68 else 69 echo "something is wrong :("; 70 71The extension will also add its own block to the output 72of phpinfo(); 73 74