Public Member Functions | |
indexAction () | |
outputAction () | |
Protected Member Functions | |
_isAllowed () |
Definition at line 37 of file ConsoleController.php.
_isAllowed | ( | ) | [protected] |
Reimplemented from Mage_Adminhtml_Controller_Action.
Definition at line 87 of file ConsoleController.php.
00088 { 00089 return Mage::getSingleton('admin/session')->isAllowed('system/extensions'); 00090 }
indexAction | ( | ) |
Definition at line 39 of file ConsoleController.php.
00040 { 00041 $this->loadLayout(); 00042 00043 $this->_setActiveMenu('system/extensions/console'); 00044 00045 $this->_addContent($this->getLayout()->createBlock('adminhtml/extensions_console_edit')); 00046 00047 $this->renderLayout(); 00048 }
outputAction | ( | ) |
Definition at line 50 of file ConsoleController.php.
00051 { 00052 $pear = Varien_Pear::getInstance(); 00053 $input = $this->getRequest()->getParam('argv'); 00054 $argv = preg_split('#\s+#', $input); 00055 $command = false; 00056 $options = array(); 00057 $params = array(); 00058 00059 foreach ($argv as $arg) { 00060 if ($arg[0]==='-') { 00061 $opt = ''; 00062 if ($arg[1]==='-') { 00063 $opt = substr($arg, 2); 00064 } 00065 if ($opt) { 00066 $options[$opt] = 1; 00067 } 00068 } elseif (empty($command)) { 00069 $command = $arg; 00070 } else { 00071 $params[] = $arg; 00072 } 00073 } 00074 00075 $run = new Varien_Object(); 00076 if ($command) { 00077 $run->setComment(Mage::helper('adminhtml')->__('Running:').' "'.$input.'"'."\r\n\r\n"); 00078 $run->setCommand($command); 00079 $run->setOptions($options); 00080 $run->setParams($params); 00081 } else { 00082 $run->setComment(Mage::helper('adminhtml')->__('Invalid input:').' "'.$input.'"'."\r\n\r\n"); 00083 } 00084 $pear->runHtmlConsole($run); 00085 }