Пример #1
0
 /**
  * @param Resources $context
  * @return boolean
  */
 public static function autostart(Resources $context)
 {
     $config = $context->get('config');
     // [php]
     $ini = $config->node('php');
     foreach (Param\Util::leaves($ini) as $key => $value) {
         if (!is_scalar($value) && !is_null($value)) {
             $type = is_object($value) ? get_class($value) : gettype($value);
             throw new Exception\RuntimeException("INI parameter '{$key}' is of wrong type ({$type})");
         }
         ini_set($key, $value);
     }
     // [locale]
     $info = array();
     $locale = $config->node('locale');
     foreach ($locale as $category => $spec) {
         $info[$category] = setlocale($category, $spec->getData());
     }
     $context->setResource('locale', $info);
     return true;
 }