included docu package, makedir if not exist, template responsive-twing + xml, return array with log as result

This commit is contained in:
Ulf Gebhardt 2017-07-25 11:15:22 +02:00
parent f0c4f33ba8
commit ef39cf938d
3 changed files with 40 additions and 7 deletions

View File

@ -1,3 +1,4 @@
<?php
\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
View 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');
}
}

View File

@ -1,22 +1,27 @@
<?php
class phpdocumentor {
public static function run($inpath,$outpath,$cachepath,$ignore,$title,$sourcecode,$parseprivate){
$sourcecode_ = $sourcecode ? '--sourcecode ' : '';
$parseprivate_ = $parseprivate ? '--parseprivate ' : '';
$sourcecode_ = $sourcecode ? '--sourcecode' : '';
$parseprivate_ = $parseprivate ? '--parseprivate' : '';
$ignore_ = '';
foreach($ignore as $path){
$ignore_ .= $path.',';}
$ignore_ .= '"'.$path.'",';}
if($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().
' -t '.$outpath->SERVERPATH().
' --template="responsive-twig" --template="xml"'.
' --cache-folder '.$cachepath->SERVERPATH().
' '.$ignore_.
' '.$sourcecode_.
' '.$parseprivate_.
' --force'.
' --title "'.$title.'" 2>&1'));
return \SYSTEM\LOG\JsonResult::ok();
' --title "'.$title.'" 2>&1');
return \explode("\n", $result);
}
}