From 154cf48db7cdc8283bbef04bf2cb88a00fd620df Mon Sep 17 00:00:00 2001
From: xue <>
Date: Wed, 7 Feb 2007 19:04:38 +0000
Subject: added TShellApplication.
---
framework/TShellApplication.php | 49 +++++++++++++++++++++++++++++++++++++++++
framework/prado.php | 5 +++++
2 files changed, 54 insertions(+)
create mode 100644 framework/TShellApplication.php
(limited to 'framework')
diff --git a/framework/TShellApplication.php b/framework/TShellApplication.php
new file mode 100644
index 00000000..fcb8c42c
--- /dev/null
+++ b/framework/TShellApplication.php
@@ -0,0 +1,49 @@
+
+ * @link http://www.pradosoft.com/
+ * @copyright Copyright © 2007 PradoSoft
+ * @license http://www.pradosoft.com/license/
+ * @version $Id$
+ * @package System
+ */
+
+/**
+ * TShellApplication class.
+ *
+ * TShellApplication is the base class for developing command-line PRADO
+ * tools that share the same configurations as their Web application counterparts.
+ *
+ * A typical usage of TShellApplication in a command-line PHP script is as follows:
+ *
+ * require_once('path/to/prado.php');
+ * $application=new TShellApplication('path/to/application.xml');
+ * $application->run();
+ * // perform command-line tasks here
+ *
+ *
+ * Since the application instance has access to all configurations, including
+ * path aliases, modules and parameters, the command-line script has nearly the same
+ * accessibility to resources as the PRADO Web applications.
+ *
+ * @author Qiang Xue
+ * @version $Id$
+ * @package System
+ * @since 3.1.0
+ */
+class TShellApplication extends TApplication
+{
+ /**
+ * Runs the application.
+ * This method overrides the parent implementation by initializing
+ * application with configurations specified when it is created.
+ */
+ public function run()
+ {
+ $this->initApplication();
+ }
+}
+
+?>
\ No newline at end of file
diff --git a/framework/prado.php b/framework/prado.php
index 4cf3ab3e..c1e28813 100644
--- a/framework/prado.php
+++ b/framework/prado.php
@@ -51,4 +51,9 @@ Prado::initErrorHandlers();
*/
require_once(dirname(__FILE__).'/TApplication.php');
+/**
+ * Includes TShellApplication class file
+ */
+require_once(dirname(__FILE__).'/TShellApplication.php');
+
?>
\ No newline at end of file
--
cgit v1.2.3