예제 #1
0
파일: Widget.php 프로젝트: cwcw/cms
 /**
  * @see Engine/Events/Event/Streamwide_Engine_Events_Event_Dispatcher#flushEventListeners()
  */
 public function flushEventListeners(array $criteria = null)
 {
     $hasEventTypeCriteria = is_array($criteria) && !empty($criteria) && array_key_exists('eventType', $criteria);
     if ($hasEventTypeCriteria && !$this->isAllowedEventType($criteria['eventType'])) {
         trigger_notice(sprintf('Unallowed event type "%s" provided in the criteria array. This can lead to unexpected results.', $criteria['eventType']), E_USER_NOTICE);
         unset($criteria['eventType']);
     }
     return $this->_eventDispatcher->flushEventListeners($criteria);
 }
예제 #2
0
        // allModules existiert nur, damit man verschiedene Konfigurationen auf dem gleichen System laufen lassen
        // kann und über Server-Variablen oder ähnlichen steuern kann
        $allModules = False;
    }
    foreach (glob(__DIR__ . '/autoload/*.module.php') as $moduleFile) {
        $addModules = (require $moduleFile);
        foreach ($addModules as $addModule) {
            if (strpos($addModule, '-') === 0) {
                $remove = substr($addModule, 1);
                $modules = array_filter($modules, function ($elem) use($remove) {
                    return strcasecmp($elem, $remove);
                });
            } else {
                if (!in_array($addModule, $modules)) {
                    $modules[] = $addModule;
                }
            }
        }
    }
}
$config = array('environment' => $env, 'modules' => $modules, 'module_listener_options' => array('module_paths' => array('./module', './vendor'), 'config_glob_paths' => array(sprintf('config/autoload/{,*.}{global,%s,local}.php', $env)), 'config_cache_enabled' => $env == 'production', 'config_cache_key' => $env, 'module_map_cache_enabled' => $env == 'production', 'module_map_cache_key' => 'module_map', 'cache_dir' => 'cache/', 'check_dependencies' => $env != 'production'), 'service_listener_options' => array(), 'service_manager' => array());
$envConfigFile = __DIR__ . '/config.' . $env . '.php';
if (file_exists($envConfigFile)) {
    if (is_readable($envConfigFile)) {
        $envConfig = (include $envConfigFile);
        $config = ArrayUtils::merge($config, $envConfig);
    } else {
        trigger_notice(sprintf('Environment config file "%s" is not readable.', $envConfigFile), E_USER_NOTICE);
    }
}
return $config;
예제 #3
0
파일: Basic.php 프로젝트: cwcw/cms
 /**
  * Create a new application by using the string as a class name, or use the factory
  * to get a new application instance
  *
  * @param Streamwide_Engine_Signal $signal
  * @return Streamwide_Engine_Media_Application_Abstract|boolean
  */
 protected function _createNewApplication(Streamwide_Engine_Signal $signal = null)
 {
     if (is_string($this->_applicationClass)) {
         $application = new $this->_applicationClass($this, $signal);
     } elseif ($this->_applicationClass instanceof Streamwide_Engine_Media_Application_Factory) {
         $application = $this->_applicationClass->factory($this, $signal);
     }
     if (!$application instanceof Streamwide_Engine_Media_Application_Abstract) {
         trigger_notice('Media application must be an instance of Streamwide_Engine_Media_Application_Abstract', E_USER_NOTICE);
         return false;
     }
     return $application;
 }