Ejemplo n.º 1
0
 /**
  * Get Installer instance
  *
  * @return Installer
  */
 public static function getInstance()
 {
     if (self::$instance == null) {
         self::$instance = new Installer();
         // use lazy loading
         if (!class_exists('Loader', FALSE)) {
             require_once THINKUP_WEBAPP_PATH . '_lib/model/class.Loader.php';
         }
         Loader::register();
         // get required version of php and mysql
         // and set current version
         require THINKUP_WEBAPP_PATH . 'install/version.php';
         self::$required_version = array('php' => $THINKUP_VERSION_REQUIRED['php'], 'mysql' => $THINKUP_VERSION_REQUIRED['mysql']);
         self::$current_version = $THINKUP_VERSION;
     }
     return self::$instance;
 }
Ejemplo n.º 2
0
$clean_url = preg_replace(array('/\\/{2,}/i', '/install$/i'), array('/', null), $clean_url);
$clean_url = rtrim($clean_url, '/\\');
define('DOMAIN', $clean_url);
$clean_path = rtrim(dirname(__FILE__), '/\\');
$clean_path = preg_replace(array('/\\/{2,}/i', '/install$/i'), array('/', null), $clean_path);
$clean_path = rtrim($clean_path, '/\\');
define('DOCROOT', $clean_path);
// Required boot components
define('VERSION', '2.6.4');
define('INSTALL', DOCROOT . '/install');
// Include autoloader:
require_once DOCROOT . '/vendor/autoload.php';
// Include the boot script:
require_once DOCROOT . '/symphony/lib/boot/bundle.php';
define('INSTALL_LOGS', MANIFEST . '/logs');
define('INSTALL_URL', URL . '/install');
// If prompt to remove, delete the entire `/install` directory
// and then redirect to Symphony
if (isset($_GET['action']) && $_GET['action'] == 'remove') {
    General::deleteDirectory(INSTALL);
    redirect(SYMPHONY_URL);
}
// If Symphony is already installed, run the updater
if (file_exists(CONFIG)) {
    // System updater
    $script = Updater::instance();
} else {
    // System installer
    $script = Installer::instance();
}
return $script->run();