Beispiel #1
0
<?php

/**
 * Created by PhpStorm.
 * User: memosa
 * Date: 16/3/23
 * Time: 23:25
 */
spl_autoload_register(function ($classname) {
    require str_replace('\\', '/', $classname) . ".php";
});
$option = new Option('pie');
$optionArr = $option->init([])->addSeries('pie', ['f**k' => 'me ?'])->addSeries('pie', ['excuse' => 'me ?']);
$optionArr->series(1)['excuse'] = 'you';
$optionArr = $optionArr->getOption();
var_dump($optionArr);
$option->addSeries();
Beispiel #2
0
 /**
  * Protected Construct
  */
 protected function __construct()
 {
     /**
      * Load core defines
      */
     Monstra::loadDefines();
     /**
      * Compress HTML with gzip
      */
     if (MONSTRA_GZIP) {
         if (!ob_start("ob_gzhandler")) {
             ob_start();
         }
     } else {
         ob_start();
     }
     /**
      * Send default header and set internal encoding
      */
     header('Content-Type: text/html; charset=UTF-8');
     function_exists('mb_language') and mb_language('uni');
     function_exists('mb_regex_encoding') and mb_regex_encoding('UTF-8');
     function_exists('mb_internal_encoding') and mb_internal_encoding('UTF-8');
     /**
      * Gets the current configuration setting of magic_quotes_gpc
      * and kill magic quotes
      */
     if (get_magic_quotes_gpc()) {
         function stripslashesGPC(&$value)
         {
             $value = stripslashes($value);
         }
         array_walk_recursive($_GET, 'stripslashesGPC');
         array_walk_recursive($_POST, 'stripslashesGPC');
         array_walk_recursive($_COOKIE, 'stripslashesGPC');
         array_walk_recursive($_REQUEST, 'stripslashesGPC');
     }
     /**
      * Set Gelato Display Errors to False for Production environment.
      */
     if (Monstra::$environment == Monstra::PRODUCTION) {
         define('GELATO_DEVELOPMENT', false);
     }
     /**
      * Define Monstra Folder for Gelato Logs
      */
     define('GELATO_LOGS_PATH', LOGS);
     /**
      * Include Gelato Library
      */
     include ROOT . DS . 'libraries' . DS . 'Gelato' . DS . 'Gelato.php';
     /**
      * Map Monstra Engine Directory
      */
     ClassLoader::directory(ROOT . DS . 'engine' . DS);
     /**
      * Map all Monstra Classes
      */
     ClassLoader::mapClasses(array('Security' => ROOT . DS . 'engine' . DS . 'Security.php', 'Uri' => ROOT . DS . 'engine' . DS . 'Uri.php', 'Site' => ROOT . DS . 'engine' . DS . 'Site.php', 'Alert' => ROOT . DS . 'engine' . DS . 'Alert.php', 'XML' => ROOT . DS . 'engine' . DS . 'Xmldb' . DS . 'XML.php', 'DB' => ROOT . DS . 'engine' . DS . 'Xmldb' . DS . 'DB.php', 'Table' => ROOT . DS . 'engine' . DS . 'Xmldb' . DS . 'Table.php', 'Plugin' => ROOT . DS . 'engine' . DS . 'Plugin' . DS . 'Plugin.php', 'Frontend' => ROOT . DS . 'engine' . DS . 'Plugin' . DS . 'Frontend.php', 'Backend' => ROOT . DS . 'engine' . DS . 'Plugin' . DS . 'Backend.php', 'Action' => ROOT . DS . 'engine' . DS . 'Plugin' . DS . 'Action.php', 'Filter' => ROOT . DS . 'engine' . DS . 'Plugin' . DS . 'Filter.php', 'View' => ROOT . DS . 'engine' . DS . 'Plugin' . DS . 'View.php', 'I18n' => ROOT . DS . 'engine' . DS . 'Plugin' . DS . 'I18n.php', 'Stylesheet' => ROOT . DS . 'engine' . DS . 'Plugin' . DS . 'Stylesheet.php', 'Javascript' => ROOT . DS . 'engine' . DS . 'Plugin' . DS . 'Javascript.php', 'Navigation' => ROOT . DS . 'engine' . DS . 'Plugin' . DS . 'Navigation.php', 'Option' => ROOT . DS . 'engine' . DS . 'Option.php', 'Shortcode' => ROOT . DS . 'engine' . DS . 'Shortcode.php', 'ORM' => ROOT . DS . 'libraries' . DS . 'Idiorm' . DS . 'ORM.php', 'PHPMailer' => ROOT . DS . 'libraries' . DS . 'PHPMailer' . DS . 'PHPMailer.php'));
     /**
      *  Start session
      */
     Session::start();
     /**
      * Init Idiorm
      */
     if (defined('MONSTRA_DB_DSN')) {
         ORM::configure(MONSTRA_DB_DSN);
         ORM::configure('username', MONSTRA_DB_USER);
         ORM::configure('password', MONSTRA_DB_PASSWORD);
         ORM::configure('driver_options', array(PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES utf8'));
     }
     /**
      * Auto cleanup if DEVELOPMENT environment
      */
     if (Monstra::$environment == Monstra::DEVELOPMENT) {
         Monstra::cleanTmp();
     }
     /**
      * Set Cache dir
      */
     Cache::configure('cache_dir', CACHE);
     /**
      * Init Options API module
      */
     Option::init();
     /**
      * Set default timezone
      */
     @ini_set('date.timezone', Option::get('timezone'));
     if (function_exists('date_default_timezone_set')) {
         date_default_timezone_set(Option::get('timezone'));
     } else {
         putenv('TZ=' . Option::get('timezone'));
     }
     /**
      * Sanitize URL to prevent XSS - Cross-site scripting
      */
     Security::runSanitizeURL();
     /**
      * Load default
      */
     Monstra::loadPluggable();
     /**
      * Init I18n
      */
     I18n::init(Option::get('language'));
     /**
      * Init Plugins API
      */
     Plugin::init();
     /**
      * Init Notification service
      */
     Notification::init();
     /**
      * Init site module
      */
     if (!BACKEND) {
         Site::init();
     }
 }