/** * 程式首次執行之初始化 * @return boolean 是否無錯誤完成 */ function init() { $PIO = PMCLibrary::getPIOInstance(); $FileIO = PMCLibrary::getFileIOInstance(); if (file_exists(PHP_SELF2)) { return true; } if (!is_writable(STORAGE_PATH)) { error(_T('init_permerror')); return false; } createDirectories(); $PIO->dbInit(); $FileIO->init(); return true; }
} echo '<br /><a href="index.html"><< Previous: welcome</a>'; echo ' | <a href="install.php?step=phpinfo">View PHP configuration</a>'; echo ' | <a href="install.php?step=database">Next: setup database >></a>'; //echo ' | <a href="index.html">Finish</a>'; //echo ' | <a href="install.php?step=directories">Next: create directories >></a>'; break; case "directories": setupHeader("Step 2 of 3: Create Directories"); setupMessage("Setup will now create the directories necessary to store thumbnails and logs"); //create config object $config = new sgConfig($basePath . "singapore.ini"); $config->pathto_logs = $config->pathto_data_dir . "logs/"; $config->pathto_cache = $config->pathto_data_dir . "cache/"; $config->base_path = $basePath; if (createDirectories($config)) { setupHeader("OK"); setupMessage("This step completed successfully"); } else { setupHeader("Oops!"); setupError('There was a problem. Please fix it and <a href="install.php?step=directories">retry this step</a>'); } echo '<br /><a href="install.php?step=test"><< Previous: test server</a>'; echo ' | <a href="install.php?step=database">Next: setup database >></a>'; break; case "database": setupHeader("Step 2 of 2: Setup Database"); //create config object $config = sgConfig::getInstance(); $config->loadConfig($basePath . "singapore.ini"); $config->base_path = $basePath;