Public Member Functions | |
indexAction () | |
installAction () | |
upgradeAllAction () | |
Protected Member Functions | |
_isAllowed () |
Definition at line 35 of file FileController.php.
_isAllowed | ( | ) | [protected] |
Reimplemented from Mage_Adminhtml_Controller_Action.
Definition at line 101 of file FileController.php.
00102 { 00103 return Mage::getSingleton('admin/session')->isAllowed('system/extensions'); 00104 }
indexAction | ( | ) |
Definition at line 37 of file FileController.php.
00038 { 00039 $this->loadLayout(); 00040 00041 $this->_setActiveMenu('system/extensions'); 00042 00043 $this->_addContent($this->getLayout()->createBlock('adminhtml/extensions_file_form')->initForm()); 00044 00045 $this->renderLayout(); 00046 }
installAction | ( | ) |
Definition at line 48 of file FileController.php.
00049 { 00050 $params = array('comment'=>Mage::helper('adminhtml')->__("Pending installation...")."\r\n\r\n"); 00051 if ($this->getRequest()->getParam('do')) { 00052 switch ($this->getRequest()->getParam('file_type')) { 00053 case 'local': 00054 if (empty($_FILES['local']['tmp_name'])) { 00055 $params['comment'] = Mage::helper('adminhtml')->__("Error uploading the file")."\r\n\r\n"; 00056 break; 00057 } 00058 $tmpDir = Mage::getBaseDir('var').DS.'pear'; 00059 if (!is_dir($tmpDir)) { 00060 mkdir($tmpDir, 0777, true); 00061 } 00062 $pkg = $tmpDir.DS.$_FILES['local']['name']; 00063 move_uploaded_file($_FILES['local']['tmp_name'], $pkg); 00064 00065 break; 00066 00067 case 'remote': 00068 $pkg = $this->getRequest()->getParam('remote'); 00069 if (empty($pkg)) { 00070 $params['comment'] = Mage::helper('adminhtml')->__("Invalid URL")."\r\n\r\n"; 00071 } 00072 break; 00073 } 00074 if (!empty($pkg)) { 00075 $params['comment'] = Mage::helper('adminhtml')->__("Installing $pkg, please wait...")."\r\n\r\n"; 00076 $params['command'] = 'install'; 00077 $params['options'] = array(); 00078 $params['params'] = array($pkg); 00079 } 00080 } 00081 $result = Varien_Pear::getInstance()->runHtmlConsole($params); 00082 if (!$result instanceof PEAR_Error) { 00083 Mage::getModel('adminhtml/extension')->clearAllCache(); 00084 } 00085 }
upgradeAllAction | ( | ) |
Definition at line 87 of file FileController.php.
00088 { 00089 $params = array('comment'=>Mage::helper('adminhtml')->__("Upgrading all packages, please wait...")."\r\n\r\n"); 00090 if ($this->getRequest()->getParam('do')) { 00091 $params['command'] = 'upgrade'; 00092 $params['options'] = array(); 00093 $params['params'] = array($pkg); 00094 } 00095 $result = Varien_Pear::getInstance()->runHtmlConsole($params); 00096 if (!$result instanceof PEAR_Error) { 00097 Mage::app()->cleanCache(); 00098 } 00099 }