コード例 #1
0
ファイル: install.php プロジェクト: stegrams/Typesetter
 function Install_Normal()
 {
     global $langmessage, $install_language;
     echo '<h2>' . $langmessage['Installing'] . '</h2>';
     echo '<ul class="install_status">';
     $config = array();
     $config['language'] = $install_language;
     $success = false;
     if (Install_Tools::gpInstall_Check()) {
         $success = Install_Tools::Install_DataFiles_New(false, $config);
     }
     echo '</ul>';
     return $success;
 }
コード例 #2
0
ファイル: SetupSite.php プロジェクト: rizub4u/gpEasy-CMS
 function NewCreate()
 {
     global $rootDir, $config, $checkFileIndex;
     global $dataDir;
     //for SaveTitle(), SaveConfig()
     includeFile('tool/install.php');
     $_POST += array('themes' => array(), 'plugins' => array());
     $destination = $_REQUEST['install']['folder'];
     $this->site_uniq_id = $this->NewId();
     $checkFileIndex = false;
     //prevent reposting
     if (isset($this->siteData['sites'][$destination])) {
         message('Oops, there\'s already an installation in ' . htmlspecialchars($destination));
         return false;
     }
     echo '<ul>';
     echo '<li>Starting Installation</li>';
     //check user values first
     if (!Install_Tools::gpInstall_Check()) {
         $this->Install_Aborted($destination);
         return false;
     }
     //	Create index.php file
     echo '<li>Create index.php file</li>';
     if (!$this->CreateIndex($destination, $this->site_uniq_id)) {
         echo '<li>Failed to save the index.php file</li>';
         $this->Install_Aborted($destination);
         return false;
     }
     //	Create /include symlink
     $target = $rootDir . '/include';
     $name = $destination . '/include';
     if (!$this->Create_Symlink($target, $name, 'main.php')) {
         $this->Install_Aborted($destination);
         return false;
     }
     //	Create /themes folder
     if (!$this->CopyThemes($destination, $_REQUEST['install'])) {
         $this->Install_Aborted($destination);
         return false;
     }
     //	Create /plugins folder
     if (!$this->CreatePlugins($destination, $_REQUEST['install'])) {
         $this->Install_Aborted($destination);
         return false;
     }
     //	variable juggling
     $oldDir = $dataDir;
     $dataDir = $destination;
     $new_config = array();
     $new_config['language'] = $config['language'];
     $new_config['gpuniq'] = $this->NewId();
     if (!Install_Tools::Install_DataFiles_New($destination, $new_config, false)) {
         $this->Install_Aborted($destination);
         return false;
     }
     $dataDir = $oldDir;
     $this->siteData['sites'][$destination] = array();
     $this->siteData['sites'][$destination]['unique'] = $this->site_uniq_id;
     $this->siteData['sites'][$destination]['gpuniq'] = $new_config['gpuniq'];
     $this->SaveSiteData();
     $this->Install_Success();
     return true;
 }