예제 #1
0
 public function installAction()
 {
     if ($module = $this->getRequest()->getParam('name')) {
         foreach ($dirs as $module) {
             $installer = new Installer_Model_Installer();
             $installer->setModuleName($module)->install();
         }
         die('done');
     }
     die('pas ok');
 }
예제 #2
0
 public function installAction()
 {
     try {
         if ($module = $this->getRequest()->getParam('name')) {
             $installer = new Installer_Model_Installer();
             $installer->setModuleName($module)->install();
             $html = array('success' => 1);
         } else {
             throw new Exception($this->_("No directory provided"));
         }
     } catch (Exception $e) {
         $html = array('message' => $e->getMessage());
     }
     $this->getLayout()->setHtml(Zend_Json::encode($html));
 }
예제 #3
0
 public function installpostAction()
 {
     try {
         $html = array('success' => 1);
         if ($module = $this->getRequest()->getParam('name')) {
             $installer = new Installer_Model_Installer();
             $installer->setModuleName($module)->install();
             $html = array('success' => 1);
         } else {
             throw new Exception($this->_("No directory provided"));
         }
     } catch (Exception $e) {
         $html = array('error' => 1, 'message' => $e->getMessage());
     }
     $this->_sendHtml($html);
 }
예제 #4
0
 public function installAction()
 {
     $data = array();
     try {
         $cache = Zend_Registry::isRegistered('cache') ? Zend_Registry::get('cache') : null;
         if ($cache) {
             $cache->clean("all");
         }
         $cache_ids = array('js_mobile.js', 'js_desktop.js', 'css_mobile.css', 'css_desktop.css');
         foreach ($cache_ids as $cache_id) {
             if (file_exists(Core_Model_Directory::getCacheDirectory(true) . "/{$cache_id}")) {
                 @unlink(Core_Model_Directory::getCacheDirectory(true) . "/{$cache_id}");
             }
         }
         $module_names = Zend_Controller_Front::getInstance()->getDispatcher()->getSortedModuleDirectories();
         $modules = array();
         foreach ($module_names as $module_name) {
             $module = new Installer_Model_Installer_Module();
             $module->prepare($module_name);
             if ($module->canUpdate()) {
                 $modules[] = $module->getName();
             }
         }
         foreach ($modules as $module) {
             $installer = new Installer_Model_Installer();
             $installer->setModuleName($module)->install();
         }
         $host = $this->getRequest()->getHeader("host");
         if ($host and $host == base64_decode("YXBwcy5tb2JpdXNjcy5jb20=")) {
             $email = base64_decode("Y29udGFjdEBzaWJlcmlhbmNtcy5jb20=");
             $object = "{$host} - Siberian Update";
             $message = "Siberian " . Siberian_Version::NAME . " " . Siberian_Version::VERSION;
             @mail($email, $object, $message);
         }
         $data = array("success" => 1, "message" => $this->_("Module successfully installed"));
     } catch (Exception $e) {
         $data = array("error" => 1, "message" => $e->getMessage());
     }
     $this->_sendHtml($data);
 }