included docu package, makedir if not exist, template responsive-twing + xml, return array with log as result
This commit is contained in:
parent
f0c4f33ba8
commit
ef39cf938d
@ -1,3 +1,4 @@
|
|||||||
<?php
|
<?php
|
||||||
\SYSTEM\autoload::registerFolder(dirname(__FILE__),'LIB');
|
\SYSTEM\autoload::registerFolder(dirname(__FILE__),'LIB');
|
||||||
\LIB\lib_controll::register('\LIB\lib_phpdocumentor');
|
\LIB\lib_controll::register('\LIB\lib_phpdocumentor');
|
||||||
|
\SYSTEM\DOCU\docu::register('\LIB\docu_phpdocumentor');
|
||||||
27
docu_phpdocumentor.php
Normal file
27
docu_phpdocumentor.php
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* System - PHP Framework
|
||||||
|
*
|
||||||
|
* PHP Version 5.6
|
||||||
|
*
|
||||||
|
* @copyright 2016 Ulf Gebhardt (http://www.webcraft-media.de)
|
||||||
|
* @license http://www.opensource.org/licenses/mit-license.php MIT
|
||||||
|
* @link https://github.com/webcraftmedia/system
|
||||||
|
* @package LIB
|
||||||
|
*/
|
||||||
|
namespace LIB;
|
||||||
|
|
||||||
|
class docu_phpdocumentor implements \SYSTEM\DOCU\docu_package {
|
||||||
|
public static function get_config(){
|
||||||
|
return array( 'id' => 'phpdocumentor',
|
||||||
|
'inpath' => new \SYSTEM\PLIB('phpdocumentor/'),
|
||||||
|
'outpath' => new \SYSTEM\PLIB('phpdocumentor/docu/'),
|
||||||
|
'inpath_md' => new \SYSTEM\PLIB('phpdocumentor/docu/structure.xml'),
|
||||||
|
'outpath_md' => new \SYSTEM\PLIB('phpdocumentor/wiki/'),
|
||||||
|
'cachepath' => new \SYSTEM\PLIB('phpdocumentor/docu/cache/'),
|
||||||
|
'ignore' => array(),
|
||||||
|
'sourcecode' => true,
|
||||||
|
'parseprivate' => false,
|
||||||
|
'title' => 'LIB - PHPDocumentor');
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -1,22 +1,27 @@
|
|||||||
<?php
|
<?php
|
||||||
class phpdocumentor {
|
class phpdocumentor {
|
||||||
public static function run($inpath,$outpath,$cachepath,$ignore,$title,$sourcecode,$parseprivate){
|
public static function run($inpath,$outpath,$cachepath,$ignore,$title,$sourcecode,$parseprivate){
|
||||||
$sourcecode_ = $sourcecode ? '--sourcecode ' : '';
|
$sourcecode_ = $sourcecode ? '--sourcecode' : '';
|
||||||
$parseprivate_ = $parseprivate ? '--parseprivate ' : '';
|
$parseprivate_ = $parseprivate ? '--parseprivate' : '';
|
||||||
$ignore_ = '';
|
$ignore_ = '';
|
||||||
foreach($ignore as $path){
|
foreach($ignore as $path){
|
||||||
$ignore_ .= $path.',';}
|
$ignore_ .= '"'.$path.'",';}
|
||||||
if($ignore_ != ''){
|
if($ignore_ != ''){
|
||||||
$ignore_ = '--ignore '.rtrim($ignore_, ',');}
|
$ignore_ = '--ignore '.rtrim($ignore_, ',');}
|
||||||
new INFO(shell_exec('php5 '.dirname(__FILE__).'/phpDocumentor.phar run'.
|
if (!file_exists($outpath->SERVERPATH())) {
|
||||||
|
mkdir($outpath->SERVERPATH(), 0777, true);}
|
||||||
|
if (!file_exists($cachepath->SERVERPATH())) {
|
||||||
|
mkdir($cachepath->SERVERPATH(), 0777, true);}
|
||||||
|
$result = shell_exec('php5 '.dirname(__FILE__).'/phpDocumentor.phar run'.
|
||||||
' -d '.$inpath->SERVERPATH().
|
' -d '.$inpath->SERVERPATH().
|
||||||
' -t '.$outpath->SERVERPATH().
|
' -t '.$outpath->SERVERPATH().
|
||||||
|
' --template="responsive-twig" --template="xml"'.
|
||||||
' --cache-folder '.$cachepath->SERVERPATH().
|
' --cache-folder '.$cachepath->SERVERPATH().
|
||||||
' '.$ignore_.
|
' '.$ignore_.
|
||||||
' '.$sourcecode_.
|
' '.$sourcecode_.
|
||||||
' '.$parseprivate_.
|
' '.$parseprivate_.
|
||||||
' --force'.
|
' --force'.
|
||||||
' --title "'.$title.'" 2>&1'));
|
' --title "'.$title.'" 2>&1');
|
||||||
return \SYSTEM\LOG\JsonResult::ok();
|
return \explode("\n", $result);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user