public static function GenerateUpdateList()
 {
     $UpdatesFolder = getcwd() . DS . 'Update' . DS . 'sql' . DS;
     $UpdateFiles = File::GetDirectoryContent($UpdatesFolder, 'sql');
     $UpdateData = Updater::GetUpdateData();
     $UpdatesList = [];
     foreach ($UpdateFiles as $Update) {
         $ExplodedUpdate = explode('_', $Update['FileName']);
         $Version = $ExplodedUpdate[0];
         $Part = str_replace('.sql', '', $ExplodedUpdate[1]);
         if ($UpdateData['updating_from']['id'] < $Version) {
             $UpdatesList[] = $Update;
         }
     }
     return $UpdatesList;
 }
Example #2
0
        $ArrayIndex = 0;
        foreach ($NewFiles as $File) {
            if (strstr($File['FileLink'], $ImportFolder)) {
                unset($NewFiles[$ArrayIndex]);
            }
            if (Installer::Import($FCCore['Database']['host'], $FCCore['Database']['username'], $FCCore['Database']['password'], $FCCore['Database']['database'], $FCCore['Database']['encoding'], $File['FileLink'])) {
                rename($File['FileLink'], $ImportFolder . $File['FileName']);
            }
            $ArrayIndex++;
        }
        echo "1";
        break;
    case 'import_status':
        $ImportFolder = getcwd() . DS . 'Install' . DS . 'sql' . DS . 'imported' . DS;
        $SQLFolder = getcwd() . DS . 'Install' . DS . 'sql' . DS;
        $NewFiles = File::GetDirectoryContent($SQLFolder, 'sql');
        $OldFiles = File::GetDirectoryContent($ImportFolder, 'sql');
        $ArrayIndex = 0;
        foreach ($NewFiles as $File) {
            if (strstr($File['FileLink'], $ImportFolder)) {
                unset($NewFiles[$ArrayIndex]);
            }
            $ArrayIndex++;
        }
        $CountIF = count($NewFiles);
        $CountOF = count($OldFiles);
        $Total = $CountIF + $CountOF;
        $DataArray = ['Total' => $Total, 'New' => $CountIF, 'Old' => $CountOF];
        echo json_encode($DataArray);
        break;
}
Example #3
0
        } else {
            $MySQLCheck = false;
        }
        if (substr(str_replace('.', '', $PHPVersion), 0, 2) >= 54) {
            $PHPCheck = true;
        } else {
            $PHPCheck = false;
        }
        if (substr(str_replace('.', '', $ApacheVersion), 0, 2) > 22) {
            $ApacheCheck = true;
        } elseif (substr(str_replace('.', '', $ApacheVersion), 0, 2) == 22) {
            if (substr(str_replace('.', '', $ApacheVersion), 0, 4) >= 2214) {
                $ApacheCheck = true;
            } else {
                $ApacheCheck = false;
            }
        } else {
            $ApacheCheck = true;
        }
        if ($PHPCheck && $MySQLCheck && $ApacheCheck) {
            $AllowInstallation = true;
        } else {
            $AllowInstallation = false;
        }
        $InstalledSoftware = array('php' => array('version' => 'PHP ' . $PHPVersion, 'verified' => $PHPCheck), 'apache' => array('version' => 'Apache ' . $ApacheVersion, 'verified' => $ApacheCheck), 'mysql' => array('version' => 'MySQL API ' . $MySQLVersion, 'verified' => $MySQLCheck), 'allow' => $AllowInstallation);
        $Smarty->assign('LoadedModules', Installer::CheckPHPModules());
        $Smarty->assign('FilesToImport', File::GetDirectoryContent(getcwd() . DS . 'sql' . DS . 'base', 'sql'));
        $Smarty->assign('Software', $InstalledSoftware);
        $Smarty->display('installation/main');
        break;
}