Skip to content

Commit

Permalink
added sami api generator
Browse files Browse the repository at this point in the history
  • Loading branch information
tonglil committed Jan 14, 2015
1 parent d5b1df5 commit f14fc69
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 1 deletion.
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,8 @@
### Docs ###
build/
cache/

### PHP ###

/vendor
composer.lock
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@
"phpunit/phpunit": "~4.0",
"mockery/mockery": "~0.9",
"illuminate/database": "~4.0",
"symfony/process": "~2.3"
"symfony/process": "~2.3",
"sami/sami": "2.0.*"
},
"suggest": {
"zizaco/confide":"Confide is an authentication solution for Laravel 4 that couples very well with Entrust"
Expand Down
24 changes: 24 additions & 0 deletions docs.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?php require __DIR__ . '/vendor/autoload.php';

use Sami\Sami;
use Sami\Version\GitVersionCollection;
use Symfony\Component\Finder\Finder;

$iterator = Finder::create()
->files()
->name('*.php')
->in($dir = __DIR__ . '/src');

$versions = GitVersionCollection::create($dir)
->add('master', 'master branch')
->addFromTags('2.*');

$options = array(
'versions' => $versions,
'title' => 'Entrust API',
'build_dir' => __DIR__ . '/build/docs/%version%',
'cache_dir' => __DIR__ . '/build/cache/docs/%version%',
'default_opened_level' => 2,
);

return new Sami($iterator, $options);

0 comments on commit f14fc69

Please sign in to comment.