示例#1
0
 /**
  * Force reload of manifest data
  * 
  * @return bool
  */
 public static function reloadManifestData()
 {
     $data = self::readManifestFile();
     if (!empty($data)) {
         self::$___manifest = self::_toArray($data);
         self::$___loaded = true;
     } else {
         self::$___manifest = array();
         self::$___loaded = false;
     }
     return self::$___loaded;
 }
示例#2
0
 public function shared($model, $function)
 {
     $manifest = new \Manifestreader();
     $modules = $manifest->getDataKey('modules');
     foreach ($modules as $modul) {
         $method_name = str_replace('Model_', '', get_class($model));
         $method = explode('\\', $method_name);
         $module_method = array_pop($method);
         $module_observer = '\\' . ucfirst($modul) . '\\Observer::' . $module_method;
         $module_class = '\\' . ucfirst($modul) . '\\Observer';
         $loaded = \Fuel\Core\Module::loaded($modul);
         if (!$loaded) {
             \Fuel\Core\Module::load($modul);
         }
         if (class_exists($module_class)) {
             if (method_exists($module_class, $module_method)) {
                 call_user_func($module_observer, $model, $function);
             }
         }
     }
 }
示例#3
0
 /**
  * 
  * @return boolean
  * 
  */
 private function __migrate_modules()
 {
     $modules = Manifestreader::getDataKey('modules');
     foreach ($modules as $modul) {
         $this->_comet_echo('migrate', $modul);
         if (!\Migrate::latest($modul, 'module')) {
             //   return false;
         }
     }
     return true;
 }
示例#4
0
 protected function step_3()
 {
     $license = \Input::post('licenseKey');
     $action = \Input::post('action');
     $postFile = \Input::post('licensePost');
     $input = $this->_posted('licenseInput');
     if (!$this->_isLicenseValid($license) || !in_array($action, array('step4', 'step3'))) {
         $this->_goToStep1();
     }
     $fileUploaded = !empty($input);
     if ($fileUploaded) {
         // Read file then remove if from disk (we don't need it anymore)
         //$file_path = $_FILES['licenseUpload']['tmp_name'];
         //$licenseFile = file_get_contents($file_path);
         /**/
         //$fileLicen = Licen::load($file_path);
         //unlink($file_path);
         $licenseFile = $input;
         $fileLicen = Licen::parse($input);
     }
     $posted = false;
     if (!$fileUploaded) {
         if (!empty($postFile)) {
             $licenseFile = $postFile;
             $fileLicen = Licen::parse(base64_decode($postFile));
             $posted = true;
         } else {
             $posted = false;
         }
     }
     if ($fileUploaded || $posted) {
         $key = $fileLicen->getKey();
         if ($key != $license || !$fileLicen->isLicenseOk()) {
             // Wrong or invalid license was uploaded, ask for new license upload.
             return $this->step_2();
         }
     } else {
         // File was neither uploaded nor posted trough, so rerequest it's upload
         return $this->step_2();
     }
     $manifestVersion = Manifestreader::getDataKey('version');
     $licenseVersion = $fileLicen::convertLicenseNameToLicenseNameData($license, 'versionCategory');
     $validManifest = Nocversions::isCorrectManifestForVersion($manifestVersion, $licenseVersion);
     if (!$validManifest) {
         return $this->step_2();
     }
     $uploadedData = $posted ? $licenseFile : base64_encode($licenseFile);
     $errors = $action == 'step3' ? array() : $this->evaluateFinalErrors();
     $view = View::forge('install/offline/layout', array('instaled' => false, 'title' => 'Provide data'));
     $view->content = View::forge('install/offline/step_3', array('licensePost' => $uploadedData, 'licenseKey' => $license, 'errors' => $errors, 'd' => $this->getStep4PostData()));
     return $view;
 }