Skip to content

Instantly share code, notes, and snippets.

@SunDi3yansyah
Last active October 20, 2018 18:37
Show Gist options
  • Select an option

  • Save SunDi3yansyah/3272e26dad19057aba3a57e19cb42672 to your computer and use it in GitHub Desktop.

Select an option

Save SunDi3yansyah/3272e26dad19057aba3a57e19cb42672 to your computer and use it in GitHub Desktop.
[PHP] Sami Api Documentation

Sami Environment

With Phar:

$ curl -O http://get.sensiolabs.org/sami.phar
$ mv sami.phar /bin/sami
$ chmod u+x /bin/sami

Use

$ sami

Build Doc

$ sami update config.php

With Composer:

$ composer require sami/sami

Use

$ php vendor/sami/sami/sami.php

Build Doc

$ php vendor/sami/sami/sami.php update config.php
<?php
/*
|--------------------------------------------------------------------------
| Config Sami API Documentation
|--------------------------------------------------------------------------
*/
$dir = __DIR__ . '/../app';
$iterator = Symfony\Component\Finder\Finder::create()
->files()
->name('*.php')
->exclude('build')
->exclude('tests')
->in($dir);
$options = [
'theme' => 'default',
'title' => 'API Documentation',
'build_dir' => __DIR__ . '/path/build',
'cache_dir' => __DIR__ . '/path/cache',
];
$sami = new Sami\Sami($iterator, $options);
return $sami;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment