Skip to content
This repository has been archived by the owner on Dec 30, 2023. It is now read-only.

Commit

Permalink
API generation now uses Phalcon code.
Browse files Browse the repository at this point in the history
  • Loading branch information
SidRoberts committed Oct 1, 2016
1 parent 3db115e commit 23b2519
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 2 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ If you would like to translate the Phalcon Docs into your language, you'll need

## API

The API is automatically generated from the C source code using the following command:
The API is automatically generated from the C source code using the following command (replace `/home/sid/cphalcon/ext/` with the appropriate value):

php scripts/gen-api.php
php cli.php api generate /home/sid/cphalcon/ext/

If you find an error or want to improve it, please send a pull request:
* Phalcon source code: https://github.com/phalcon/cphalcon
Expand Down
24 changes: 24 additions & 0 deletions scripts/src/Task/ApiTask.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?php

namespace PhalconDocs\Task;

use Exception;
use Phalcon\Cli\Task;

class ApiTask extends Task
{
public function generateAction()
{
if (!$this->dispatcher->hasParam(0)) {
throw new Exception(
"cphalcon directory required"
);
}

$cphalconDir = $this->dispatcher->getParam(0);

define("CPHALCON_DIR", $cphalconDir);

require "scripts/gen-api.php";
}
}

0 comments on commit 23b2519

Please sign in to comment.