Ejemplo n.º 1
0
 public function set()
 {
     $this->config->set('playtime.test', 1);
     $this->assertTrue($this->config->has('playtime.test'));
     $this->assertEquals(1, $this->config->get('playtime.test'));
     $this->config->set('new.value', 'test');
     $this->assertTrue($this->config->has('new.value'));
     $this->assertEquals('test', $this->config->get('new.value'));
 }
Ejemplo n.º 2
0
 /**
  * Loads my toybox allows th app to overwrite any of my toys (except config)
  *
  * @throws ConfigException
  */
 private function loadToys()
 {
     $toyList = (include_once __DIR__ . "/Toybox/toys.php");
     $appList = ['aliases' => [], 'services' => []];
     if ($this->config->has('toys.list')) {
         $appList = $this->config->get('toys.list');
     }
     $this->loadAliases($toyList['aliases']);
     $this->loadServices($toyList['services']);
     $this->loadAliases($appList['aliases']);
     $this->loadServices($appList['services']);
 }
Ejemplo n.º 3
0
 /**
  * SessionHandler constructor.
  *
  * @param Config $config
  */
 public function __construct(Config $config)
 {
     $config->has('playtime.session_name') ? session_id($config->get('playtime.session_name')) : null;
     SessionHandler::startSession();
     SessionHandler::setStart($config->has('playtime.session_values') ? $config->get('playtime.session_values') : []);
 }
 /**
  * Gets the lexer parameter from either the config or the lexerParam array
  *
  * @param $paramName
  *
  * @return array|mixed
  * @throws \Playground\Framework\Config\ConfigException
  */
 public function getLexerParam($paramName)
 {
     $configName = "twig." . $paramName;
     return $this->config->has($configName) ? $this->config->get($configName) : $this->lexerParams[$paramName];
 }