summaryrefslogtreecommitdiff
path: root/buildscripts/phing
diff options
context:
space:
mode:
authorwei <>2007-05-07 04:17:37 +0000
committerwei <>2007-05-07 04:17:37 +0000
commiteab6bb13b9efb3e1c6d725368368de4d74b00946 (patch)
tree57aa3462b6f18ad190527483e753dc148971bc63 /buildscripts/phing
parente91ac8550a4e6dfa255874860f108935841c16f6 (diff)
Update Active Record docs.
Diffstat (limited to 'buildscripts/phing')
-rw-r--r--buildscripts/phing/tasks/PradoQuickStartDocs.php85
1 files changed, 85 insertions, 0 deletions
diff --git a/buildscripts/phing/tasks/PradoQuickStartDocs.php b/buildscripts/phing/tasks/PradoQuickStartDocs.php
new file mode 100644
index 00000000..06c30a14
--- /dev/null
+++ b/buildscripts/phing/tasks/PradoQuickStartDocs.php
@@ -0,0 +1,85 @@
+<?php
+require_once 'phing/Task.php';
+
+require_once(dirname(__FILE__).'/../../chmbuilder/ChmQuickstartBuilder.php');
+include(dirname(__FILE__).'/../../../framework/PradoBase.php');
+class Prado extends PradoBase
+{
+ protected static $app;
+
+ public static function setApplication($application)
+ {
+ self::$app=$application;
+ }
+
+ public static function getApplication()
+ {
+ return self::$app;
+ }
+
+ public static function setPathOfAlias($alias,$path)
+ {
+ $aliases = self::getPathAliases();
+ if(!isset($aliases[$alias]))
+ parent::setPathOfAlias($alias,$path);
+ }
+}
+
+include(dirname(__FILE__).'/../../../framework/prado.php');
+
+/**
+ * Task to run phpDocumentor for PRADO API docs.
+ */
+class PradoQuickStartDocs extends Task
+{
+ private $base_dir;
+
+ private $destdir;
+
+ private $page;
+
+ /**
+ * Set the destination directory for the generated documentation
+ */
+ function setOutput(PhingFile $destdir)
+ {
+ $this->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('<body>', '<style type="text/css">.prado-specific {display:none;}</style><body>', $content);
+ return $content;
+ }
+
+}
+
+?> \ No newline at end of file