4

I'm creating a PHP micro-framework and decided to use ApiGen to generate the API. When I use the "apigen" command on terminal, I get the following message:

sh.exe": apigen: command not found.

Maybe it is the directory tree:

Project/
--Libraries/
----Attw/ (micro-framework and the directory to document)
----apigen/

What can I do? How can I organize the directory tree? And how can I execute the apigen correctly? I haven't found good tutorials about that.

halfer
  • 19,824
  • 17
  • 99
  • 186
  • 1
    Assuming you are on Windows, you'll need the ApiGen executable to appear in your system path, I think. – halfer Apr 06 '14 at 20:48
  • The only executable that exists, is .bat, but doesn't work. – Gabriel Jacinto Apr 06 '14 at 20:57
  • That doesn't give us a great deal to go on, unfortunately. Do you know that it works with Windows? Is there a support channel for that project? – halfer Apr 06 '14 at 21:01
  • sounds like sh.exe is missing from your Path Environment variable. find the location of sh.exe, then google adding a file/folder to your windows PathEnvVariable. – r3wt Apr 06 '14 at 21:13

2 Answers2

4

I've been struggling a little with Apigen myself (it used to generate an empty documentation), but in the end i got it working (on Windows) using the standalone edition at https://github.com/apigen/apigen/downloads. (update: apigen can also be configured for Netbeans)

Unpack it for example at d:\apigen

Now find and rename apigen.neon.example to apigen.neon and open this neon config file in a standard text editor. You also need to fill in params as source and destination, if you want it to work with Netbeans. Presumably you want to add the inc extension. So find the extensions: line and change it to extensions: [php, inc]

Open the Windows command line interface (cmd.exe) and go to d:\apigen Now run something like:

apigen --source e:\wamp\www\ --destination e:\apigen_output --config d:\apigen\apigen.neon

This should now generate your documentation.

In Netbeans (8.0), first go to Tools, options, PHP, frameworks & tools, apigen and set path to apigen.bat. Now right click your project, select properties, apigen, and select the configuration file from above. Then right click your project and click on Generate Documentation.

As another way of doing this, I've also seen people unzipping ApiGen in the PHP path like e:\wamp\bin\php\php5.5.12 Then, in Windows go to Computer > properties > advances system settings > (tab) advanced > environment variables. In the second list of system variables find path, click edit and add something like this to the end: ;E:\wamp\bin\php\php5.5.12\ Do not forget the semicolon.

Apigen should now be globally available from cmd.

vaultboy
  • 173
  • 1
  • 1
  • 12
1

As from version 4.0, you can download ApiGen as PHAR and use it pretty much the same way as you use composer.

For more info, checkout apigen.org

Tomas Votruba
  • 23,240
  • 9
  • 79
  • 115