Esempio n. 1
0
 /**
  * Get the instance of the Zula class
  *
  * @param string $rootDir
  * @param string $state
  * @return object
  */
 public static function getInstance($rootDir, $state = 'production')
 {
     if (!is_object(self::$_instance)) {
         self::$_instance = new self($rootDir, $state);
     }
     return self::$_instance;
 }
Esempio n. 2
0
 * _PROJECT_ID should be a string containing A-Z, a-z, _ or - and is used
 * as a identifier to the project that is using Zula, for example the
 * TextDomain of controllers/modules will be prefixed with this value
 * followed by a hypthen '-'.
 */
define('_PROJECT_ID', 'tangocms');
define('_PROJECT_NAME', 'TangoCMS');
/**
 * Include common functions, 'starup' checks such as PHP version check
 * and also some Unicode checks.
 */
require 'application/zula/common.php';
include 'application/zula/checks.php';
// Load and get an instance of the base Zula framework class
require 'application/zula/zula.php';
$zula = Zula::getInstance(dirname(__FILE__), isset($state) ? $state : 'development');
Registry::register('zula', $zula);
// _AJAX_REQUEST is DEPRECATED please use Zula::getMode() instead
define('_AJAX_REQUEST', $zula->getMode() == 'standalone');
if (UNICODE_MBSTRING === false) {
    // Load needed unicode libraries
    require $zula->getDir('3rd_party') . '/phputf8/utils/unicode.php';
    require $zula->getDir('3rd_party') . '/phputf8/native/core.php';
}
/**
 * Default directories in Zula should be fine, though you can configure
 * them from here if you want, via Zula::setDir()
 */
if ($zula->getState() == 'setup') {
    define('_REAL_MODULE_DIR', $zula->getDir('modules'));
    // Reconfigure some directories so they work correctly when installing