示例#1
0
  This program is free software: you can redistribute it and/or modify
  it under the terms of the GNU General Public License as published by
  the Free Software Foundation, either version 3 of the License, or
  (at your option) any later version.

  This program is distributed in the hope that it will be useful,
  but WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  GNU General Public License for more details.

  You should have received a copy of the GNU General Public License
  along with this program.  If not, see <http://www.gnu.org/licenses/>.
*/
require 'InjaderPage.php';
$IJP = new InjaderPage();
require '../sys/header.php';
$CMS->Cache->ClearAll();
$strVersion = $CMS->SYS->GetSysPref(C_PREF_CMS_VERSION);
$strMaxVersion = C_SYS_LATEST_VERSION;
$strPageTitle = "Injader - Upgrade to version {$strMaxVersion}";
// Prevent upgrade to max version
if ($strVersion == $strMaxVersion) {
    $IJP->Display("<h1>Upgrade Aborted</h1>\n\n<p>Your site cannot be upgraded because you're already running Injader {$strMaxVersion}.</p>\n\n<ul>\n<li>Target version: {$strMaxVersion}</li>\n<li>Your site: {$strVersion}</li>\n</ul>", $strPageTitle);
} else {
    $strWarning = "";
    if ($strMaxVersion == "x.x.x") {
        //
    }
    $IJP->Display("<h1>System Upgrade</h1>\n\n<p>You are about to upgrade your site from Injader {$strVersion} to Injader {$strMaxVersion}.</p>\n\n{$strWarning}<p><a href=\"upgrade.php\">Run the upgrade script</a>.</p>", $strPageTitle);
}
示例#2
0
            } else {
                $intStep = 2;
            }
            break;
        case 3:
        case 4:
            break;
    }
}
// Do the dirty work!
switch ($intStep) {
    case 1:
        // Create .htaccess
        @($blnCreatedFile = touch("../.htaccess"));
        if (!$blnCreatedFile) {
            $IJP->Display("<h1>Installation Error</h1>\r\n                <p>Cannot write to file: .htaccess</p>\r\n                <p>Please check the permissions on the Injader installation directory.</p>\r\n                <p><i>Source: &lt;install.php, step {$intStep}&gt;</i></p>\r\n                ", "Error");
        }
        // Default .htaccess data
        $strHtaccessDefault = <<<htaccess
# BEGIN Injader
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)\$ index.php/\$1 [QSA,L]
</IfModule>

# END Injader

htaccess;
        // Build htaccess file
示例#3
0
  This program is distributed in the hope that it will be useful,
  but WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  GNU General Public License for more details.

  You should have received a copy of the GNU General Public License
  along with this program.  If not, see <http://www.gnu.org/licenses/>.
*/
require 'InjaderPage.php';
$IJP = new InjaderPage();
// DETECT INSTALL DIRECTORY in case it has been overwritten
$strFileURL = '../sys/SystemDirs.php';
@($arrFile = file($strFileURL));
if (count($arrFile) == 0 || !$arrFile) {
    $IJP->Display("<h1>Upgrade Error</h1>\n\n<p>SystemDirs.php cannot be found.</p>\n\n\r\n      <p><em>Source: &lt;upgrade.php, version {$strUpgradeTo}&gt;</em></p>", "Error");
}
// Get current directory
$arrInstallRelURL = explode("installer", $_SERVER['PHP_SELF']);
$strInstallRelURL = $arrInstallRelURL[0];
// Do stuff with the file
$strFile = "";
foreach ($arrFile as $strKey => $strData) {
    if (strpos($strData, "define('URL_ROOT',") > -1) {
        $strData = "define('URL_ROOT', \"{$strInstallRelURL}\");\r\n";
    }
    $strFile .= $strData;
}
// Write to file
@($cmsFile = fopen($strFileURL, 'w'));
if (!$cmsFile) {
示例#4
0
  You should have received a copy of the GNU General Public License
  along with this program.  If not, see <http://www.gnu.org/licenses/>.
*/
require 'InjaderPage.php';
$IJP = new InjaderPage();
$strHTML = <<<PageContent
<h1 style="text-align: center;">Injader Install Wizard</h1>
<table>
  <tr>
    <td style="padding: 8px; vertical-align: top; width: 48%;">
      <h2 style="background-color: #000; color: #fff; margin-top: 0px; padding: 4px;">New installs</h2>
      <p><b>IMPORTANT: If you install over an existing site, all of your content will be deleted - so be careful!</b></p>
      <ol>
      <li>First, read the install guide. This can be found in the release download, under guides/INSTALL.md.</li>
      <li><a href="install.php">Start the installation wizard</a>. Follow the on-screen prompts and you'll be up and running in no time.</li>
      </ol>
    </td>
    <td style="border-left: 2px solid #000; padding: 8px; vertical-align: top; width: 48%;">
      <h2 style="background-color: #000; color: #fff; margin-top: 0px; padding: 4px;">Upgrades</h2>
      <ol>
      <li>First, read the upgrade guide. This can be found in the release download, under guides/UPGRADE.md.</li>
      <li><a href="upgrade-intro.php">Run the upgrade</a>.</li>
      </ol>
    </td>
  </tr>
</table>

PageContent;
$IJP->Display($strHTML, "Injader Install Wizard");