Carsten Brandt
11 years ago
6 changed files with 193 additions and 132 deletions
@ -0,0 +1,49 @@
|
||||
#!/usr/bin/env php |
||||
<?php |
||||
/** |
||||
* Yii Framework 2.0 API documentation generator |
||||
* |
||||
* @link http://www.yiiframework.com/ |
||||
* @copyright Copyright (c) 2008 Yii Software LLC |
||||
* @license http://www.yiiframework.com/license/ |
||||
*/ |
||||
|
||||
defined('YII_DEBUG') or define('YII_DEBUG', false); |
||||
|
||||
$composerAutoload = [ |
||||
__DIR__ . '/vendor/autoload.php', // standalone with "composer install" run |
||||
__DIR__ . '/../../../../autoload.php', // script is installed as a composer binary |
||||
]; |
||||
foreach($composerAutoload as $autoload) { |
||||
if (file_exists($autoload)) { |
||||
require($autoload); |
||||
break; |
||||
} |
||||
} |
||||
$yiiDirs = [ |
||||
__DIR__ . '/../../../framework', // in yii2-dev repo |
||||
__DIR__ . '/vendor/yiisoft/yii2', // standalone with "composer install" run |
||||
__DIR__ . '/../../../../yiisoft/yii2', // script is installed as a composer binary |
||||
]; |
||||
foreach($yiiDirs as $dir) { |
||||
if (file_exists($dir . '/yii/Yii.php')) { |
||||
require($dir . '/yii/Yii.php'); |
||||
break; |
||||
} |
||||
} |
||||
if (!class_exists('Yii')) { |
||||
echo "\nThe Yii Framework 2.0 does not seem to be installed. Try running composer install.\n\n"; |
||||
exit(1); |
||||
} |
||||
|
||||
Yii::setAlias('@yii/apidoc', __DIR__); |
||||
|
||||
$application = new yii\console\Application([ |
||||
'id' => 'yii2-apidoc', |
||||
'basePath' => __DIR__, |
||||
'enableCoreCommands' => false, |
||||
'controllerNamespace' => 'yii\\apidoc\\commands', |
||||
'controllerPath' => '@yii/apidoc/commands', |
||||
]); |
||||
$exitCode = $application->run(); |
||||
exit($exitCode); |
@ -0,0 +1,20 @@
|
||||
@echo off |
||||
|
||||
rem ------------------------------------------------------------- |
||||
rem Yii command line bootstrap script for Windows. |
||||
rem |
||||
rem @author Qiang Xue <qiang.xue@gmail.com> |
||||
rem @link http://www.yiiframework.com/ |
||||
rem @copyright Copyright © 2012 Yii Software LLC |
||||
rem @license http://www.yiiframework.com/license/ |
||||
rem ------------------------------------------------------------- |
||||
|
||||
@setlocal |
||||
|
||||
set YII_PATH=%~dp0 |
||||
|
||||
if "%PHP_COMMAND%" == "" set PHP_COMMAND=php.exe |
||||
|
||||
"%PHP_COMMAND%" "%YII_PATH%apidoc" %* |
||||
|
||||
@endlocal |
Loading…
Reference in new issue