public static function init() { $obj = new self(); $obj->register('', 'GET', 'all'); $obj->register('(?P<id>.+\\.php)', 'GET', 'get'); $obj->register('(?P<id>.+\\.php)/on', 'GET', 'activate'); $obj->register('(?P<id>.+\\.php)/off', 'GET', 'deactivate'); }
public static function getDefaultFactory() { $factory = new self(); $factory->register('global', 'Perms_Reflection_Global'); $factory->register('category', 'Perms_Reflection_Category'); $factory->registerFallback('Perms_Reflection_Object'); return $factory; }
/** * Register new autloader on $ns * @param string $ns * @param string|null $includePath * @param string|null $fileExt */ public static function AutoloadRegister($ns, $includePath = null, $fileExt = null) { $me = new self($ns, $includePath); if (null !== $fileExt) { $me->setFileExtension($fileExt); } $me->register(); }
public static function getDefaultInstance() { static $self = null; if (!$self) { $self = new self(); global $wgConfigRegistry; foreach ($wgConfigRegistry as $name => $callback) { $self->register($name, $callback); } } return $self; }
static function start($log_file = 'php://stderr', self $handler = null) { null === $handler && ($handler = new self()); // See also http://php.net/error_reporting // Formatting errors with html_errors, error_prepend_string or // error_append_string only works with displayed errors, not logged ones. ini_set('display_errors', false); ini_set('log_errors', true); ini_set('error_log', $log_file); // Some fatal errors can be caught at shutdown time! // Then, any fatal error is really fatal: remaining shutdown // functions, output buffering handlers or destructors are not called! register_shutdown_function(array(__CLASS__, 'shutdown')); self::$logFile = $log_file; // Register the handler and top it to the current error_reporting() level $handler->register(error_reporting()); return $handler; }
/** * Extra convenient static method to instantiate * and register Überloader with one base path and a * filesystem-based cache backend. * * @param string $base_directory The base directory to search from, usually the root of the application * @param string $cache_directory The directory in which to store the path cache * */ public static function init($base_directory, $cache_directory) { $loader = new self(); $loader->set_cache_backend(new UberloaderCacheBackendFilesystem($cache_directory)); $loader->add_path($base_directory); $loader->register(); return $loader; }
/** * Vytvoření nového (KT) Term Metaboxu dle zadaných metaboxů vč. případné registrace * * @author Martin Hlaváč * @link http://www.ktstudio.cz * * @param KT_Form_Fieldset $fieldset * @param string $taxonomy * @return \KT_Term_Metabox */ public static function create(KT_Form_Fieldset $fieldset, $roles = null, $register = true) { $metabox = new self($fieldset, $roles); if ($register) { $metabox->register(); } return $metabox; }
public static function serve() { $me = new self(); $me->register('app_required_provider_locations'); }
/** * @return ReaderRegistry */ public static function getDefaultInstance() { $instance = new self(); $instance->register(IniReader::class, array(Format::INI))->register(JsonReader::class, array(Format::JSON))->register(PhpReader::class, array(Format::PHP))->register(XmlReader::class, array(Format::XML))->register(YamlReader::class, array(Format::YAML))->register(DotenvReader::class, array(Format::ENV)); return $instance; }
/** * Enable the error handler, assuming defaults */ public static function enable() { $handler = new self(); $handler->register(); }
/** * Register supported hooks on the view template. * In order to invoke listeners reacting on that hooks template must invoke * smarty functions. * * Registered hooks: * {view_before_content} * {view_after_content} * * * @param OA_Admin_Template $oTpl * @param string $pageId page identifier (is passed to listeners) * @param array $pageData any page data that should be passed to listeneres */ public static function registerPageView(OA_Admin_Template $oTpl, $pageId, $pageData = null) { $oHooks = new self($pageId, $pageData); $oHooks->register($oTpl); return $oHooks; }