Overview

Packages

  • currencysymbol
  • MAbout
  • Mage
    • Admin
    • Adminhtml
    • AdminNotification
    • Api
    • Api2
    • Authorizenet
    • Backup
    • Bundle
    • Captcha
    • Catalog
    • CatalogIndex
    • CatalogInventory
    • CatalogRule
    • CatalogSearch
    • Centinel
    • Checkout
    • Cms
    • Compiler
    • Connect
    • Contacts
    • Core
    • Cron
    • CurrencySymbol
    • Customer
    • Dataflow
    • Directory
    • DirtectPost
    • Downloadable
    • Eav
    • GiftMessage
    • GoogleAnalytics
    • GoogleBase
    • GoogleCheckout
    • ImportExport
    • Index
    • Install
    • Log
    • Media
    • Newsletter
    • Oauth
    • Page
    • PageCache
    • Paygate
    • Payment
    • Paypal
    • PaypalUk
    • Persistent
    • Poll
    • ProductAlert
    • Rating
    • Reports
    • Review
    • Rss
    • Rule
    • Sales
    • SalesRule
    • Sedfriend
    • Sendfriend
    • Shipping
    • Sitemap
    • Tag
    • Tax
    • Usa
    • Weee
    • Widget
    • Wishlist
    • XmlConnect
  • None
  • Phoenix
    • Moneybookers
  • PHP
  • Zend
    • Date
    • Mime
    • XmlRpc

Classes

  • Mage
  • Mage_Adminhtml_Block_Html_Date
  • Mage_Adminhtml_Block_Html_Select
  • Mage_Api_Model_Wsdl_Config_Element
  • Mage_Captcha_Adminhtml_RefreshController
  • Mage_Captcha_RefreshController
  • Mage_Core_AjaxController
  • Mage_Core_Block_Abstract
  • Mage_Core_Block_Flush
  • Mage_Core_Block_Html_Calendar
  • Mage_Core_Block_Html_Date
  • Mage_Core_Block_Html_Link
  • Mage_Core_Block_Html_Select
  • Mage_Core_Block_Messages
  • Mage_Core_Block_Profiler
  • Mage_Core_Block_Store_Switcher
  • Mage_Core_Block_Template
  • Mage_Core_Block_Template_Facade
  • Mage_Core_Block_Template_Smarty
  • Mage_Core_Block_Template_Zend
  • Mage_Core_Block_Text
  • Mage_Core_Block_Text_List
  • Mage_Core_Block_Text_List_Item
  • Mage_Core_Block_Text_List_Link
  • Mage_Core_Block_Text_Tag
  • Mage_Core_Block_Text_Tag_Css
  • Mage_Core_Block_Text_Tag_Css_Admin
  • Mage_Core_Block_Text_Tag_Debug
  • Mage_Core_Block_Text_Tag_Js
  • Mage_Core_Block_Text_Tag_Meta
  • Mage_Core_Controller_Front_Action
  • Mage_Core_Controller_Front_Router
  • Mage_Core_Controller_Request_Http
  • Mage_Core_Controller_Response_Http
  • Mage_Core_Controller_Varien_Action
  • Mage_Core_Controller_Varien_Front
  • Mage_Core_Controller_Varien_Router_Abstract
  • Mage_Core_Controller_Varien_Router_Admin
  • Mage_Core_Controller_Varien_Router_Default
  • Mage_Core_Controller_Varien_Router_Standard
  • Mage_Core_Helper_Abstract
  • Mage_Core_Helper_Cookie
  • Mage_Core_Helper_Data
  • Mage_Core_Helper_File_Storage
  • Mage_Core_Helper_File_Storage_Database
  • Mage_Core_Helper_Hint
  • Mage_Core_Helper_Http
  • Mage_Core_Helper_Js
  • Mage_Core_Helper_String
  • Mage_Core_Helper_Translate
  • Mage_Core_Helper_Url
  • Mage_Core_Helper_Url_Rewrite
  • Mage_Core_IndexController
  • Mage_Core_Model_Abstract
  • Mage_Core_Model_App
  • Mage_Core_Model_App_Area
  • Mage_Core_Model_App_Emulation
  • Mage_Core_Model_Cache
  • Mage_Core_Model_Calculator
  • Mage_Core_Model_Config
  • Mage_Core_Model_Config_Base
  • Mage_Core_Model_Config_Data
  • Mage_Core_Model_Config_Element
  • Mage_Core_Model_Config_Options
  • Mage_Core_Model_Config_System
  • Mage_Core_Model_Cookie
  • Mage_Core_Model_Date
  • Mage_Core_Model_Design
  • Mage_Core_Model_Design_Package
  • Mage_Core_Model_Design_Source_Design
  • Mage_Core_Model_Email
  • Mage_Core_Model_Email_Info
  • Mage_Core_Model_Email_Template
  • Mage_Core_Model_Email_Template_Filter
  • Mage_Core_Model_Email_Template_Mailer
  • Mage_Core_Model_Email_Transport
  • Mage_Core_Model_Encryption
  • Mage_Core_Model_File_Storage
  • Mage_Core_Model_File_Storage_Abstract
  • Mage_Core_Model_File_Storage_Database
  • Mage_Core_Model_File_Storage_Database_Abstract
  • Mage_Core_Model_File_Storage_Directory_Database
  • Mage_Core_Model_File_Storage_File
  • Mage_Core_Model_File_Storage_Flag
  • Mage_Core_Model_File_Uploader
  • Mage_Core_Model_File_Validator_AvailablePath
  • Mage_Core_Model_File_Validator_NotProtectedExtension
  • Mage_Core_Model_Flag
  • Mage_Core_Model_Input_Filter
  • Mage_Core_Model_Input_Filter_MaliciousCode
  • Mage_Core_Model_Language
  • Mage_Core_Model_Layout
  • Mage_Core_Model_Layout_Data
  • Mage_Core_Model_Layout_Element
  • Mage_Core_Model_Layout_Update
  • Mage_Core_Model_Locale
  • Mage_Core_Model_Locale_Config
  • Mage_Core_Model_Log_Adapter
  • Mage_Core_Model_Magento_Api
  • Mage_Core_Model_Magento_Api_V2
  • Mage_Core_Model_Message
  • Mage_Core_Model_Message_Abstract
  • Mage_Core_Model_Message_Collection
  • Mage_Core_Model_Message_Error
  • Mage_Core_Model_Message_Notice
  • Mage_Core_Model_Message_Success
  • Mage_Core_Model_Message_Warning
  • Mage_Core_Model_Mysql4_Abstract
  • Mage_Core_Model_Mysql4_Cache
  • Mage_Core_Model_Mysql4_Collection_Abstract
  • Mage_Core_Model_Mysql4_Config
  • Mage_Core_Model_Mysql4_Config_Data
  • Mage_Core_Model_Mysql4_Config_Data_Collection
  • Mage_Core_Model_Mysql4_Design
  • Mage_Core_Model_Mysql4_Design_Collection
  • Mage_Core_Model_Mysql4_Design_Package_Collection
  • Mage_Core_Model_Mysql4_Design_Theme
  • Mage_Core_Model_Mysql4_Email_Template
  • Mage_Core_Model_Mysql4_Email_Template_Collection
  • Mage_Core_Model_Mysql4_File_Storage_Abstract
  • Mage_Core_Model_Mysql4_File_Storage_Database
  • Mage_Core_Model_Mysql4_File_Storage_Directory_Database
  • Mage_Core_Model_Mysql4_File_Storage_File
  • Mage_Core_Model_Mysql4_Flag
  • Mage_Core_Model_Mysql4_Language
  • Mage_Core_Model_Mysql4_Language_Collection
  • Mage_Core_Model_Mysql4_Layout
  • Mage_Core_Model_Mysql4_Resource
  • Mage_Core_Model_Mysql4_Session
  • Mage_Core_Model_Mysql4_Store
  • Mage_Core_Model_Mysql4_Store_Collection
  • Mage_Core_Model_Mysql4_Store_Group
  • Mage_Core_Model_Mysql4_Store_Group_Collection
  • Mage_Core_Model_Mysql4_Translate
  • Mage_Core_Model_Mysql4_Translate_String
  • Mage_Core_Model_Mysql4_Url_Rewrite
  • Mage_Core_Model_Mysql4_Url_Rewrite_Collection
  • Mage_Core_Model_Mysql4_Variable
  • Mage_Core_Model_Mysql4_Variable_Collection
  • Mage_Core_Model_Mysql4_Website
  • Mage_Core_Model_Mysql4_Website_Collection
  • Mage_Core_Model_Observer
  • Mage_Core_Model_Resource
  • Mage_Core_Model_Resource_Abstract
  • Mage_Core_Model_Resource_Cache
  • Mage_Core_Model_Resource_Config
  • Mage_Core_Model_Resource_Config_Data
  • Mage_Core_Model_Resource_Config_Data_Collection
  • Mage_Core_Model_Resource_Db_Abstract
  • Mage_Core_Model_Resource_Db_Collection_Abstract
  • Mage_Core_Model_Resource_Design
  • Mage_Core_Model_Resource_Design_Collection
  • Mage_Core_Model_Resource_Design_Package_Collection
  • Mage_Core_Model_Resource_Email_Template
  • Mage_Core_Model_Resource_Email_Template_Collection
  • Mage_Core_Model_Resource_Entity_Abstract
  • Mage_Core_Model_Resource_Entity_Table
  • Mage_Core_Model_Resource_File_Storage_Abstract
  • Mage_Core_Model_Resource_File_Storage_Database
  • Mage_Core_Model_Resource_File_Storage_Directory_Database
  • Mage_Core_Model_Resource_File_Storage_File
  • Mage_Core_Model_Resource_Flag
  • Mage_Core_Model_Resource_Helper_Abstract
  • Mage_Core_Model_Resource_Helper_Mysql4
  • Mage_Core_Model_Resource_Iterator
  • Mage_Core_Model_Resource_Language
  • Mage_Core_Model_Resource_Language_Collection
  • Mage_Core_Model_Resource_Layout
  • Mage_Core_Model_Resource_Resource
  • Mage_Core_Model_Resource_Session
  • Mage_Core_Model_Resource_Setup
  • Mage_Core_Model_Resource_Setup_Query_Modifier
  • Mage_Core_Model_Resource_Store
  • Mage_Core_Model_Resource_Store_Collection
  • Mage_Core_Model_Resource_Store_Group
  • Mage_Core_Model_Resource_Store_Group_Collection
  • Mage_Core_Model_Resource_Transaction
  • Mage_Core_Model_Resource_Translate
  • Mage_Core_Model_Resource_Translate_String
  • Mage_Core_Model_Resource_Type_Abstract
  • Mage_Core_Model_Resource_Type_Db
  • Mage_Core_Model_Resource_Type_Db_Mysqli
  • Mage_Core_Model_Resource_Type_Db_Mysqli_Setup
  • Mage_Core_Model_Resource_Type_Db_Pdo_Mysql
  • Mage_Core_Model_Resource_Url_Rewrite
  • Mage_Core_Model_Resource_Url_Rewrite_Collection
  • Mage_Core_Model_Resource_Variable
  • Mage_Core_Model_Resource_Variable_Collection
  • Mage_Core_Model_Resource_Website
  • Mage_Core_Model_Resource_Website_Collection
  • Mage_Core_Model_Session
  • Mage_Core_Model_Session_Abstract
  • Mage_Core_Model_Session_Abstract_Varien
  • Mage_Core_Model_Session_Abstract_Zend
  • Mage_Core_Model_Source_Email_Variables
  • Mage_Core_Model_Store
  • Mage_Core_Model_Store_Api
  • Mage_Core_Model_Store_Api_V2
  • Mage_Core_Model_Store_Group
  • Mage_Core_Model_Template
  • Mage_Core_Model_Translate
  • Mage_Core_Model_Translate_Expr
  • Mage_Core_Model_Translate_Inline
  • Mage_Core_Model_Translate_String
  • Mage_Core_Model_Url
  • Mage_Core_Model_Url_Rewrite
  • Mage_Core_Model_Url_Validator
  • Mage_Core_Model_Variable
  • Mage_Core_Model_Variable_Config
  • Mage_Core_Model_Variable_Observer
  • Mage_Core_Model_Website
  • Mage_Page_Block_Switch
  • Mage_Page_Block_Template_Container
  • Mage_Page_Block_Template_Links
  • Mage_Page_Block_Template_Links_Block
  • Mage_Sales_Model_Quote_Address_Total_Collector

Exceptions

  • Mage_Core_Controller_Varien_Exception
  • Mage_Core_Exception
  • Mage_Core_Model_Session_Exception
  • Mage_Core_Model_Store_Exception

Functions

  • destruct
  • is_dir_writeable
  • is_empty_date
  • mageCoreErrorHandler
  • mageDebugBacktrace
  • mageDelTree
  • mageFindClassFile
  • mageParseCsv
  • mageSendErrorFooter
  • mageSendErrorHeader
  • mageUndoMagicQuotes
  • now
  • sys_get_temp_dir
  • uc_words
  • Overview
  • Package
  • Class
  • Tree
  1: <?php
  2: /**
  3:  * Magento
  4:  *
  5:  * NOTICE OF LICENSE
  6:  *
  7:  * This source file is subject to the Open Software License (OSL 3.0)
  8:  * that is bundled with this package in the file LICENSE.txt.
  9:  * It is also available through the world-wide-web at this URL:
 10:  * http://opensource.org/licenses/osl-3.0.php
 11:  * If you did not receive a copy of the license and are unable to
 12:  * obtain it through the world-wide-web, please send an email
 13:  * to license@magentocommerce.com so we can send you a copy immediately.
 14:  *
 15:  * DISCLAIMER
 16:  *
 17:  * Do not edit or add to this file if you wish to upgrade Magento to newer
 18:  * versions in the future. If you wish to customize Magento for your
 19:  * needs please refer to http://www.magentocommerce.com for more information.
 20:  *
 21:  * @category    Mage
 22:  * @package     Mage_Core
 23:  * @copyright   Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
 24:  * @license     http://opensource.org/licenses/osl-3.0.php  Open Software License (OSL 3.0)
 25:  */
 26: 
 27: 
 28: /**
 29:  * Custom Zend_Controller_Request_Http class (formally)
 30:  *
 31:  * Allows dispatching before and after events for each controller action
 32:  *
 33:  * @author      Magento Core Team <core@magentocommerce.com>
 34:  */
 35: class Mage_Core_Controller_Request_Http extends Zend_Controller_Request_Http
 36: {
 37:     const XML_NODE_DIRECT_FRONT_NAMES = 'global/request/direct_front_name';
 38:     const DEFAULT_HTTP_PORT = 80;
 39:     const DEFAULT_HTTPS_PORT = 443;
 40: 
 41:     /**
 42:      * ORIGINAL_PATH_INFO
 43:      * @var string
 44:      */
 45:     protected $_originalPathInfo= '';
 46:     protected $_storeCode       = null;
 47:     protected $_requestString   = '';
 48: 
 49:     /**
 50:      * Path info array used before applying rewrite from config
 51:      *
 52:      * @var null || array
 53:      */
 54:     protected $_rewritedPathInfo= null;
 55:     protected $_requestedRouteName = null;
 56:     protected $_routingInfo = array();
 57: 
 58:     protected $_route;
 59: 
 60:     protected $_directFrontNames = null;
 61:     protected $_controllerModule = null;
 62: 
 63:     /**
 64:      * Streight request flag.
 65:      * If flag is determined no additional logic is applicable
 66:      *
 67:      * @var $_isStraight bool
 68:      */
 69:     protected $_isStraight = false;
 70: 
 71:     /**
 72:      * Request's original information before forward.
 73:      *
 74:      * @var array
 75:      */
 76:     protected $_beforeForwardInfo = array();
 77: 
 78:     /**
 79:      * Returns ORIGINAL_PATH_INFO.
 80:      * This value is calculated instead of reading PATH_INFO
 81:      * directly from $_SERVER due to cross-platform differences.
 82:      *
 83:      * @return string
 84:      */
 85:     public function getOriginalPathInfo()
 86:     {
 87:         if (empty($this->_originalPathInfo)) {
 88:             $this->setPathInfo();
 89:         }
 90:         return $this->_originalPathInfo;
 91:     }
 92: 
 93:     public function getStoreCodeFromPath()
 94:     {
 95:         if (!$this->_storeCode) {
 96:             // get store view code
 97:             if ($this->_canBeStoreCodeInUrl()) {
 98:                 $p = explode('/', trim($this->getPathInfo(), '/'));
 99:                 $storeCode = $p[0];
100: 
101:                 $stores = Mage::app()->getStores(true, true);
102: 
103:                 if ($storeCode !== '' && isset($stores[$storeCode])) {
104:                     array_shift($p);
105:                     $this->setPathInfo(implode('/', $p));
106:                     $this->_storeCode = $storeCode;
107:                     Mage::app()->setCurrentStore($storeCode);
108:                 }
109:                 else {
110:                     $this->_storeCode = Mage::app()->getStore()->getCode();
111:                 }
112:             } else {
113:                 $this->_storeCode = Mage::app()->getStore()->getCode();
114:             }
115: 
116:         }
117:         return $this->_storeCode;
118:     }
119: 
120:     /**
121:      * Set the PATH_INFO string
122:      * Set the ORIGINAL_PATH_INFO string
123:      *
124:      * @param string|null $pathInfo
125:      * @return Zend_Controller_Request_Http
126:      */
127:     public function setPathInfo($pathInfo = null)
128:     {
129:         if ($pathInfo === null) {
130:             $requestUri = $this->getRequestUri();
131:             if (null === $requestUri) {
132:                 return $this;
133:             }
134: 
135:             // Remove the query string from REQUEST_URI
136:             $pos = strpos($requestUri, '?');
137:             if ($pos) {
138:                 $requestUri = substr($requestUri, 0, $pos);
139:             }
140: 
141:             $baseUrl = $this->getBaseUrl();
142:             $pathInfo = substr($requestUri, strlen($baseUrl));
143: 
144:             if ((null !== $baseUrl) && (false === $pathInfo)) {
145:                 $pathInfo = '';
146:             } elseif (null === $baseUrl) {
147:                 $pathInfo = $requestUri;
148:             }
149: 
150:             if ($this->_canBeStoreCodeInUrl()) {
151:                 $pathParts = explode('/', ltrim($pathInfo, '/'), 2);
152:                 $storeCode = $pathParts[0];
153: 
154:                 if (!$this->isDirectAccessFrontendName($storeCode)) {
155:                     $stores = Mage::app()->getStores(true, true);
156:                     if ($storeCode!=='' && isset($stores[$storeCode])) {
157:                         Mage::app()->setCurrentStore($storeCode);
158:                         $pathInfo = '/'.(isset($pathParts[1]) ? $pathParts[1] : '');
159:                     }
160:                     elseif ($storeCode !== '') {
161:                         $this->setActionName('noRoute');
162:                     }
163:                 }
164:             }
165: 
166:             $this->_originalPathInfo = (string) $pathInfo;
167: 
168:             $this->_requestString = $pathInfo . ($pos!==false ? substr($requestUri, $pos) : '');
169:         }
170: 
171:         $this->_pathInfo = (string) $pathInfo;
172:         return $this;
173:     }
174: 
175:     /**
176:      * Specify new path info
177:      * It happen when occur rewrite based on configuration
178:      *
179:      * @param   string $pathInfo
180:      * @return  Mage_Core_Controller_Request_Http
181:      */
182:     public function rewritePathInfo($pathInfo)
183:     {
184:         if (($pathInfo != $this->getPathInfo()) && ($this->_rewritedPathInfo === null)) {
185:             $this->_rewritedPathInfo = explode('/', trim($this->getPathInfo(), '/'));
186:         }
187:         $this->setPathInfo($pathInfo);
188:         return $this;
189:     }
190: 
191:     /**
192:      * Check if can be store code as part of url
193:      *
194:      * @return bool
195:      */
196:     protected function _canBeStoreCodeInUrl()
197:     {
198:         return Mage::isInstalled() && Mage::getStoreConfigFlag(Mage_Core_Model_Store::XML_PATH_STORE_IN_URL);
199:     }
200: 
201:     /**
202:      * Check if code declared as direct access frontend name
203:      * this mean what this url can be used without store code
204:      *
205:      * @param   string $code
206:      * @return  bool
207:      */
208:     public function isDirectAccessFrontendName($code)
209:     {
210:         $names = $this->getDirectFrontNames();
211:         return isset($names[$code]);
212:     }
213: 
214:     /**
215:      * Get list of front names available with access without store code
216:      *
217:      * @return array
218:      */
219:     public function getDirectFrontNames()
220:     {
221:         if (is_null($this->_directFrontNames)) {
222:             $names = Mage::getConfig()->getNode(self::XML_NODE_DIRECT_FRONT_NAMES);
223:             if ($names) {
224:                 $this->_directFrontNames = $names->asArray();
225:             } else {
226:                 return array();
227:             }
228:         }
229:         return $this->_directFrontNames;
230:     }
231: 
232:     public function getOriginalRequest()
233:     {
234:         $request = new Zend_Controller_Request_Http();
235:         $request->setPathInfo($this->getOriginalPathInfo());
236:         return $request;
237:     }
238: 
239:     public function getRequestString()
240:     {
241:         return $this->_requestString;
242:     }
243: 
244:     public function getBasePath()
245:     {
246:         $path = parent::getBasePath();
247:         if (empty($path)) {
248:             $path = '/';
249:         } else {
250:             $path = str_replace('\\', '/', $path);
251:         }
252:         return $path;
253:     }
254: 
255:     public function getBaseUrl()
256:     {
257:         $url = parent::getBaseUrl();
258:         $url = str_replace('\\', '/', $url);
259:         return $url;
260:     }
261: 
262:     public function setRouteName($route)
263:     {
264:         $this->_route = $route;
265:         $router = Mage::app()->getFrontController()->getRouterByRoute($route);
266:         if (!$router) return $this;
267:         $module = $router->getFrontNameByRoute($route);
268:         if ($module) {
269:             $this->setModuleName($module);
270:         }
271:         return $this;
272:     }
273: 
274:     public function getRouteName()
275:     {
276:         return $this->_route;
277:     }
278: 
279:     /**
280:      * Retrieve HTTP HOST
281:      *
282:      * @param bool $trimPort
283:      * @return string
284:      */
285:     public function getHttpHost($trimPort = true)
286:     {
287:         if (!isset($_SERVER['HTTP_HOST'])) {
288:             return false;
289:         }
290:         if ($trimPort) {
291:             $host = explode(':', $_SERVER['HTTP_HOST']);
292:             return $host[0];
293:         }
294:         return $_SERVER['HTTP_HOST'];
295:     }
296: 
297:     /**
298:      * Set a member of the $_POST superglobal
299:      *
300:      * @param string|array $key
301:      * @param mixed $value
302:      *
303:      * @return Mage_Core_Controller_Request_Http
304:      */
305:     public function setPost($key, $value = null)
306:     {
307:         if (is_array($key)) {
308:             $_POST = $key;
309:         }
310:         else {
311:             $_POST[$key] = $value;
312:         }
313:         return $this;
314:     }
315: 
316:     /**
317:      * Specify module name where was found currently used controller
318:      *
319:      * @param   string $module
320:      * @return  Mage_Core_Controller_Request_Http
321:      */
322:     public function setControllerModule($module)
323:     {
324:         $this->_controllerModule = $module;
325:         return $this;
326:     }
327: 
328:     /**
329:      * Get module name of currently used controller
330:      *
331:      * @return  string
332:      */
333:     public function getControllerModule()
334:     {
335:         return $this->_controllerModule;
336:     }
337: 
338:     /**
339:      * Retrieve the module name
340:      *
341:      * @return string
342:      */
343:     public function getModuleName()
344:     {
345:         return $this->_module;
346:     }
347:     /**
348:      * Retrieve the controller name
349:      *
350:      * @return string
351:      */
352:     public function getControllerName()
353:     {
354:         return $this->_controller;
355:     }
356:     /**
357:      * Retrieve the action name
358:      *
359:      * @return string
360:      */
361:     public function getActionName()
362:     {
363:         return $this->_action;
364:     }
365: 
366:     /**
367:      * Retrieve an alias
368:      *
369:      * Retrieve the actual key represented by the alias $name.
370:      *
371:      * @param string $name
372:      * @return string|null Returns null when no alias exists
373:      */
374:     public function getAlias($name)
375:     {
376:         $aliases = $this->getAliases();
377:         if (isset($aliases[$name])) {
378:             return $aliases[$name];
379:         }
380:         return null;
381:     }
382: 
383:     /**
384:      * Retrieve the list of all aliases
385:      *
386:      * @return array
387:      */
388:     public function getAliases()
389:     {
390:         if (isset($this->_routingInfo['aliases'])) {
391:             return $this->_routingInfo['aliases'];
392:         }
393:         return parent::getAliases();
394:     }
395: 
396:     /**
397:      * Get route name used in request (ignore rewrite)
398:      *
399:      * @return string
400:      */
401:     public function getRequestedRouteName()
402:     {
403:         if (isset($this->_routingInfo['requested_route'])) {
404:             return $this->_routingInfo['requested_route'];
405:         }
406:         if ($this->_requestedRouteName === null) {
407:             if ($this->_rewritedPathInfo !== null && isset($this->_rewritedPathInfo[0])) {
408:                 $fronName = $this->_rewritedPathInfo[0];
409:                 $router = Mage::app()->getFrontController()->getRouterByFrontName($fronName);
410:                 $this->_requestedRouteName = $router->getRouteByFrontName($fronName);
411:             } else {
412:                 // no rewritten path found, use default route name
413:                 return $this->getRouteName();
414:             }
415:         }
416:         return $this->_requestedRouteName;
417:     }
418: 
419:     /**
420:      * Get controller name used in request (ignore rewrite)
421:      *
422:      * @return string
423:      */
424:     public function getRequestedControllerName()
425:     {
426:         if (isset($this->_routingInfo['requested_controller'])) {
427:             return $this->_routingInfo['requested_controller'];
428:         }
429:         if (($this->_rewritedPathInfo !== null) && isset($this->_rewritedPathInfo[1])) {
430:             return $this->_rewritedPathInfo[1];
431:         }
432:         return $this->getControllerName();
433:     }
434: 
435:     /**
436:      * Get action name used in request (ignore rewrite)
437:      *
438:      * @return string
439:      */
440:     public function getRequestedActionName()
441:     {
442:         if (isset($this->_routingInfo['requested_action'])) {
443:             return $this->_routingInfo['requested_action'];
444:         }
445:         if (($this->_rewritedPathInfo !== null) && isset($this->_rewritedPathInfo[2])) {
446:             return $this->_rewritedPathInfo[2];
447:         }
448:         return $this->getActionName();
449:     }
450: 
451:     /**
452:      * Set routing info data
453:      *
454:      * @param array $data
455:      * @return Mage_Core_Controller_Request_Http
456:      */
457:     public function setRoutingInfo($data)
458:     {
459:         if (is_array($data)) {
460:             $this->_routingInfo = $data;
461:         }
462:         return $this;
463:     }
464: 
465:     /**
466:      * Collect properties changed by _forward in protected storage
467:      * before _forward was called first time.
468:      *
469:      * @return Mage_Core_Controller_Varien_Action
470:      */
471:     public function initForward()
472:     {
473:         if (empty($this->_beforeForwardInfo)) {
474:             $this->_beforeForwardInfo = array(
475:                 'params' => $this->getParams(),
476:                 'action_name' => $this->getActionName(),
477:                 'controller_name' => $this->getControllerName(),
478:                 'module_name' => $this->getModuleName()
479:             );
480:         }
481: 
482:         return $this;
483:     }
484: 
485:     /**
486:      * Retrieve property's value which was before _forward call.
487:      * If property was not changed during _forward call null will be returned.
488:      * If passed name will be null whole state array will be returned.
489:      *
490:      * @param string $name
491:      * @return array|string|null
492:      */
493:     public function getBeforeForwardInfo($name = null)
494:     {
495:         if (is_null($name)) {
496:             return $this->_beforeForwardInfo;
497:         } elseif (isset($this->_beforeForwardInfo[$name])) {
498:             return $this->_beforeForwardInfo[$name];
499:         }
500: 
501:         return null;
502:     }
503: 
504:     /**
505:      * Specify/get _isStraight flag value
506:      *
507:      * @param bool $flag
508:      * @return bool
509:      */
510:     public function isStraight($flag = null)
511:     {
512:         if ($flag !== null) {
513:             $this->_isStraight = $flag;
514:         }
515:         return $this->_isStraight;
516:     }
517: 
518:     /**
519:      * Check is Request from AJAX
520:      *
521:      * @return boolean
522:      */
523:     public function isAjax()
524:     {
525:         if ($this->isXmlHttpRequest()) {
526:             return true;
527:         }
528:         if ($this->getParam('ajax') || $this->getParam('isAjax')) {
529:             return true;
530:         }
531:         return false;
532:     }
533: }
534: 
Magento 1.7.0.2 API documentation generated by ApiGen 2.8.0