summaryrefslogtreecommitdiff
path: root/framework/Wsat/TWsatService.php
diff options
context:
space:
mode:
authorFabio Bas <ctrlaltca@gmail.com>2013-11-23 14:52:53 +0100
committerFabio Bas <ctrlaltca@gmail.com>2013-11-23 14:52:53 +0100
commitc90614303d9993023a8fa218bd210e7e32802fa7 (patch)
treef2d4b80a400e456d5a1e4b6db89238108bd1e823 /framework/Wsat/TWsatService.php
parent5909ef5a99fd98dbc1b25fcb4640c03fdef4cb53 (diff)
parentefde949d00b808f55710abbd3d82ceb490545116 (diff)
Merge branch 'jquery' of https://github.com/pradosoft/prado into jquery
Conflicts: framework/Wsat/pages/TWsatLogin.php framework/Wsat/themes/PradoSoft/main.css
Diffstat (limited to 'framework/Wsat/TWsatService.php')
-rw-r--r--framework/Wsat/TWsatService.php123
1 files changed, 62 insertions, 61 deletions
diff --git a/framework/Wsat/TWsatService.php b/framework/Wsat/TWsatService.php
index de2bbdf6..3af34d49 100644
--- a/framework/Wsat/TWsatService.php
+++ b/framework/Wsat/TWsatService.php
@@ -1,61 +1,62 @@
-<?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
- *
- * To use TWsatService, configure it in the application specification like following:
- * <code>
- * <services>
- * <service id="wsat" class="System.Wsat.TWsatService" Password="my_secret_password" />
- * </services>
- * </code>
- * ...and then you need to go to http://localhost/yoursite/index.php?wsat=TWsatLogin
- * and generate code and configure your site.
- */
-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");
- $this->_startThemeManager();
- parent::init($config);
- }
-
- public function getBasePath() {
- $basePath = Prado::getPathOfNamespace("System.Wsat.pages");
- return realpath($basePath);
- }
-
- private function _startThemeManager() {
- $themeManager = new TThemeManager;
- $themeManager->BasePath = "System.Wsat.themes";
- $url = Prado::getApplication()->getAssetManager()->publishFilePath(Prado::getPathOfNamespace('System.Wsat'));
- $themeManager->BaseUrl = $url . DIRECTORY_SEPARATOR . "themes";
-
- $themeManager->init(null);
- $this->setThemeManager($themeManager);
- }
-
- public function getPassword() {
- return $this->_pass;
- }
-
- public function setPassword($_pass) {
- $this->_pass = $_pass;
- }
-
-}
-
-?>
+<?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
+ *
+ * To use TWsatService, configure it in the application configuration file like following:
+ * <code>
+ * <services>
+ * ...
+ * <service id="wsat" class="System.Wsat.TWsatService" Password="my_secret_password" />
+ * </services>
+ * </code>
+ * ...and then you need to go to http://localhost/yoursite/index.php?wsat=TWsatLogin
+ * and generate code and configure your site.
+ */
+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");
+ $this->_startThemeManager();
+ parent::init($config);
+ }
+
+ public function getBasePath() {
+ $basePath = Prado::getPathOfNamespace("System.Wsat.pages");
+ return realpath($basePath);
+ }
+
+ private function _startThemeManager() {
+ $themeManager = new TThemeManager;
+ $themeManager->BasePath = "System.Wsat.themes";
+ $url = Prado::getApplication()->getAssetManager()->publishFilePath(Prado::getPathOfNamespace('System.Wsat'));
+ $themeManager->BaseUrl = $url . DIRECTORY_SEPARATOR . "themes";
+
+ $themeManager->init(null);
+ $this->setThemeManager($themeManager);
+ }
+
+ public function getPassword() {
+ return $this->_pass;
+ }
+
+ public function setPassword($_pass) {
+ $this->_pass = $_pass;
+ }
+
+}
+
+?>