summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitattributes1
-rw-r--r--HISTORY1
-rw-r--r--framework/TShellApplication.php49
-rw-r--r--framework/prado.php5
4 files changed, 56 insertions, 0 deletions
diff --git a/.gitattributes b/.gitattributes
index f6115c21..a30d9673 100644
--- a/.gitattributes
+++ b/.gitattributes
@@ -1836,6 +1836,7 @@ framework/TApplicationComponent.php -text
framework/TComponent.php -text
framework/TModule.php -text
framework/TService.php -text
+framework/TShellApplication.php -text
framework/Util/TDataFieldAccessor.php -text
framework/Util/TDateTimeStamp.php -text
framework/Util/TLogRouter.php -text
diff --git a/HISTORY b/HISTORY
index cb25d850..6b68238c 100644
--- a/HISTORY
+++ b/HISTORY
@@ -10,6 +10,7 @@ ENH: Added PRADO_CHMOD constant so that users can specify the permission of PRAD
ENH: Added Display property to TWebControl (Wei)
ENH: Added TUser.getState() and setState() for storing user session data (Qiang)
ENH: Added renderer feature to TRepeater, TDataList and TDataGrid (Qiang)
+NEW: TShellApplication (Qiang)
Version 3.1.0 alpha January 15, 2007
====================================
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 @@
+<?php
+/**
+ * TShellApplication class file
+ *
+ * @author Qiang Xue <qiang.xue@gmail.com>
+ * @link http://www.pradosoft.com/
+ * @copyright Copyright &copy; 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:
+ * <code>
+ * require_once('path/to/prado.php');
+ * $application=new TShellApplication('path/to/application.xml');
+ * $application->run();
+ * // perform command-line tasks here
+ * </code>
+ *
+ * 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 <qiang.xue@gmail.com>
+ * @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