From 903ae8a581fac1e6917fc3e31d2ad8fb91df80c3 Mon Sep 17 00:00:00 2001 From: ctrlaltca <> Date: Thu, 12 Jul 2012 11:21:01 +0000 Subject: standardize the use of unix eol; use svn properties to enforce native eol --- buildscripts/phing/tasks/ManualIndexTask.php | 74 +++--- buildscripts/phing/tasks/PradoDocTask.php | 296 +++++++++++------------ buildscripts/phing/tasks/PradoPackageTask.php | 280 ++++++++++----------- buildscripts/phing/tasks/PradoQuickStartDocs.php | 168 ++++++------- buildscripts/phing/tasks/PradoSimpleTestTask.php | 78 +++--- buildscripts/phing/tasks/PradoTestTask.php | 34 +-- buildscripts/phing/tasks/QuickstartIndexTask.php | 62 ++--- 7 files changed, 496 insertions(+), 496 deletions(-) (limited to 'buildscripts/phing/tasks') diff --git a/buildscripts/phing/tasks/ManualIndexTask.php b/buildscripts/phing/tasks/ManualIndexTask.php index 1725880f..c689d4c5 100644 --- a/buildscripts/phing/tasks/ManualIndexTask.php +++ b/buildscripts/phing/tasks/ManualIndexTask.php @@ -1,38 +1,38 @@ -docdir=$value; - } - - public function setTodir($value) - { - $this->todir=$value; - } - - public function main() - { - $srcdir=realpath(dirname(__FILE__).'/../../../'); - $zend_path = $srcdir.'/demos/quickstart/protected/index'; - set_include_path(get_include_path().PATH_SEPARATOR.realpath($zend_path)); - require_once ('Zend/Search/Lucene.php'); - require_once($srcdir.'/buildscripts/index/api_index.php'); - $api = new api_index($this->todir, realpath($this->docdir)); - $api->create_index(); - } -} - +docdir=$value; + } + + public function setTodir($value) + { + $this->todir=$value; + } + + public function main() + { + $srcdir=realpath(dirname(__FILE__).'/../../../'); + $zend_path = $srcdir.'/demos/quickstart/protected/index'; + set_include_path(get_include_path().PATH_SEPARATOR.realpath($zend_path)); + require_once ('Zend/Search/Lucene.php'); + require_once($srcdir.'/buildscripts/index/api_index.php'); + $api = new api_index($this->todir, realpath($this->docdir)); + $api->create_index(); + } +} + ?> \ No newline at end of file diff --git a/buildscripts/phing/tasks/PradoDocTask.php b/buildscripts/phing/tasks/PradoDocTask.php index ac64ac5a..944fde82 100644 --- a/buildscripts/phing/tasks/PradoDocTask.php +++ b/buildscripts/phing/tasks/PradoDocTask.php @@ -1,149 +1,149 @@ -phpdoc=$phpdoc; - } - - function setQuite($quite) - { - $this->quite=$quite; - } - - /** - * Set the title for the generated documentation - */ - function setTitle($title) - { - $this->title = $title; - } - - /** - * Set the destination directory for the generated documentation - */ - function setDestdir($destdir) - { - $this->destdir = $destdir; - } - - /** - * Set the source path - */ - function setSourcepath(Path $sourcepath) - { - if ($this->sourcepath === NULL) - { - $this->sourcepath = $sourcepath; - } - else - { - $this->sourcepath->append($sourcepath); - } - } - - /** - * Set the output type - */ - function setOutput($output) - { - $this->output = $output; - } - - /** - * Should sources be linked in the generated documentation - */ - function setLinksource($linksource) - { - $this->linksource = $linksource; - } - - function setIgnorelist($ignorelist) - { - $this->ignorelist=$ignorelist; - } - - /** - * Main entrypoint of the task - */ - function main() - { - $arguments = $this->constructArguments(); - passthru($this->phpdoc . " " . $arguments, $retval); - } - - /** - * Constructs an argument string for phpDocumentor - */ - private function constructArguments() - { - $arguments = " "; - - if($this->quite) - { - $arguments .= '-q "on" '; - } - - if ($this->title) - { - $arguments.= "-ti \"" . $this->title . "\" "; - } - - if ($this->destdir) - { - $arguments.= "-t \"" . $this->destdir . "\" "; - } - - if ($this->sourcepath !== NULL) - { - $arguments.= "-d \"" . $this->sourcepath->__toString() . "\" "; - } - - if ($this->output) - { - $arguments.= "-o \"" . $this->output . "\" "; - } - - if ($this->linksource) - { - $arguments.= "-s "; - } - - if ($this->parseprivate) - { - $arguments.= "-pp "; - } - - if ($this->ignorelist) - { - $arguments.='-i "'.$this->ignorelist.'" '; - } - - return $arguments; - } -} - +phpdoc=$phpdoc; + } + + function setQuite($quite) + { + $this->quite=$quite; + } + + /** + * Set the title for the generated documentation + */ + function setTitle($title) + { + $this->title = $title; + } + + /** + * Set the destination directory for the generated documentation + */ + function setDestdir($destdir) + { + $this->destdir = $destdir; + } + + /** + * Set the source path + */ + function setSourcepath(Path $sourcepath) + { + if ($this->sourcepath === NULL) + { + $this->sourcepath = $sourcepath; + } + else + { + $this->sourcepath->append($sourcepath); + } + } + + /** + * Set the output type + */ + function setOutput($output) + { + $this->output = $output; + } + + /** + * Should sources be linked in the generated documentation + */ + function setLinksource($linksource) + { + $this->linksource = $linksource; + } + + function setIgnorelist($ignorelist) + { + $this->ignorelist=$ignorelist; + } + + /** + * Main entrypoint of the task + */ + function main() + { + $arguments = $this->constructArguments(); + passthru($this->phpdoc . " " . $arguments, $retval); + } + + /** + * Constructs an argument string for phpDocumentor + */ + private function constructArguments() + { + $arguments = " "; + + if($this->quite) + { + $arguments .= '-q "on" '; + } + + if ($this->title) + { + $arguments.= "-ti \"" . $this->title . "\" "; + } + + if ($this->destdir) + { + $arguments.= "-t \"" . $this->destdir . "\" "; + } + + if ($this->sourcepath !== NULL) + { + $arguments.= "-d \"" . $this->sourcepath->__toString() . "\" "; + } + + if ($this->output) + { + $arguments.= "-o \"" . $this->output . "\" "; + } + + if ($this->linksource) + { + $arguments.= "-s "; + } + + if ($this->parseprivate) + { + $arguments.= "-pp "; + } + + if ($this->ignorelist) + { + $arguments.='-i "'.$this->ignorelist.'" '; + } + + return $arguments; + } +} + ?> \ No newline at end of file diff --git a/buildscripts/phing/tasks/PradoPackageTask.php b/buildscripts/phing/tasks/PradoPackageTask.php index e54a4093..61031206 100644 --- a/buildscripts/phing/tasks/PradoPackageTask.php +++ b/buildscripts/phing/tasks/PradoPackageTask.php @@ -1,142 +1,142 @@ -output=$file; - } - - function setStrip($value) - { - $this->strip = (boolean)$value; - } - - /** - * Supports embedded element. - * @return FileList - */ - function createFileList() { - $num = array_push($this->filelists, new FileList()); - return $this->filelists[$num-1]; - } - - function main() - { - $project = $this->getProject(); - - $content = ''; - $files=array(); - // append the files in the filelists - foreach($this->filelists as $fl) - { - $fromDir = $fl->getDir($project); - foreach($fl->getFiles($project) as $file) - { - $src = new PhingFile($fromDir,$file); - $files[] = $file; - $content .= file_get_contents($src->getAbsolutePath()); - } - } - - $content = $this->processPhp($content,$files); - file_put_contents($this->output->getAbsolutePath(), $content); - } - - function processPhp($content,$files) - { - $content = preg_replace('/^\s*Prado::trace.*\s*;\s*$/mu','',$content); - $content = preg_replace('/(PradoBase::using|Prado::using|require_once|include_once)\s*\([^\$].*?\);/mu','',$content); - $content = str_replace('Prado::', 'PradoBase::', $content); - $content = str_replace('PradoBase::getApplication()->getMode()', 'true', $content); - $content = str_replace('TApplicationMode::Debug', 'true', $content); - $content = str_replace('/Exceptions/messages', '/messages', $content); - if($this->strip) - $content=$this->strip_comments($content); - $content=$this->strip_empty_lines($content); - $content="getFileComment($files).preg_replace('/(\?>\s?|<\?php\s?)/mu','',$content)."\n?>"; - return $content; - } - -function strip_comments($source) -{ - $tokens = token_get_all($source); - /* T_ML_COMMENT does not exist in PHP 5. - * The following three lines define it in order to - * preserve backwards compatibility. - * - * The next two lines define the PHP 5-only T_DOC_COMMENT, - * which we will mask as T_ML_COMMENT for PHP 4. - */ - if (!defined('T_ML_COMMENT')) { - @define('T_ML_COMMENT', T_COMMENT); - } else { - @define('T_DOC_COMMENT', T_ML_COMMENT); - } - $output = ''; - foreach ($tokens as $token) { - if (is_string($token)) { - // simple 1-character token - $output .= $token; - } else { - // token array - list($id, $text) = $token; - switch ($id) { - case T_COMMENT: - case T_ML_COMMENT: // we've defined this - case T_DOC_COMMENT: // and this - // no action on comments - break; - default: - // anything else -> output "as is" - $output .= $text; - break; - } - } - } - return $output; -} - -function strip_empty_lines($string) -{ - $string = preg_replace("/[\r\n]+[\s\t]*[\r\n]+/", "\n", $string); - $string = preg_replace("/^[\s\t]*[\r\n]+/", "", $string); - return $string; -} -function getFileComment($files) -{ - $lastupdate=date('Y/m/d H:i:s'); - $year=date('Y'); - $fileList=array(); - foreach($files as $file) - $fileList[] = " * $file"; - $fileListStr = implode("\n", $fileList); -$comments=" -/** - * Last Update: $lastupdate - * - * Do not modify this file manually. This file was auto-generated by combining - * the following classes from the Prado framework. - * - * Files: -{$fileListStr} - * - * @author Qiang Xue , Wei Zhuo - * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-{$year} PradoSoft - * @license http://www.pradosoft.com/license/ - */ - -"; - return $comments; -} +output=$file; + } + + function setStrip($value) + { + $this->strip = (boolean)$value; + } + + /** + * Supports embedded element. + * @return FileList + */ + function createFileList() { + $num = array_push($this->filelists, new FileList()); + return $this->filelists[$num-1]; + } + + function main() + { + $project = $this->getProject(); + + $content = ''; + $files=array(); + // append the files in the filelists + foreach($this->filelists as $fl) + { + $fromDir = $fl->getDir($project); + foreach($fl->getFiles($project) as $file) + { + $src = new PhingFile($fromDir,$file); + $files[] = $file; + $content .= file_get_contents($src->getAbsolutePath()); + } + } + + $content = $this->processPhp($content,$files); + file_put_contents($this->output->getAbsolutePath(), $content); + } + + function processPhp($content,$files) + { + $content = preg_replace('/^\s*Prado::trace.*\s*;\s*$/mu','',$content); + $content = preg_replace('/(PradoBase::using|Prado::using|require_once|include_once)\s*\([^\$].*?\);/mu','',$content); + $content = str_replace('Prado::', 'PradoBase::', $content); + $content = str_replace('PradoBase::getApplication()->getMode()', 'true', $content); + $content = str_replace('TApplicationMode::Debug', 'true', $content); + $content = str_replace('/Exceptions/messages', '/messages', $content); + if($this->strip) + $content=$this->strip_comments($content); + $content=$this->strip_empty_lines($content); + $content="getFileComment($files).preg_replace('/(\?>\s?|<\?php\s?)/mu','',$content)."\n?>"; + return $content; + } + +function strip_comments($source) +{ + $tokens = token_get_all($source); + /* T_ML_COMMENT does not exist in PHP 5. + * The following three lines define it in order to + * preserve backwards compatibility. + * + * The next two lines define the PHP 5-only T_DOC_COMMENT, + * which we will mask as T_ML_COMMENT for PHP 4. + */ + if (!defined('T_ML_COMMENT')) { + @define('T_ML_COMMENT', T_COMMENT); + } else { + @define('T_DOC_COMMENT', T_ML_COMMENT); + } + $output = ''; + foreach ($tokens as $token) { + if (is_string($token)) { + // simple 1-character token + $output .= $token; + } else { + // token array + list($id, $text) = $token; + switch ($id) { + case T_COMMENT: + case T_ML_COMMENT: // we've defined this + case T_DOC_COMMENT: // and this + // no action on comments + break; + default: + // anything else -> output "as is" + $output .= $text; + break; + } + } + } + return $output; +} + +function strip_empty_lines($string) +{ + $string = preg_replace("/[\r\n]+[\s\t]*[\r\n]+/", "\n", $string); + $string = preg_replace("/^[\s\t]*[\r\n]+/", "", $string); + return $string; +} +function getFileComment($files) +{ + $lastupdate=date('Y/m/d H:i:s'); + $year=date('Y'); + $fileList=array(); + foreach($files as $file) + $fileList[] = " * $file"; + $fileListStr = implode("\n", $fileList); +$comments=" +/** + * Last Update: $lastupdate + * + * Do not modify this file manually. This file was auto-generated by combining + * the following classes from the Prado framework. + * + * Files: +{$fileListStr} + * + * @author Qiang Xue , Wei Zhuo + * @link http://www.pradosoft.com/ + * @copyright Copyright © 2005-{$year} PradoSoft + * @license http://www.pradosoft.com/license/ + */ + +"; + return $comments; +} } ?> \ No newline at end of file diff --git a/buildscripts/phing/tasks/PradoQuickStartDocs.php b/buildscripts/phing/tasks/PradoQuickStartDocs.php index 06c30a14..1cbc5140 100644 --- a/buildscripts/phing/tasks/PradoQuickStartDocs.php +++ b/buildscripts/phing/tasks/PradoQuickStartDocs.php @@ -1,85 +1,85 @@ -destdir = $destdir; - } - - function setPages($page) - { - $this->page = $page; - } - - /** - * Main entrypoint of the task - */ - function main() - { - $output = $this->destdir->getAbsolutePath(); - $base = dirname(__FILE__).'/../../../demos/quickstart/protected/'; - error_reporting(0); - $quickstart= new ChmQuickstartBuilder($base,$output); - - foreach(preg_split('/\s*[, ]+\s*/', $this->page) as $page) - { - $file = str_replace(array('/','.page'), array('_','.html'),$page); - $this->log("Parsing $page"); - file_put_contents($output.'/'.$file, $this->parsePage($quickstart,$page)); - $this->log("Writing $file"); - } - } - - protected function parsePage($quickstart, $page) - { - $_GET['page'] = str_replace(array('/','.page'),array('.',''),$page); - $_GET['notheme'] = 'true'; - $content = $quickstart->parseHtmlContent($quickstart->getApplicationContent()); - //hide prado specific content - $content = str_replace('', '', $content); - return $content; - } - -} - +destdir = $destdir; + } + + function setPages($page) + { + $this->page = $page; + } + + /** + * Main entrypoint of the task + */ + function main() + { + $output = $this->destdir->getAbsolutePath(); + $base = dirname(__FILE__).'/../../../demos/quickstart/protected/'; + error_reporting(0); + $quickstart= new ChmQuickstartBuilder($base,$output); + + foreach(preg_split('/\s*[, ]+\s*/', $this->page) as $page) + { + $file = str_replace(array('/','.page'), array('_','.html'),$page); + $this->log("Parsing $page"); + file_put_contents($output.'/'.$file, $this->parsePage($quickstart,$page)); + $this->log("Writing $file"); + } + } + + protected function parsePage($quickstart, $page) + { + $_GET['page'] = str_replace(array('/','.page'),array('.',''),$page); + $_GET['notheme'] = 'true'; + $content = $quickstart->parseHtmlContent($quickstart->getApplicationContent()); + //hide prado specific content + $content = str_replace('', '', $content); + return $content; + } + +} + ?> \ No newline at end of file diff --git a/buildscripts/phing/tasks/PradoSimpleTestTask.php b/buildscripts/phing/tasks/PradoSimpleTestTask.php index 4d6317b5..91e6e22f 100644 --- a/buildscripts/phing/tasks/PradoSimpleTestTask.php +++ b/buildscripts/phing/tasks/PradoSimpleTestTask.php @@ -1,40 +1,40 @@ -_appdir=$value; - } - - function init() - { - $tools= realpath(dirname(__FILE__).'/../../../tests/test_tools/'); - include_once "$tools/unit_tests.php"; - - if (!class_exists('SimpleReporter',false)) - throw new BuildException("SimpleTestTask depends on SimpleTest package being installed.", $this->getLocation()); - - require_once 'phing/tasks/ext/simpletest/SimpleTestCountResultFormatter.php'; - require_once 'phing/tasks/ext/simpletest/SimpleTestFormatterElement.php'; - } - - function main() - { - if($this->_appdir) - { - $app = new TShellApplication($this->_appdir); - $app->run(); - } - parent::main(); - } -} - +_appdir=$value; + } + + function init() + { + $tools= realpath(dirname(__FILE__).'/../../../tests/test_tools/'); + include_once "$tools/unit_tests.php"; + + if (!class_exists('SimpleReporter',false)) + throw new BuildException("SimpleTestTask depends on SimpleTest package being installed.", $this->getLocation()); + + require_once 'phing/tasks/ext/simpletest/SimpleTestCountResultFormatter.php'; + require_once 'phing/tasks/ext/simpletest/SimpleTestFormatterElement.php'; + } + + function main() + { + if($this->_appdir) + { + $app = new TShellApplication($this->_appdir); + $app->run(); + } + parent::main(); + } +} + ?> \ No newline at end of file diff --git a/buildscripts/phing/tasks/PradoTestTask.php b/buildscripts/phing/tasks/PradoTestTask.php index ba1e06be..cd2c87f8 100644 --- a/buildscripts/phing/tasks/PradoTestTask.php +++ b/buildscripts/phing/tasks/PradoTestTask.php @@ -1,18 +1,18 @@ - \ No newline at end of file diff --git a/buildscripts/phing/tasks/QuickstartIndexTask.php b/buildscripts/phing/tasks/QuickstartIndexTask.php index 64a48d4a..5179d8ad 100644 --- a/buildscripts/phing/tasks/QuickstartIndexTask.php +++ b/buildscripts/phing/tasks/QuickstartIndexTask.php @@ -1,32 +1,32 @@ -todir=$value; - } - - public function main() - { - $srcdir=realpath(dirname(__FILE__).'/../../../'); - $zend_path = $srcdir.'/demos/quickstart/protected/index'; - set_include_path(get_include_path().PATH_SEPARATOR.realpath($zend_path)); - require_once ('Zend/Search/Lucene.php'); - - require_once($srcdir.'/buildscripts/index/quickstart_index.php'); - $quickstart_source = $srcdir.'/buildscripts/texbuilder/quickstart/pages.php'; - $quickstart_base = $srcdir.'/demos/quickstart/protected/pages/'; - $quickstart = new quickstart_index($this->todir, realpath($quickstart_base), realpath($quickstart_source)); - $quickstart->create_index(); - } -} - +todir=$value; + } + + public function main() + { + $srcdir=realpath(dirname(__FILE__).'/../../../'); + $zend_path = $srcdir.'/demos/quickstart/protected/index'; + set_include_path(get_include_path().PATH_SEPARATOR.realpath($zend_path)); + require_once ('Zend/Search/Lucene.php'); + + require_once($srcdir.'/buildscripts/index/quickstart_index.php'); + $quickstart_source = $srcdir.'/buildscripts/texbuilder/quickstart/pages.php'; + $quickstart_base = $srcdir.'/demos/quickstart/protected/pages/'; + $quickstart = new quickstart_index($this->todir, realpath($quickstart_base), realpath($quickstart_source)); + $quickstart->create_index(); + } +} + ?> \ No newline at end of file -- cgit v1.2.3