summaryrefslogtreecommitdiff
path: root/framework/Wsat/TWsatService.php
diff options
context:
space:
mode:
authorDaniel <darthdaniel85@gmail.com>2013-11-17 10:17:44 -0800
committerDaniel <darthdaniel85@gmail.com>2013-11-17 10:17:44 -0800
commitb0c2fecd42bd8b95f2535a525b035f27aebde287 (patch)
tree9a709073895f4f52713ed0e83241278c4f6f6e57 /framework/Wsat/TWsatService.php
parent4cdac46fcc8411607352defeb962602f93a5b26b (diff)
WSAT, similar to Microsoft - Web Site Administration Tool and Yii's Gii, will allow as to generate a lot code such as AR classes with the proper relationships... scaffolding... as well as to admin the app configuration and pages configurations in a GUI fashion.
Diffstat (limited to 'framework/Wsat/TWsatService.php')
-rw-r--r--framework/Wsat/TWsatService.php42
1 files changed, 42 insertions, 0 deletions
diff --git a/framework/Wsat/TWsatService.php b/framework/Wsat/TWsatService.php
new file mode 100644
index 00000000..009ad302
--- /dev/null
+++ b/framework/Wsat/TWsatService.php
@@ -0,0 +1,42 @@
+<?php
+
+/**
+ * Description of TWsat
+ * Inspired in both Microsoft Web Site Administration Tool(WSAT) and Yii's Gii.
+ * @version 1.0
+ * @author Daniel Sampedro darthdaniel85@gmail.com
+ * @since Prado 3.3
+ */
+class TWsatService extends TPageService {
+
+ private $_pass = '';
+
+//-----------------------------------------------------------------------------
+ public function init($config) {
+ if ($this->getApplication()->getMode() === TApplicationMode::Performance
+ || $this->getApplication()->getMode() === TApplicationMode::Normal) {
+ throw new TInvalidOperationException("You should not use Prado WSAT in any of the production modes.");
+ }
+ if (empty($this->_pass)) {
+ throw new TConfigurationException("You need to specify the Password attribute.");
+ }
+ $this->setDefaultPage("TWsatHome");
+ parent::init($config);
+ }
+
+ public function getBasePath() {
+ $basePath = Prado::getPathOfNamespace("System.Wsat.pages");
+ return realpath($basePath);
+ }
+
+ public function getPassword() {
+ return $this->_pass;
+ }
+
+ public function setPassword($_pass) {
+ $this->_pass = $_pass;
+ }
+
+}
+
+?>