Beispiel #1
0
 public function find_backoffice_dir()
 {
     if (is_null($this->psPath)) {
         echo "Fatal error, could not find PrestaShop installation dir !\n";
         exit(1);
     }
     $dir = opendir($this->psPath);
     if (!$dir) {
         echo "Fatal error: could not read current directory\n";
         echo "Do you have read access to the filesystem ?\n";
         return false;
     }
     while ($cur = readdir($dir)) {
         if (is_dir($this->psPath . '/' . $cur)) {
             if (file_exists($this->psPath . '/' . $cur . '/get-file-admin.php')) {
                 if ($this->debug) {
                     PS_CLI_Interface::display_line("Found backoffice in {$this->psPath}/{$cur}");
                 }
                 return $this->psPath . '/' . $cur;
             }
         }
     }
     echo "Error, could not find admin directory\n";
     return false;
 }
Beispiel #2
0
 protected function _upgradeCore()
 {
     $configuration = PS_CLI_Configure::getConfigurationInstance();
     $upgrader = new Upgrader();
     if (!is_object($upgrader)) {
         PS_CLI_Interface::error('Could not load autoupgrade module !');
     }
     $upgrader->checkPSVersion(true, array('minor'));
     //$updates = $upgrader->checkPSVersion(true);
     $downloadPath = $configuration->boPath . DIRECTORY_SEPARATOR . 'autoupgrade' . DIRECTORY_SEPARATOR . 'download';
     if ($configuration->debug) {
         PS_CLI_Interface::display_line("Downloading latest version to {$downloadPath}");
     }
     if (!$upgrader->downloadLast($downloadPath)) {
         PS_CLI_Interface::error("Could not download latest version to {$downloadPath}");
     }
     print_r($upgrader);
     die;
 }