/** * Open config file */ protected function loadConfigFile() { $config = Spyc::YAMLLoad(__APP__ . '/config.yml'); $this->merge($config['logics']); $this->events = $config['events']; $this->errors = $config['errors']; }
<?php ini_set('memory_limit', '512M'); define('__ROOT__', dirname(__DIR__)); define('__APP__', __DIR__); require __ROOT__ . '/vendor/autoload.php'; require __ROOT__ . '/files/config.php'; /** * App constants */ define('CACHE_URL', '/img/cache/'); define('CACHE_DIR', __ROOT__ . '/public/img/cache/'); /** * Load lang */ use Colorium\Text; use Pictobox\Service\Spyc; Text\Lang::load(['fr' => Spyc::YAMLLoad(__DIR__ . '/langs/french.yml')]); /** * Database setup */ use Colorium\Orm; use Pictobox\Model\User; $sqlite = new Orm\SQLite(DB_FILE, ['user' => User::class]); Orm\Hub::source($sqlite); /** * Pictobox instance */ $app = new Pictobox\Instance();
/** * Get meta * * @param null $key * @return mixed */ public function meta($key = null) { // read meta file $metafile = $this->path . DIRECTORY_SEPARATOR . 'meta.yml'; if (!$this->meta and file_exists($metafile)) { $this->meta = Spyc::YAMLLoad($metafile); } // get meta key if ($key) { return isset($this->meta[$key]) ? $this->meta[$key] : null; } // get all meta return $this->meta; }