├── lib └── index.html ├── config ├── app.properties ├── controllers.context.php ├── controllers.properties └── app.context.php ├── vendors ├── lithe-php │ ├── lithe_IController.php │ ├── lithe_AbstractEmptyController.php │ ├── lithe_base.properties │ ├── README │ ├── lithe_Model.php │ ├── LICENSE │ ├── lithe_ControllerHandlerAdapter.php │ ├── lithe_Controller.php │ ├── lithe_base.context.php │ ├── lithe_ContextUtil.php │ └── lithe_BasicHandlerMapping.php ├── halo-php │ ├── halo_HttpResponse.php │ ├── halo_IHelperMapping.php │ ├── halo_IHelperFactory.php │ ├── halo_IHelperMappingAware.php │ ├── halo_IRegisteredHelpersAware.php │ ├── halo_IRegisteredHelperNamesAware.php │ ├── README │ ├── halo_IRequestHelperFactory.php │ ├── halo_IController.php │ ├── halo_mvc_multiaction_IMethodNameResolver.php │ ├── halo_IView.php │ ├── halo_IHandlerMapping.php │ ├── halo_view_AbstractUriView.php │ ├── halo_base.context.php │ ├── halo_IViewResolver.php │ ├── halo_IHandlerAdapter.php │ ├── halo_IViewFactory.php │ ├── halo_helper_SystemRequestHelperFactory.php │ ├── halo_view_skittle_SkittleUriView.php │ ├── halo_helper_skittle_SkittleHelperMappingAdapter.php │ ├── halo_handler_ControllerHandlerAdapter.php │ ├── halo_mvc_IController.php │ ├── halo_view_skittle_SubstrateResourceLocatorAdapter.php │ ├── halo_mvc_multiaction_PropertiesMethodNameResolver.php │ ├── halo_handler_SimpleEchoController.php │ ├── halo_handler_AbstractUriHandlerMapping.php │ ├── halo_view_InternalResourceViewResolver.php │ ├── halo_view_skittle_SkittleResourceLocatorView.php │ ├── halo_IHandlerInterceptor.php │ ├── halo_mvc_multiaction_InternalPathMethodNameResolver.php │ ├── halo_ModelAndView.php │ ├── halo_handler_HandlerExecutionChain.php │ ├── halo_view_AbstractViewResolver.php │ ├── LICENSE │ ├── halo_DispatcherUtil.php │ ├── halo_view_AbstractResourceViewResolver.php │ ├── halo_view_skittle_SkittleViewFactory.php │ ├── halo_view_ViewFactoryResourceViewResolver.php │ ├── halo_view_skittle_AbstractSkittleView.php │ ├── halo_helper_UriHelperFactory.php │ ├── halo_helper_UriHelper.php │ ├── halo_mvc_multiaction_ConfigurationMethodNameResolver.php │ ├── halo_mvc_multiaction_ParameterMethodNameResolver.php │ ├── halo_handler_SimpleUriHandlerMapping.php │ ├── halo_HelperUtil.php │ ├── halo_helper_CompositeRequestHelperMapping.php │ ├── halo_mvc_multiaction_MultiActionController.php │ ├── halo_handler_AbstractHandlerMapping.php │ └── halo_HttpRequest.php ├── substrate-php │ ├── substrate_stones_IOrderedStone.php │ ├── substrate_IContextStartupAware.php │ ├── substrate_stones_IPriorityOrderedStone.php │ ├── substrate_stones_StonesException.php │ ├── README │ ├── substrate_context_IResourceLoaderAware.php │ ├── substrate_IClassLoader.php │ ├── substrate_IPlaceholderConfigurer.php │ ├── substrate_IResourceLocator.php │ ├── substrate_stones_factory_IStoneNameAware.php │ ├── substrate_stones_IContextAware.php │ ├── substrate_util_IPathMatcher.php │ ├── substrate_stones_factory_IInitializingStone.php │ ├── substrate_stones_IContextStartupAware.php │ ├── substrate_stones_factory_IStoneClassLoaderAware.php │ ├── substrate_stones_IFactoryStone.php │ ├── substrate_context_IApplicationContextAware.php │ ├── substrate_SimplePathResourceLocator.php │ ├── substrate_stones_factory_IStoneFactoryAware.php │ ├── substrate_PropertiesDdConfigurationPlaceholderConfigurer.php │ ├── substrate_ClasspathClassLoader.php │ ├── substrate_stones_factory_IDisposableStone.php │ ├── substrate_ContextStoneReference.php │ ├── substrate_DdConfigurationPlaceholderConfigurer.php │ ├── substrate_ClasspathResourceLocator.php │ ├── substrate_ResourceLocatorClassLoader.php │ ├── substrate_stones_OrderedUtil.php │ ├── substrate_context_IApplicationContext.php │ ├── substrate_CompositeClassLoader.php │ ├── LICENSE │ ├── substrate_stones_factory_NoSuchStoneDefinitionException.php │ ├── substrate_stones_factory_StoneNotOfRequiredTypeException.php │ ├── substrate_stones_factory_IStoneFactory.php │ ├── substrate_AbstractClassLoader.php │ ├── substrate_PathResourceLocator.php │ └── substrate_util_AntPathMatcher.php ├── dd-uri-php │ ├── README │ ├── LICENSE │ └── dd_uri_UriConfiguration.php ├── dd-core-php │ ├── README │ ├── dd_core_IClassLoader.php │ ├── dd_core_IResourceLocator.php │ ├── dd_core_ClassLoaderUtil.php │ ├── dd_core_ClasspathResourceLocator.php │ ├── dd_core_ResourceLocatorClassLoader.php │ ├── LICENSE │ ├── dd_core_AbstractClassLoader.php │ └── dd_core_PathResourceLocator.php ├── skittle-php │ ├── skittle_IResourceLocator.php │ ├── README │ ├── skittle_IHelperMapping.php │ ├── skittle_ClasspathResourceLocator.php │ ├── LICENSE │ └── skittle_PathResourceLocator.php ├── dd-logging-php │ ├── README │ ├── dd_logging_Util.php │ ├── LICENSE │ ├── dd_logging_LogFactory.php │ ├── dd_logging_ILogger.php │ ├── dd_logging_AbstractLogger.php │ └── dd_logging_SimpleLogger.php └── dd-configuration-php │ ├── README │ ├── dd_configuration_IResourceLoader.php │ ├── dd_configuration_CompositeConfiguration.php │ ├── dd_configuration_ClasspathResourceLoader.php │ ├── dd_configuration_PdoConfiguration.php │ ├── dd_configuration_IConfiguration.php │ ├── dd_configuration_MapConfiguration.php │ ├── LICENSE │ ├── dd_configuration_Util.php │ ├── dd_configuration_AbstractConfiguration.php │ ├── dd_configuration_PropertiesConfiguration.php │ ├── dd_configuration_Resolver.php │ └── dd_configuration_PathResourceLoader.php ├── .gitignore ├── docroot ├── .htaccess.example └── index.php ├── controllers ├── HomeController.php └── DemoController.php ├── views ├── home.php ├── myshell.php └── demo │ ├── submission.php │ └── index.php ├── .htaccess.example ├── README ├── LICENSE └── bootstraps └── bootstrap.php /lib/index.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /config/app.properties: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /vendors/lithe-php/lithe_IController.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /vendors/halo-php/halo_IHelperFactory.php: -------------------------------------------------------------------------------- 1 | 5 | -------------------------------------------------------------------------------- /vendors/halo-php/halo_IHelperMappingAware.php: -------------------------------------------------------------------------------- 1 | view = 'home'; 7 | } 8 | 9 | } -------------------------------------------------------------------------------- /vendors/dd-uri-php/README: -------------------------------------------------------------------------------- 1 | Dragonfly Development PHP URI Library 2 | http://dflydev.com/d2code/php/dd-uri-php/ 3 | 4 | 5 | dd-uri is useful for generating both relative and absolute URI. 6 | -------------------------------------------------------------------------------- /vendors/halo-php/halo_IRegisteredHelperNamesAware.php: -------------------------------------------------------------------------------- 1 | shell('myshell.php'); 3 | $s->set('title', 'Welcome!'); 4 | $uri = $s->helper('uri'); 5 | ?> 6 |

Welcome to Lithe!

7 | 10 | -------------------------------------------------------------------------------- /vendors/substrate-php/README: -------------------------------------------------------------------------------- 1 | Substrate IoC/DI Container for PHP 2 | http://substrate-php.org/ 3 | 4 | 5 | Substrate is an IoC/DI Container for PHP. Substrate is inspired by Spring 6 | Framework, but written with the strengths and limitations of PHP in mind. 7 | -------------------------------------------------------------------------------- /vendors/dd-core-php/README: -------------------------------------------------------------------------------- 1 | Dragonfly Development PHP Core Library 2 | http://redmine.dflydev.com/projects/dd-core 3 | 4 | 5 | dd-core provides some basic bootstrapping functionality such as resource 6 | locating (finding files on disk) and class loading. 7 | 8 | -------------------------------------------------------------------------------- /.htaccess.example: -------------------------------------------------------------------------------- 1 | RewriteEngine on 2 | 3 | RewriteCond %{REQUEST_FILENAME} !-f 4 | RewriteCond %{REQUEST_FILENAME} !-d 5 | RewriteRule ^(.*)$ /home/altern8/workspaces/lithe-php-single-site/docroot/$1 [L] 6 | 7 | RewriteRule ^$ /home/altern8/workspaces/lithe-php-single-site/docroot/ [L] 8 | -------------------------------------------------------------------------------- /vendors/dd-core-php/dd_core_IClassLoader.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /vendors/substrate-php/substrate_IPlaceholderConfigurer.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /vendors/halo-php/README: -------------------------------------------------------------------------------- 1 | Halo Web Application Framework for PHP 2 | http://halo-php.org/ 3 | 4 | 5 | Halo is a web application framework for PHP. Halo is built on top of 6 | Substrate, an Inversion of Control/Dependency Injection Container 7 | (IoC/DI) for PHP. 8 | 9 | Halo was inspired by aspects of Spring MVC. 10 | -------------------------------------------------------------------------------- /vendors/halo-php/halo_IRequestHelperFactory.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /vendors/substrate-php/substrate_IResourceLocator.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /vendors/substrate-php/substrate_stones_factory_IStoneNameAware.php: -------------------------------------------------------------------------------- 1 | 11 | -------------------------------------------------------------------------------- /views/myshell.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | <?php $s->p($title); ?> 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /vendors/halo-php/halo_mvc_multiaction_IMethodNameResolver.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /vendors/substrate-php/substrate_stones_factory_IInitializingStone.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /vendors/substrate-php/substrate_stones_factory_IStoneClassLoaderAware.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /vendors/dd-logging-php/README: -------------------------------------------------------------------------------- 1 | Dragonfly Development PHP Logging Library 2 | http://dflydev.com/d2code/php/dd-logging-php/ 3 | 4 | 5 | dd-logging provides a generic logging interface enabling PHP developers 6 | to enjoy some of the benefits provided Java users by way of the Apache 7 | Commons Logging library. 8 | 9 | 10 | Inspired by Apache Commons Logging 11 | http://commons.apache.org/logging/ 12 | -------------------------------------------------------------------------------- /controllers/DemoController.php: -------------------------------------------------------------------------------- 1 | view = 'demo/index'; 7 | } 8 | 9 | public function submit() { 10 | $this->model->set('name', $this->httpRequest->postParam('name')); 11 | $this->view = 'demo/submission'; 12 | } 13 | 14 | } -------------------------------------------------------------------------------- /vendors/substrate-php/substrate_context_IApplicationContextAware.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /vendors/halo-php/halo_view_AbstractUriView.php: -------------------------------------------------------------------------------- 1 | uri = $uri; 19 | } 20 | 21 | } -------------------------------------------------------------------------------- /vendors/dd-configuration-php/README: -------------------------------------------------------------------------------- 1 | Dragonfly Development PHP Configuration Library 2 | http://dflydev.com/d2code/php/dd-configuration-php/ 3 | 4 | 5 | dd-configuration provides a generic configuration interface enabling PHP 6 | developers to enjoy some of the benefits provided Java users by way of the 7 | Apache Commons Configuration library. 8 | 9 | 10 | Inspired by Apache Commons Configuration 11 | http://commons.apache.org/configuration/ 12 | -------------------------------------------------------------------------------- /vendors/substrate-php/substrate_stones_factory_IStoneFactoryAware.php: -------------------------------------------------------------------------------- 1 | shell('myshell.php'); 3 | $s->set('title', 'Demo Form Submission Results'); 4 | $uri = $s->helper('uri'); 5 | ?> 6 | 10 |

Demonstration Submission results

11 | You posted p($name ? $name : 'NOTHING'); ?>. Again? -------------------------------------------------------------------------------- /README: -------------------------------------------------------------------------------- 1 | Lithe Web Application Framework for PHP - Single Site Application 2 | http://lithe-php.org/ 3 | 4 | 5 | Lithe is a lightweight web application framework for PHP. This is a template 6 | for a single site application. 7 | 8 | 9 | INSTALLATION 10 | 11 | To get started, copy .htaccess.example to .htaccess in both the root folder 12 | and in the docroot/ folder. 13 | 14 | Beyond that, the default Lithe configuration should be sufficient to run the 15 | simple demo application. -------------------------------------------------------------------------------- /vendors/halo-php/halo_base.context.php: -------------------------------------------------------------------------------- 1 | add('halo.dispatcher', array( 4 | 'className' => 'halo_Dispatcher', 5 | 'dependencies' => array( 6 | 'halo.helpers.systemHelpers', 7 | ), 8 | )); 9 | 10 | $context->add('halo.controllerHandlerAdapter', array( 11 | 'className' => 'halo_handler_ControllerHandlerAdapter', 12 | )); 13 | 14 | $context->add('halo.helpers.systemHelpers', array( 15 | 'className' => 'halo_helper_SystemRequestHelperFactory', 16 | )); -------------------------------------------------------------------------------- /config/controllers.properties: -------------------------------------------------------------------------------- 1 | lithe.controllers.defaultHandlerMapping.defaultParent=lithe.controllers.defaultParentController 2 | lithe.controllers.defaultHandlerMapping.defaultMethod=index 3 | lithe.controllers.defaultHandlerMapping.defaultController=home 4 | lithe.controllers.defaultHandlerMapping.classNamePrefix= 5 | lithe.controllers.defaultHandlerMapping.classNameSuffix=Controller 6 | lithe.controllers.defaultHandlerMapping.stoneNamePrefix= 7 | lithe.controllers.defaultHandlerMapping.stoneNameSuffix=Controller -------------------------------------------------------------------------------- /vendors/dd-configuration-php/dd_configuration_IResourceLoader.php: -------------------------------------------------------------------------------- 1 | 23 | -------------------------------------------------------------------------------- /vendors/dd-logging-php/dd_logging_Util.php: -------------------------------------------------------------------------------- 1 | 19 | -------------------------------------------------------------------------------- /vendors/substrate-php/substrate_PropertiesDdConfigurationPlaceholderConfigurer.php: -------------------------------------------------------------------------------- 1 | 10 | -------------------------------------------------------------------------------- /views/demo/index.php: -------------------------------------------------------------------------------- 1 | shell('myshell.php'); 3 | $s->set('title', 'Demo Home'); 4 | $uri = $s->helper('uri'); 5 | ?> 6 | 9 |

Demonstration

10 |
11 |
12 | Form handling 13 | 14 |
15 |
-------------------------------------------------------------------------------- /vendors/halo-php/halo_IViewResolver.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /vendors/substrate-php/substrate_stones_factory_IDisposableStone.php: -------------------------------------------------------------------------------- 1 | data[$key] = $value; 7 | } 8 | public function delete($key) { 9 | unset($this->data[$key]); 10 | } 11 | public function get($key) { 12 | return $this->data[$key]; 13 | } 14 | public function merge(array $data) { 15 | $this->data = array_merge_recursive($this->data, $data); 16 | } 17 | public function replace(array $data) { 18 | $this->data = $data; 19 | } 20 | public function export() { 21 | return $this->data; 22 | } 23 | } -------------------------------------------------------------------------------- /vendors/skittle-php/skittle_IHelperMapping.php: -------------------------------------------------------------------------------- 1 | 27 | -------------------------------------------------------------------------------- /config/app.context.php: -------------------------------------------------------------------------------- 1 | add('configuration', array( 4 | 'className' => 'dd_configuration_PropertiesConfiguration', 5 | 'constructorArgs' => array( 6 | 'locations' => array( 7 | 'lithe_base.properties', 8 | 'app.properties', 9 | 'app.site.properties', 10 | ), 11 | ), 12 | )); 13 | 14 | $context->add('placeholderConfigurer', array( 15 | 'className' => 'substrate_DdConfigurationPlaceholderConfigurer', 16 | 'constructorArgs' => array( 17 | 'configuration' => $context->ref('configuration'), 18 | ), 19 | )); 20 | 21 | $context->add('logFactory', array( 22 | 'className' => 'dd_logging_LogFactory', 23 | )); 24 | -------------------------------------------------------------------------------- /vendors/substrate-php/substrate_ContextStoneReference.php: -------------------------------------------------------------------------------- 1 | name = $name; 16 | } 17 | 18 | /** 19 | * Stone's name 20 | * @return string 21 | */ 22 | public function name() { 23 | return $this->name; 24 | } 25 | 26 | /** 27 | * Set the stone's name 28 | * @param $name 29 | */ 30 | public function setName($name) { 31 | $this->name = $name; 32 | } 33 | 34 | } 35 | 36 | ?> -------------------------------------------------------------------------------- /vendors/substrate-php/substrate_DdConfigurationPlaceholderConfigurer.php: -------------------------------------------------------------------------------- 1 | configuration = $configuration; 13 | } 14 | 15 | public function replacePlaceholders($value) { 16 | return dd_configuration_Util::RESOLVE_VALUE( 17 | $this->configuration, 18 | $value 19 | ); 20 | } 21 | 22 | } 23 | 24 | ?> -------------------------------------------------------------------------------- /vendors/dd-core-php/dd_core_ClasspathResourceLocator.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /vendors/dd-configuration-php/dd_configuration_CompositeConfiguration.php: -------------------------------------------------------------------------------- 1 | import($configurations); 26 | } 27 | 28 | } 29 | 30 | ?> 31 | -------------------------------------------------------------------------------- /vendors/dd-core-php/dd_core_ResourceLocatorClassLoader.php: -------------------------------------------------------------------------------- 1 | resourceLocator = $resourceLocator; 15 | } 16 | 17 | /** 18 | * (non-PHPdoc) 19 | * @see dd_core_AbstractClassLoader::find() 20 | */ 21 | public function find($classFileName) { 22 | return $this->resourceLocator->find($classFileName, true); 23 | } 24 | 25 | } -------------------------------------------------------------------------------- /vendors/halo-php/halo_helper_SystemRequestHelperFactory.php: -------------------------------------------------------------------------------- 1 | helperNames); 8 | } 9 | public function helper($name, halo_HttpRequest $httpRequest, halo_HttpResponse $httpResponse) { 10 | switch($name) { 11 | case 'httpRequest': 12 | return $httpRequest; 13 | break; 14 | case 'httpResponse': 15 | return $httpResponse; 16 | break; 17 | default: 18 | return null; 19 | break; 20 | } 21 | } 22 | } -------------------------------------------------------------------------------- /vendors/substrate-php/substrate_ResourceLocatorClassLoader.php: -------------------------------------------------------------------------------- 1 | resourceLocator = $resourceLocator; 15 | } 16 | 17 | /** 18 | * (non-PHPdoc) 19 | * @see lib/substrate_AbstractClassLoader::find() 20 | */ 21 | public function find($classFileName) { 22 | return $this->resourceLocator->find($classFileName, true); 23 | } 24 | 25 | } 26 | 27 | ?> -------------------------------------------------------------------------------- /vendors/halo-php/halo_view_skittle_SkittleUriView.php: -------------------------------------------------------------------------------- 1 | helperMapping = $helperMapping; 20 | } 21 | 22 | /** 23 | * Returns the helper object associated with the specified name. 24 | * @param string $name 25 | * @return object|null The helper object whose name is $name 26 | */ 27 | public function helper($name) { 28 | return $this->helperMapping->helper($name); 29 | } 30 | 31 | } 32 | -------------------------------------------------------------------------------- /vendors/halo-php/halo_handler_ControllerHandlerAdapter.php: -------------------------------------------------------------------------------- 1 | handleRequest($httpRequest, $httpResponse); 26 | } 27 | 28 | } 29 | -------------------------------------------------------------------------------- /vendors/halo-php/halo_mvc_IController.php: -------------------------------------------------------------------------------- 1 | resourceLocator = $resourceLocator; 21 | } 22 | 23 | /** 24 | * Attempt to find a target 25 | * @param $target 26 | * @param $realPath 27 | */ 28 | public function find($target, $realPath = false) { 29 | return $this->resourceLocator->find($target, $realPath); 30 | } 31 | 32 | } -------------------------------------------------------------------------------- /vendors/halo-php/halo_mvc_multiaction_PropertiesMethodNameResolver.php: -------------------------------------------------------------------------------- 1 | setConfiguration(new dd_configuration_MapConfiguration($mappings)); 24 | } 25 | 26 | } -------------------------------------------------------------------------------- /vendors/dd-configuration-php/dd_configuration_ClasspathResourceLoader.php: -------------------------------------------------------------------------------- 1 | 38 | -------------------------------------------------------------------------------- /vendors/halo-php/halo_handler_SimpleEchoController.php: -------------------------------------------------------------------------------- 1 | content = $content; 28 | } 29 | 30 | /** 31 | * (non-PHPdoc) 32 | * @see halo_IController::handleRequest() 33 | */ 34 | public function handleRequest(halo_HttpRequest $httpRequest, halo_HttpResponse $httpResponse) { 35 | echo $this->content; 36 | } 37 | 38 | } 39 | 40 | halo_examples_SimpleEchoController::$LOGGER = dd_logging_LogFactory::get('halo_examples_SimpleEchoController'); 41 | -------------------------------------------------------------------------------- /vendors/halo-php/halo_handler_AbstractUriHandlerMapping.php: -------------------------------------------------------------------------------- 1 | registerHandlers(); 18 | } 19 | 20 | /** 21 | * Register a handler 22 | * @param $uriPaths 23 | * @param $handlerName 24 | */ 25 | protected function registerHandler($uriPaths, $handlerName) { 26 | if ( ! is_array($uriPaths) ) $uriPaths = array($uriPaths); 27 | foreach ( $uriPaths as $uriPath ) { 28 | $this->registeredHandlers[$uriPath] = $handlerName; 29 | } 30 | } 31 | 32 | /** 33 | * Register handlers 34 | */ 35 | abstract protected function registerHandlers(); 36 | 37 | } -------------------------------------------------------------------------------- /vendors/halo-php/halo_view_InternalResourceViewResolver.php: -------------------------------------------------------------------------------- 1 | classLoader->load($this->viewClass); 26 | return new $this->viewClass($viewUri); 27 | } 28 | 29 | /** 30 | * Set view class name 31 | * @param $viewClass 32 | */ 33 | public function setViewClass($viewClass) { 34 | $this->viewClass = $viewClass; 35 | } 36 | 37 | } 38 | -------------------------------------------------------------------------------- /vendors/halo-php/halo_view_skittle_SkittleResourceLocatorView.php: -------------------------------------------------------------------------------- 1 | resourceLocator = $resourceLocator; 25 | } 26 | 27 | /** 28 | * Instantiate Skittle. 29 | * @param $model 30 | * @param $httpRequest 31 | * @param $httpResponse 32 | */ 33 | public function instantiate(array $model, halo_HttpRequest $httpRequest, halo_HttpResponse $httpResponse) { 34 | return new skittle_Skittle($this->resourceLocator); 35 | } 36 | 37 | } -------------------------------------------------------------------------------- /vendors/halo-php/halo_IHandlerInterceptor.php: -------------------------------------------------------------------------------- 1 | prefix = ($prefix !== null ? $prefix : ""); 13 | } 14 | protected function getPrefix() { 15 | return $this->prefix; 16 | } 17 | public function setSuffix($suffix) { 18 | $this->suffix = ($suffix !== null ? $suffix : ""); 19 | } 20 | protected function getSuffix() { 21 | return $this->suffix; 22 | } 23 | 24 | /** 25 | * (non-PHPdoc) 26 | * @see halo_mvc_multiaction_IMethodNameResolver::getHandlerMethodName() 27 | */ 28 | public function getHandlerMethodName(halo_HttpRequest $request){ 29 | $urlPath = $request->getRequestedUri(); 30 | $methodName = basename($urlPath, ".php"); 31 | $methodName = $this->prefix. $methodName. $this->suffix; 32 | return $methodName; 33 | } 34 | 35 | } -------------------------------------------------------------------------------- /vendors/substrate-php/substrate_stones_OrderedUtil.php: -------------------------------------------------------------------------------- 1 | $i2) ? -1 : 0; 20 | } 21 | static public function SORT(array $toBeSorted) { 22 | usort($toBeSorted, array('substrate_stones_OrderedUtil', 'compare')); 23 | return $toBeSorted; 24 | } 25 | static protected function GET_STONE_ORDER($object) { 26 | $order = $object instanceof substrate_stones_IOrderedStone ? $object->getStoneOrder() : null; 27 | return $order !== null ? $order : self::$LOWEST_PRECEDENCE; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /vendors/halo-php/halo_ModelAndView.php: -------------------------------------------------------------------------------- 1 | view = $viewMixed; 10 | $this->isReferenced = false; 11 | } else { 12 | $this->viewName = $viewMixed; 13 | $this->isReferenced = true; 14 | } 15 | $this->model = $model === null ? array() : $model; 16 | } 17 | public function isReferenced() { 18 | return $this->isReferenced; 19 | } 20 | public function getView() { 21 | return $this->view; 22 | } 23 | public function getViewName() { 24 | return $this->viewName; 25 | } 26 | public function getModel() { 27 | return $this->model; 28 | } 29 | public function keys() { 30 | return array_keys($this->model); 31 | } 32 | public function exists($key) { 33 | return array_key_exists($key, $this->model); 34 | } 35 | public function get($key) { 36 | return $this->model[$key]; 37 | } 38 | public function set($key, $value = null) { 39 | $this->model[$key] = $value; 40 | } 41 | } -------------------------------------------------------------------------------- /vendors/substrate-php/substrate_context_IApplicationContext.php: -------------------------------------------------------------------------------- 1 | handler = $handler->getHandler(); 27 | $this->interceptors = array_merge($handler->getInterceptors(), $interceptors); 28 | } else { 29 | $this->handler = $handler; 30 | $this->interceptors = $interceptors; 31 | } 32 | } 33 | 34 | /** 35 | * Get the handler 36 | */ 37 | public function getHandler() { 38 | return $this->handler; 39 | } 40 | 41 | /** 42 | * Get the interceptors 43 | */ 44 | public function getInterceptors() { 45 | return $this->interceptors; 46 | } 47 | 48 | } -------------------------------------------------------------------------------- /vendors/dd-configuration-php/dd_configuration_PdoConfiguration.php: -------------------------------------------------------------------------------- 1 | prepare($sql); 29 | $sth->execute(); 30 | foreach ( $sth->fetchAll(PDO::FETCH_ASSOC) as $row ) { 31 | $this->map[$row['configurationKey']] = $row['configurationValue']; 32 | } 33 | } 34 | 35 | } 36 | 37 | ?> 38 | -------------------------------------------------------------------------------- /docroot/index.php: -------------------------------------------------------------------------------- 1 | array(LITHE_CONTROLLERS_ROOT), 25 | 'views' => array(LITHE_VIEWS_ROOT), 26 | )); 27 | 28 | // Configure the controller configuration. 29 | lithe_ContextUtil::CONFIGURE_CONTROLLER_CONFIGURATION($context, array( 30 | 'controllers.properties', 31 | )); 32 | 33 | // Configure Dispatcher dependencies 34 | lithe_ContextUtil::CONFIGURE_DISPATCHER_DEPENDENCIES($context, array( 35 | 'lithe.handlers.defaultHandlerMapping', 36 | 'lithe.views.defaultViewResolver', 37 | )); 38 | 39 | // Execute the context. 40 | $context->execute(); 41 | 42 | // Execute the dispatcher. 43 | lithe_ContextUtil::DISPATCH($context); -------------------------------------------------------------------------------- /vendors/substrate-php/substrate_CompositeClassLoader.php: -------------------------------------------------------------------------------- 1 | classLoaders = $classLoaders; 22 | } 23 | 24 | /** 25 | * Load a class 26 | * @param $className 27 | * @param $includeFilename 28 | */ 29 | public function load($className, $includeFilename = null) { 30 | if ( class_exists($className) ) return true; 31 | if ( isset($this->loadAttemptedLocally[$className]) ) return false; 32 | $this->loadAttemptedLocally[$className] = true; 33 | if ( $includeFilename !== null ) { 34 | // If an include filename was specified, we'll 35 | // just assume that is what we are looking for. 36 | require_once($includeFilename); 37 | return true; 38 | } 39 | foreach ( $this->classLoaders as $classLoader ) { 40 | if ( $classLoader->load($className) ) return true; 41 | } 42 | return false; 43 | } 44 | 45 | } 46 | 47 | ?> -------------------------------------------------------------------------------- /vendors/dd-configuration-php/dd_configuration_IConfiguration.php: -------------------------------------------------------------------------------- 1 | 68 | -------------------------------------------------------------------------------- /vendors/halo-php/halo_view_AbstractViewResolver.php: -------------------------------------------------------------------------------- 1 | classLoader = new substrate_ClasspathClassLoader(); 31 | } else { 32 | $this->classLoader = $classLoader; 33 | } 34 | } 35 | 36 | /** 37 | * Set the stone order 38 | * 39 | * Used for sorting multiple stones of a given implementation. 40 | * @param $stoneOrder 41 | */ 42 | public function setStoneOrder($stoneOrder) { $this->stoneOrder = $stoneOrder; } 43 | 44 | /** 45 | * Get the stone order 46 | * 47 | * Used for sorting multiple stones of a given implementation. 48 | * @param $stoneOrder 49 | */ 50 | public function getStoneOrder() { return $this->stoneOrder; } 51 | 52 | } 53 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2010, Dragonfly Development Inc 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | 7 | * Redistributions of source code must retain the above copyright notice, 8 | this list of conditions and the following disclaimer. 9 | * Redistributions in binary form must reproduce the above copyright 10 | notice, this list of conditions and the following disclaimer in the 11 | documentation and/or other materials provided with the distribution. 12 | * Neither the name of Dragonfly Development Inc nor the names of its 13 | contributors may be used to endorse or promote products derived from 14 | this software without specific prior written permission. 15 | 16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 19 | ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 20 | LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 21 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 22 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 23 | INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 24 | CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 25 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 26 | POSSIBILITY OF SUCH DAMAGE. 27 | -------------------------------------------------------------------------------- /vendors/dd-configuration-php/dd_configuration_MapConfiguration.php: -------------------------------------------------------------------------------- 1 | map = $map; 23 | } 24 | 25 | /** 26 | * All keys 27 | * @return array 28 | */ 29 | public function keys() { 30 | return array_keys($this->map); 31 | } 32 | 33 | /** 34 | * Get raw value for key 35 | * 36 | * Value will be returned raw and will not contain any resolved 37 | * results. 38 | * 39 | * @param string $key Key 40 | * @return mixed 41 | */ 42 | public function getRaw($key) { 43 | return array_key_exists($key, $this->map) ? $this->map[$key] : null; 44 | } 45 | 46 | /** 47 | * Set value for a key 48 | * @input string $key Key 49 | * @input mixed $value Value 50 | */ 51 | public function set($key, $value = null) { 52 | $this->map[$key] = $value; 53 | } 54 | 55 | /** 56 | * Does a key exist? 57 | * @input string $key Key 58 | * @return bool 59 | */ 60 | public function exists($key) { 61 | return array_key_exists($key, $this->map); 62 | } 63 | 64 | } 65 | 66 | ?> 67 | -------------------------------------------------------------------------------- /vendors/dd-core-php/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2010, Dragonfly Development Inc 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | 7 | * Redistributions of source code must retain the above copyright notice, 8 | this list of conditions and the following disclaimer. 9 | * Redistributions in binary form must reproduce the above copyright 10 | notice, this list of conditions and the following disclaimer in the 11 | documentation and/or other materials provided with the distribution. 12 | * Neither the name of Dragonfly Development Inc nor the names of its 13 | contributors may be used to endorse or promote products derived from 14 | this software without specific prior written permission. 15 | 16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 19 | ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 20 | LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 21 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 22 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 23 | INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 24 | CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 25 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 26 | POSSIBILITY OF SUCH DAMAGE. 27 | -------------------------------------------------------------------------------- /vendors/dd-uri-php/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2010, Dragonfly Development Inc 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | 7 | * Redistributions of source code must retain the above copyright notice, 8 | this list of conditions and the following disclaimer. 9 | * Redistributions in binary form must reproduce the above copyright 10 | notice, this list of conditions and the following disclaimer in the 11 | documentation and/or other materials provided with the distribution. 12 | * Neither the name of Dragonfly Development Inc nor the names of its 13 | contributors may be used to endorse or promote products derived from 14 | this software without specific prior written permission. 15 | 16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 19 | ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 20 | LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 21 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 22 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 23 | INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 24 | CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 25 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 26 | POSSIBILITY OF SUCH DAMAGE. 27 | -------------------------------------------------------------------------------- /vendors/halo-php/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2010, Dragonfly Development Inc 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | 7 | * Redistributions of source code must retain the above copyright notice, 8 | this list of conditions and the following disclaimer. 9 | * Redistributions in binary form must reproduce the above copyright 10 | notice, this list of conditions and the following disclaimer in the 11 | documentation and/or other materials provided with the distribution. 12 | * Neither the name of Dragonfly Development Inc nor the names of its 13 | contributors may be used to endorse or promote products derived from 14 | this software without specific prior written permission. 15 | 16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 19 | ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 20 | LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 21 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 22 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 23 | INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 24 | CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 25 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 26 | POSSIBILITY OF SUCH DAMAGE. 27 | -------------------------------------------------------------------------------- /vendors/halo-php/halo_DispatcherUtil.php: -------------------------------------------------------------------------------- 1 | attribute(self::$CONTEXT_KEY); 41 | } 42 | 43 | /** 44 | * Set the Substrate context for an HTTP Request. 45 | * @param halo_HttpRequest $httpRequest 46 | * @param substrate_Context $context 47 | */ 48 | public static function SET_CONTEXT(halo_HttpRequest $httpRequest, substrate_Context $context) { 49 | return $httpRequest->setAttribute(self::$CONTEXT_KEY, $context); 50 | } 51 | 52 | } -------------------------------------------------------------------------------- /vendors/lithe-php/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2010, Dragonfly Development Inc 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | 7 | * Redistributions of source code must retain the above copyright notice, 8 | this list of conditions and the following disclaimer. 9 | * Redistributions in binary form must reproduce the above copyright 10 | notice, this list of conditions and the following disclaimer in the 11 | documentation and/or other materials provided with the distribution. 12 | * Neither the name of Dragonfly Development Inc nor the names of its 13 | contributors may be used to endorse or promote products derived from 14 | this software without specific prior written permission. 15 | 16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 19 | ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 20 | LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 21 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 22 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 23 | INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 24 | CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 25 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 26 | POSSIBILITY OF SUCH DAMAGE. 27 | -------------------------------------------------------------------------------- /vendors/skittle-php/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2010, Dragonfly Development Inc 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | 7 | * Redistributions of source code must retain the above copyright notice, 8 | this list of conditions and the following disclaimer. 9 | * Redistributions in binary form must reproduce the above copyright 10 | notice, this list of conditions and the following disclaimer in the 11 | documentation and/or other materials provided with the distribution. 12 | * Neither the name of Dragonfly Development Inc nor the names of its 13 | contributors may be used to endorse or promote products derived from 14 | this software without specific prior written permission. 15 | 16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 19 | ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 20 | LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 21 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 22 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 23 | INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 24 | CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 25 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 26 | POSSIBILITY OF SUCH DAMAGE. 27 | -------------------------------------------------------------------------------- /vendors/dd-logging-php/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2010, Dragonfly Development Inc 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | 7 | * Redistributions of source code must retain the above copyright notice, 8 | this list of conditions and the following disclaimer. 9 | * Redistributions in binary form must reproduce the above copyright 10 | notice, this list of conditions and the following disclaimer in the 11 | documentation and/or other materials provided with the distribution. 12 | * Neither the name of Dragonfly Development Inc nor the names of its 13 | contributors may be used to endorse or promote products derived from 14 | this software without specific prior written permission. 15 | 16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 19 | ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 20 | LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 21 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 22 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 23 | INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 24 | CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 25 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 26 | POSSIBILITY OF SUCH DAMAGE. 27 | -------------------------------------------------------------------------------- /vendors/substrate-php/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2010, Dragonfly Development Inc 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | 7 | * Redistributions of source code must retain the above copyright notice, 8 | this list of conditions and the following disclaimer. 9 | * Redistributions in binary form must reproduce the above copyright 10 | notice, this list of conditions and the following disclaimer in the 11 | documentation and/or other materials provided with the distribution. 12 | * Neither the name of Dragonfly Development Inc nor the names of its 13 | contributors may be used to endorse or promote products derived from 14 | this software without specific prior written permission. 15 | 16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 19 | ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 20 | LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 21 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 22 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 23 | INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 24 | CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 25 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 26 | POSSIBILITY OF SUCH DAMAGE. 27 | -------------------------------------------------------------------------------- /vendors/dd-configuration-php/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2010, Dragonfly Development Inc 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | 7 | * Redistributions of source code must retain the above copyright notice, 8 | this list of conditions and the following disclaimer. 9 | * Redistributions in binary form must reproduce the above copyright 10 | notice, this list of conditions and the following disclaimer in the 11 | documentation and/or other materials provided with the distribution. 12 | * Neither the name of Dragonfly Development Inc nor the names of its 13 | contributors may be used to endorse or promote products derived from 14 | this software without specific prior written permission. 15 | 16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 19 | ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 20 | LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 21 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 22 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 23 | INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 24 | CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 25 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 26 | POSSIBILITY OF SUCH DAMAGE. 27 | -------------------------------------------------------------------------------- /vendors/dd-configuration-php/dd_configuration_Util.php: -------------------------------------------------------------------------------- 1 | keys() as $key ) { 22 | $importer->set($key, $importee->getRaw($key)); 23 | } 24 | return true; 25 | } 26 | 27 | /** 28 | * Resolve a key 29 | * @param dd_configuration_IConfiguration $configuration Configuration 30 | * @param string $key Key 31 | * @return string Resolved key 32 | */ 33 | static public function RESOLVE_KEY(dd_configuration_IConfiguration $configuration, $key) { 34 | return $configuration->resolver()->resolveKey($configuration, $key); 35 | } 36 | 37 | /** 38 | * Resolve a value 39 | * @param dd_configuration_IConfiguration $configuration Configuration 40 | * @param string $value value 41 | * @return string Resolved key 42 | */ 43 | static public function RESOLVE_VALUE(dd_configuration_IConfiguration $configuration, $value) { 44 | return $configuration->resolver()->resolveValue($configuration, $value); 45 | } 46 | 47 | } 48 | 49 | ?> 50 | -------------------------------------------------------------------------------- /vendors/halo-php/halo_view_AbstractResourceViewResolver.php: -------------------------------------------------------------------------------- 1 | prefix . $viewName . $this->suffix; 26 | return $this->doResolveViewUri($viewUri, $viewName, $httpRequest, $httpResponse); 27 | } 28 | 29 | /** 30 | * Continue resolving the view URI 31 | * 32 | * Expected to return instance of halo_view_IView or null if not accepted. 33 | * @param string $viewUri 34 | * @param string $viewName 35 | * @param halo_HttpRequest $httpRequest 36 | * @param halo_HttpResponse $httpResponse 37 | */ 38 | abstract public function doResolveViewUri($viewUri, $viewName, halo_HttpRequest $httpRequest, halo_HttpResponse $httpResponse); 39 | 40 | /** 41 | * Set prefix 42 | * @param $preffix 43 | */ 44 | public function setPrefix($prefix) { 45 | $this->prefix = $prefix; 46 | } 47 | 48 | /** 49 | * Set suffix 50 | * @param $suffix 51 | */ 52 | public function setSuffix($suffix) { 53 | $this->suffix = $suffix; 54 | } 55 | 56 | } 57 | -------------------------------------------------------------------------------- /vendors/halo-php/halo_view_skittle_SkittleViewFactory.php: -------------------------------------------------------------------------------- 1 | substrateResourceLocatorAdapter = new halo_view_skittle_SubstrateResourceLocatorAdapter($resourceLocator); 21 | } 22 | 23 | /** 24 | * (non-PHPdoc) 25 | * @see halo_IViewFactory::supports() 26 | */ 27 | public function supports($viewUri, $viewName, halo_HttpRequest $httpRequest, halo_HttpResponse $httpResponse) { 28 | if ( $this->substrateResourceLocatorAdapter->find($viewUri) ) { 29 | // If our resource locator can find the view URI we know that 30 | // the view we create will be able to support it. 31 | return true; 32 | } 33 | return false; 34 | } 35 | 36 | /** 37 | * (non-PHPdoc) 38 | * @see halo_IViewFactory::buildView() 39 | */ 40 | public function buildView($viewUri, $viewName, halo_HttpRequest $httpRequest, halo_HttpResponse $httpResponse) { 41 | return new halo_view_skittle_SkittleResourceLocatorView($viewUri, $this->substrateResourceLocatorAdapter); 42 | } 43 | 44 | } -------------------------------------------------------------------------------- /vendors/substrate-php/substrate_stones_factory_NoSuchStoneDefinitionException.php: -------------------------------------------------------------------------------- 1 | stoneName = $stoneName; 38 | $this->type = $type; 39 | } 40 | 41 | /** 42 | * Name of the missing stone 43 | * @return string 44 | */ 45 | public function stoneName() { return $this->stoneName; } 46 | 47 | /** 48 | * String representing the type of the missing stone 49 | * @return string 50 | */ 51 | public function type() { return $this->type; } 52 | 53 | } -------------------------------------------------------------------------------- /vendors/halo-php/halo_view_ViewFactoryResourceViewResolver.php: -------------------------------------------------------------------------------- 1 | viewFactory = $viewFactory; 23 | } 24 | 25 | /** 26 | * Resolve the view (conditionally) 27 | * 28 | * Checks the underlying halo_IViewFactory by way of supports() to see 29 | * if the view built by the factory will support the view request. If it 30 | * does support it, the factory will build a view. If not, null is returned. 31 | * 32 | * This view resolver is safe to use if view resolver chaining is desired 33 | * since it may return null in some cases. 34 | * 35 | * @param $viewUri 36 | * @param $viewName 37 | * @param $httpRequest 38 | * @param $httpResponse 39 | */ 40 | public function doResolveViewUri($viewUri, $viewName, halo_HttpRequest $httpRequest, halo_HttpResponse $httpResponse) { 41 | if ( $this->viewFactory->supports($viewUri, $viewName, $httpRequest, $httpResponse) ) { 42 | return $this->viewFactory->buildView($viewUri, $viewName, $httpRequest, $httpResponse); 43 | } 44 | return null; 45 | } 46 | 47 | } -------------------------------------------------------------------------------- /vendors/halo-php/halo_view_skittle_AbstractSkittleView.php: -------------------------------------------------------------------------------- 1 | instantiate($model, $httpRequest, $httpResponse); 21 | if ( $this->helperMapping ) { 22 | $skittle->addHelperMapping(new halo_helper_skittle_SkittleHelperMappingAdapter($this->helperMapping)); 23 | } 24 | if ( $this->helperNames ) { 25 | foreach ( $this->helperNames as $helperName ) { 26 | $skittle->addHelper($helperName); 27 | } 28 | } 29 | return $skittle->stringInc($this->uri, $model); 30 | } 31 | 32 | public function setRegisteredHelperNames(array $helperNames = null) { 33 | $this->helperNames = $helperNames; 34 | } 35 | 36 | public function setHelperMapping(halo_IHelperMapping $helperMapping) { 37 | $this->helperMapping = $helperMapping; 38 | } 39 | 40 | abstract public function instantiate(array $model, halo_HttpRequest $httpRequest, halo_HttpResponse $httpResponse); 41 | 42 | } -------------------------------------------------------------------------------- /vendors/substrate-php/substrate_stones_factory_StoneNotOfRequiredTypeException.php: -------------------------------------------------------------------------------- 1 | stoneName = $stoneName; 37 | $this->requiredType = $requiredType; 38 | $this->actualType = $actualType; 39 | } 40 | 41 | /** 42 | * Name of stone 43 | * @return string 44 | */ 45 | public function stoneName() { return $this->stoneName; } 46 | 47 | /** 48 | * String representing the required type of the found stone 49 | * @return string 50 | */ 51 | public function requiredType() { return $this->requiredType; } 52 | 53 | /** 54 | * String representing the actual type of the found stone 55 | * @return string 56 | */ 57 | public function actualType() { return $this->actualType; } 58 | 59 | } -------------------------------------------------------------------------------- /vendors/dd-configuration-php/dd_configuration_AbstractConfiguration.php: -------------------------------------------------------------------------------- 1 | resolver === null ) { 43 | $this->resolver = new dd_configuration_Resolver($this); 44 | } 45 | return $this->resolver; 46 | } 47 | 48 | /** 49 | * Import another configuration 50 | * @param mixed $input dd_configuration_IConfiguration or array 51 | */ 52 | public function import($configuration) { 53 | if ( ! is_array($configuration) ) { 54 | $configuration = array($configuration); 55 | } 56 | foreach ( $configuration as $item ) { 57 | if ( ! dd_configuration_Util::IMPORT($this, $item) ) { 58 | return false; 59 | } 60 | } 61 | return true; 62 | } 63 | 64 | } 65 | 66 | ?> 67 | -------------------------------------------------------------------------------- /vendors/lithe-php/lithe_ControllerHandlerAdapter.php: -------------------------------------------------------------------------------- 1 | setHttpRequestAndResponse($httpRequest, $httpResponse); 39 | } 40 | 41 | if ( is_assoc($uriParams) ) { $args[] = $uriParams; } 42 | else { $args = $uriParams; } 43 | 44 | $rv = call_user_func_array(array($handler, $method), $args); 45 | 46 | if ( $rv and $rv instanceof halo_ModelAndView ) { 47 | return $rv; 48 | } 49 | 50 | if ( $handler instanceof lithe_Controller ) { 51 | return $handler->generateHaloModelAndView(); 52 | } 53 | 54 | return $rv; 55 | 56 | } 57 | 58 | } 59 | -------------------------------------------------------------------------------- /vendors/dd-logging-php/dd_logging_LogFactory.php: -------------------------------------------------------------------------------- 1 | 0 ) { array_shift($args); } 59 | $reflectionObject = new ReflectionClass($className); 60 | return $reflectionObject->newInstanceArgs($args); 61 | } 62 | 63 | } 64 | 65 | ?> 66 | -------------------------------------------------------------------------------- /bootstraps/bootstrap.php: -------------------------------------------------------------------------------- 1 | 97 | -------------------------------------------------------------------------------- /vendors/halo-php/halo_helper_UriHelperFactory.php: -------------------------------------------------------------------------------- 1 | uriConfiguration = $uriConfiguration; 41 | } 42 | 43 | public function setPrefix($prefix) { 44 | $this->prefix = $prefix; 45 | } 46 | 47 | public function setBaseSuffix($baseSuffix) { 48 | $this->baseSuffix = $baseSuffix; 49 | } 50 | 51 | public function setSecureBaseSuffix($secureBaseSuffix) { 52 | $this->secureBaseSuffix = $secureBaseSuffix; 53 | } 54 | 55 | public function supports($name) { 56 | return $name == 'uri'; 57 | } 58 | 59 | public function helper($name, halo_HttpRequest $httpRequest, halo_HttpResponse $httpResponse) { 60 | $uri = new halo_helper_UriHelper( 61 | $this->uriConfiguration, 62 | $httpRequest->scriptPathRoot(), 63 | true, 64 | $httpRequest->envExport() 65 | ); 66 | if ( $this->prefix ) $uri->setPrefix($this->prefix); 67 | if ( $this->baseSuffix ) $uri->setBaseSuffix($this->baseSuffix); 68 | if ( $this->secureBaseSuffix ) $uri->setSecureBaseSuffix($this->secureBaseSuffix); 69 | return $uri; 70 | } 71 | 72 | } 73 | -------------------------------------------------------------------------------- /vendors/halo-php/halo_helper_UriHelper.php: -------------------------------------------------------------------------------- 1 | configuration = $configuration; 29 | $this->pathMatcher = $pathMatcher; 30 | } 31 | 32 | /** 33 | * Informed that the context has started 34 | * @param $context 35 | */ 36 | public function informAboutContextStartup(substrate_Context $context) { 37 | if ( $this->pathMatcher === null ) { 38 | require_once('substrate_util_AntPathMatcher.php'); 39 | $this->pathMatcher = new substrate_util_AntPathMatcher(); 40 | } 41 | } 42 | 43 | /** 44 | * Set the configuration instances 45 | * @param $configuration 46 | */ 47 | public function setConfiguration(dd_configuration_IConfiguration $configuration) { 48 | $this->configuration = $configuration; 49 | } 50 | 51 | /** 52 | * Set the PathMatcher implementation to use for matching URL paths 53 | * against registered URL patterns. Default is halo_AntPathMatcher. 54 | * @see halo_AntPathMatcher 55 | */ 56 | public function setPathMatcher(halo_IPathMatcher $pathMatcher) { 57 | $this->pathMatcher = $pathMatcher; 58 | } 59 | 60 | /** 61 | * (non-PHPdoc) 62 | * @see halo_mvc_multiaction_IMethodNameResolver::getHandlerMethodName() 63 | */ 64 | public function getHandlerMethodName(halo_HttpRequest $request){ 65 | $uriPath = $request->getRequestedUri(); 66 | if ( $this->configuration->exists($uriPath) ) { 67 | return $this->configuration->get($uriPath); 68 | } 69 | 70 | foreach ($this->configuration->keys() as $key ) { 71 | if ($this->pathMatcher->match($key, $uriPath)) { 72 | return $this->configuration->get($key); 73 | } 74 | } 75 | } 76 | 77 | } -------------------------------------------------------------------------------- /vendors/substrate-php/substrate_AbstractClassLoader.php: -------------------------------------------------------------------------------- 1 | templateCallbacks = $templateCallbacks; 29 | } else { 30 | $this->templateCallbacks = array( 31 | array('substrate_AbstractClassLoader', 'SIMPLE_CLASS_TEMPLATE'), 32 | ); 33 | } 34 | } 35 | 36 | /** 37 | * Load a class 38 | * @param $className 39 | * @param $includeFilename 40 | */ 41 | public function load($className, $includeFilename = null) { 42 | if ( class_exists($className) ) return true; 43 | if ( isset($this->loadAttemptedLocally[$className]) ) return false; 44 | $this->loadAttemptedLocally[$className] = true; 45 | if ( $includeFilename !== null ) { 46 | // If an include filename was specified, we'll 47 | // just assume that is what we are looking for. 48 | require_once($includeFilename); 49 | return true; 50 | } 51 | foreach ( $this->potentialIncludeFilenames($className) as $includeFilename ) { 52 | if ( $fullIncludePath = $this->find($includeFilename) ) { 53 | require_once($fullIncludePath); 54 | return true; 55 | } 56 | } 57 | return false; 58 | } 59 | 60 | /** 61 | * Determine potential include filenames for the specified class name 62 | * @param $className 63 | */ 64 | public function potentialIncludeFilenames($className) { 65 | $potentialIncludeFilenames = array(); 66 | foreach ( $this->templateCallbacks as $callback ) { 67 | $potentialIncludeFilenames[] = call_user_func($callback, $className); 68 | } 69 | return $potentialIncludeFilenames; 70 | } 71 | 72 | /** 73 | * Leave the finding of the class filename up to subclasses 74 | * @param $classFileName 75 | */ 76 | abstract public function find($classFileName); 77 | 78 | } 79 | 80 | ?> -------------------------------------------------------------------------------- /vendors/dd-core-php/dd_core_AbstractClassLoader.php: -------------------------------------------------------------------------------- 1 | templateCallbacks = $templateCallbacks; 29 | } else { 30 | $this->templateCallbacks = array( 31 | // TODO Figure out a better way to handle this 32 | array('dd_core_AbstractClassLoader', 'SIMPLE_CLASS_TEMPLATE'), 33 | ); 34 | } 35 | } 36 | 37 | /** 38 | * Load a class 39 | * @param $className 40 | * @param $includeFilename 41 | */ 42 | public function load($className, $includeFilename = null) { 43 | if ( class_exists($className) ) return true; 44 | if ( isset($this->loadAttemptedLocally[$className]) ) return false; 45 | $this->loadAttemptedLocally[$className] = true; 46 | if ( $includeFilename !== null ) { 47 | // If an include filename was specified, we'll 48 | // just assume that is what we are looking for. 49 | require_once($includeFilename); 50 | return true; 51 | } 52 | foreach ( $this->potentialIncludeFilenames($className) as $includeFilename ) { 53 | if ( $fullIncludePath = $this->find($includeFilename) ) { 54 | require_once($fullIncludePath); 55 | return true; 56 | } 57 | } 58 | return false; 59 | } 60 | 61 | /** 62 | * Determine potential include filenames for the specified class name 63 | * @param $className 64 | */ 65 | public function potentialIncludeFilenames($className) { 66 | $potentialIncludeFilenames = array(); 67 | foreach ( $this->templateCallbacks as $callback ) { 68 | $potentialIncludeFilenames[] = call_user_func($callback, $className); 69 | } 70 | return $potentialIncludeFilenames; 71 | } 72 | 73 | /** 74 | * Leave the finding of the class filename up to subclasses 75 | * @param $classFileName 76 | */ 77 | abstract public function find($classFileName); 78 | 79 | } 80 | -------------------------------------------------------------------------------- /vendors/halo-php/halo_mvc_multiaction_ParameterMethodNameResolver.php: -------------------------------------------------------------------------------- 1 | paramName = $paramName; 33 | $this->methodParamNames = $methodParamNames; 34 | } 35 | 36 | /** 37 | * Set the param name 38 | * @param $paramName 39 | */ 40 | public function setParamName($paramName) { 41 | $this->paramName = $paramName; 42 | } 43 | 44 | /** 45 | * Set the param names 46 | * @param $methodParamNames 47 | */ 48 | public function setMethodParamNames(Array $methodParamNames) { 49 | $this->methodParamNames = $methodParamNames; 50 | } 51 | 52 | /** 53 | * (non-PHPdoc) 54 | * @see halo_mvc_multiaction_IMethodNameResolver::getHandlerMethodName() 55 | */ 56 | public function getHandlerMethodName(halo_HttpRequest $request) { 57 | 58 | $methodName = ''; 59 | 60 | if ($this->methodParamNames !== null) { 61 | foreach ($this->methodParamNames as $variable) { 62 | if($request->queryParam($variable) !== null){ 63 | $methodNamme = $request->queryParam($variable); 64 | break; 65 | } 66 | } 67 | } 68 | 69 | if ($methodName === null && $this->paramName !== null) { 70 | $methodName = $request->queryParam($this->paramName); 71 | } 72 | 73 | if ($methodName !== null && $methodName === "") { 74 | $methodName = null; 75 | } 76 | 77 | if ($methodName === null) { 78 | if ($this->defaultMethodName !== null) { 79 | $methodName = $this->defaultMethodName; 80 | } 81 | else { 82 | throw new Exception('Handler method, not found'); 83 | } 84 | } 85 | 86 | return $methodName; 87 | 88 | } 89 | 90 | } -------------------------------------------------------------------------------- /vendors/dd-uri-php/dd_uri_UriConfiguration.php: -------------------------------------------------------------------------------- 1 | configuration = $configuration; 38 | $this->prefix = self::$DEFAULT_KEY_PREFIX; 39 | $this->baseSuffix = self::$DEFAULT_KEY_BASE_SUFFIX; 40 | $this->secureBaseSuffix = self::$DEFAULT_KEY_SECURE_BASE_SUFFIX; 41 | } 42 | 43 | /** 44 | * Get the name for the underlying configuration 45 | * 46 | * Convenience method 47 | * @param string $name 48 | */ 49 | protected function get($name) { 50 | return $this->configuration->get($name); 51 | } 52 | 53 | /** 54 | * See if the name exists int he underlying configuration 55 | * @param $name 56 | */ 57 | protected function exists($name) { 58 | return $this->configuration->exists($name); 59 | } 60 | 61 | /** 62 | * Get the base value 63 | * @param $secure 64 | */ 65 | public function getBase($secure = null) { 66 | return $this->getSiteBase($this->get($this->prefix . 'defaultSite'), $secure); 67 | } 68 | 69 | /** 70 | * Get the base value for a site 71 | * @param $site 72 | * @param $secure 73 | */ 74 | public function getSiteBase($site, $secure = null) { 75 | if ( $secure === null ) { 76 | if ( isset($_SERVER['HTTPS']) and strtolower($_SERVER['HTTPS']) == 'on' ) { 77 | $secure = true; 78 | } else { 79 | $secure = false; 80 | } 81 | } 82 | $baseKey = $this->prefix . $site . $this->baseSuffix; 83 | $secureBaseKey = $this->prefix . $site . $this->secureBaseSuffix; 84 | if ( $secure === false and $this->exists($baseKey) ) { 85 | return $this->get($baseKey); 86 | } elseif ( $secure === true and $this->exists($secureBaseKey) ) { 87 | return $this->get($secureBaseKey); 88 | } 89 | return null; 90 | } 91 | 92 | } 93 | 94 | -------------------------------------------------------------------------------- /vendors/halo-php/halo_handler_SimpleUriHandlerMapping.php: -------------------------------------------------------------------------------- 1 | mappings = $mappings; 44 | $this->default = $default; 45 | if ( $default !== null ) { 46 | $this->useDefault = true; 47 | } else { 48 | $this->useDefault = false; 49 | } 50 | $this->pathMatcher = $pathMatcher; 51 | } 52 | 53 | /** 54 | * Get the actual handler 55 | * @param $httpRequest 56 | */ 57 | protected function getHandlerInternal(halo_HttpRequest $httpRequest) { 58 | $uri = $httpRequest->requestedUri(); 59 | if ($this->useDefault and ($uri === null or $uri === '' or $uri === '/') and $this->default !== null) { 60 | return $this->context->get($this->default); 61 | } 62 | if ( isset($this->registeredHandlers[$uri]) ) { 63 | return $this->context->get($this->registeredHandlers[$uri]); 64 | } 65 | foreach ($this->registeredHandlers as $key => $value) { 66 | if ($this->pathMatcher->match($key, $uri)) { 67 | return $this->context->get($value); 68 | } 69 | } 70 | if ( self::$LOGGER->isInfoEnabled() ) { 71 | self::$LOGGER->info('Unable to handle request for URI: [' . $uri . ']'); 72 | } 73 | return null; 74 | } 75 | 76 | /** 77 | * Register the handlers 78 | */ 79 | protected function registerHandlers() { 80 | foreach ( $this->mappings as $uri => $objectName ) { 81 | $this->registerHandler($uri, $objectName); 82 | } 83 | } 84 | 85 | /** 86 | * Set the path matcher 87 | * @param substrate_util_IPathMatcher $pathMatcher 88 | */ 89 | public function setPathMatcher(substrate_util_IPathMatcher $pathMatcher) { 90 | $this->pathMatcher = $pathMatcher; 91 | } 92 | 93 | } 94 | 95 | halo_handler_SimpleUriHandlerMapping::$LOGGER = dd_logging_LogFactory::get('halo_handler_SimpleUriHandlerMapping'); 96 | -------------------------------------------------------------------------------- /vendors/dd-configuration-php/dd_configuration_PropertiesConfiguration.php: -------------------------------------------------------------------------------- 1 | resourceLoader = new dd_configuration_ClasspathResourceLoader( 37 | isset($trace[0]['file']) ? $trace[0]['file'] : null 38 | ); 39 | } 40 | else $this->resourceLoader = $resourceLoader; 41 | 42 | if ( $locations !== null ) $this->addLocations($locations); 43 | 44 | } 45 | 46 | /** 47 | * Add properties file locations 48 | * 49 | * May accept a string specifying location or an array containing 50 | * multiple location strings. This is the most flexible way to 51 | * add locations. 52 | * 53 | * @param mixed $locations Locations 54 | */ 55 | public function addLocations($locations = null) { 56 | 57 | if ( $locations !== null ) { 58 | if ( ! is_array($locations) ) $locations = array($locations); 59 | foreach ( $locations as $location ) { 60 | $this->addLocation($location); 61 | } 62 | } 63 | 64 | } 65 | 66 | /** 67 | * Add a properties file location 68 | * 69 | * Requires passed value to be a location string. 70 | * 71 | * @param string $location Location 72 | */ 73 | public function addLocation($location) { 74 | 75 | if ( is_array($location) ) throw new Exception('Cannot specify location as an array'); 76 | 77 | $path = $this->resourceLoader->find($location); 78 | 79 | if ( $path !== null ) { 80 | 81 | $this->locations[] = $path; 82 | 83 | $content = file_get_contents($path); 84 | 85 | foreach ( explode("\n", $content) as $line ) { 86 | 87 | preg_match('/^\s*([^=]+?)\s*=\s*(.+?)\s*$/', $line, $matches); 88 | 89 | if ( count($matches) > 1 && strlen($matches[1]) > 0 && strpos($matches[1], '#') !== 0) { 90 | $this->map[$matches[1]] = $matches[2]; 91 | } 92 | 93 | } 94 | 95 | } 96 | 97 | } 98 | 99 | } 100 | 101 | ?> 102 | -------------------------------------------------------------------------------- /vendors/lithe-php/lithe_Controller.php: -------------------------------------------------------------------------------- 1 | isDebugEnabled() ) { 73 | self::$LOGGER->debug('In constructor.'); 74 | } 75 | $this->model = $this->data = new lithe_Model(); 76 | } 77 | 78 | /** 79 | * Inform controller about Substrate context 80 | * @param $context 81 | */ 82 | public function informAboutContext(substrate_Context $context) { 83 | if ( self::$LOGGER->isDebugEnabled() ) { 84 | self::$LOGGER->debug('Informed of Substrate context startup.'); 85 | } 86 | $this->context = $context; 87 | } 88 | 89 | /** 90 | * Generate Halo's Model and View 91 | * @return halo_ModelAndView 92 | */ 93 | public function generateHaloModelAndView() { 94 | if ( $this->redirect ) { 95 | header('Location: ' . $this->redirect); 96 | return null; 97 | } 98 | $this->model->set('baseUri', $this->httpRequest->scriptPathRoot()); 99 | return new halo_ModelAndView($this->view ? $this->view : $this->defaultView, $this->model->export()); 100 | } 101 | 102 | /** 103 | * Set Halo's HTTP Request and HTTP Response objects 104 | * @param $httpRequest 105 | * @param $httpResponse 106 | */ 107 | public function setHttpRequestAndResponse(halo_HttpRequest $httpRequest, halo_HttpResponse $httpResponse) { 108 | $this->httpRequest = $httpRequest; 109 | $this->httpResponse = $httpResponse; 110 | } 111 | 112 | public function helper($name) { 113 | halo_HelperUtil::REGISTER_HELPER_NAME($this->httpRequest, $name); 114 | return halo_HelperUtil::MANAGER( 115 | $this->httpRequest, 116 | $this->httpResponse 117 | )->helper($name); 118 | } 119 | 120 | } 121 | 122 | lithe_Controller::$LOGGER = dd_logging_LogFactory::get('lithe_Controller'); 123 | -------------------------------------------------------------------------------- /vendors/lithe-php/lithe_base.context.php: -------------------------------------------------------------------------------- 1 | import('halo_base.context.php'); 4 | 5 | /** 6 | * Lithe dispatcher 7 | * 8 | * The Lithe dispatcher is (currently) nothing special. 9 | * 10 | * It just masks Halo so "Lithe" users can be blissfully 11 | * unaware of Halo if they choose to be. 12 | */ 13 | $context->add('lithe.dispatcher', array( 14 | 'parent' => 'halo.dispatcher', 15 | )); 16 | 17 | /** 18 | * Lithe controller handler adapter 19 | */ 20 | $context->add('lithe.handlers.controllerHandlerAdapter', array( 21 | 'className' => 'lithe_ControllerHandlerAdapter', 22 | )); 23 | 24 | /** 25 | * Class loader for Lithe controllers 26 | */ 27 | $context->add('lithe.controllers.classLoader', array( 28 | 'className' => 'substrate_ResourceLocatorClassLoader', 29 | 'constructorArgs' => array( 30 | 'resourceLocator' => $context->ref('lithe.controllers.resourceLocator'), 31 | ), 32 | )); 33 | 34 | /** 35 | * Default handler mapping 36 | */ 37 | $context->add('lithe.handlers.defaultHandlerMapping', array( 38 | 'className' => 'lithe_BasicHandlerMapping', 39 | 'constructorArgs' => array( 40 | 'configuration' => $context->ref('lithe.controllers.configuration'), 41 | 'classLoader' => $context->ref('lithe.controllers.classLoader'), 42 | ), 43 | 'dependencies' => array( 44 | 'lithe.handlers.controllerHandlerAdapter', 45 | ), 46 | )); 47 | 48 | /** 49 | * Default parent controller 50 | */ 51 | $context->add('lithe.controllers.defaultParentController', array( 52 | 'className' => 'lithe_AbstractEmptyController', 53 | 'abstract' => true, 54 | )); 55 | 56 | /** 57 | * Lithe default view resolver 58 | */ 59 | $context->add('lithe.views.defaultViewResolver', array( 60 | 'className' => 'halo_view_ViewFactoryResourceViewResolver', 61 | 'constructorArgs' => array( 62 | 'viewFactory' => $context->ref('${lithe.views.default.viewFactoryStone}'), 63 | ), 64 | 'properties' => array( 65 | 'suffix' => '${lithe.views.default.suffix}', 66 | ), 67 | )); 68 | 69 | /** 70 | * Skittle view factory 71 | */ 72 | $context->add('lithe.views.skittle.viewFactory', array( 73 | 'className' => 'halo_view_skittle_SkittleViewFactory', 74 | 'constructorArgs' => array( 75 | 'resourceLocator' => $context->ref('lithe.views.resourceLocator'), 76 | ), 77 | )); 78 | 79 | /** 80 | * Configuration Helper Factory 81 | * 82 | * This gets us a URI helper that we can use to generate absolute 83 | * and cross site URIs. 84 | */ 85 | $context->add('lithe.helpers.configurationHelperFactory', array( 86 | 'className' => 'halo_helper_ConfigurationHelperFactory', 87 | 'constructorArgs' => array( 88 | 'configuration' => $context->ref('configuration'), 89 | ), 90 | 'lazyLoad' => false, 91 | )); 92 | 93 | /** 94 | * URI Helper Factory 95 | * 96 | * This gets us a URI helper that we can use to generate absolute 97 | * and cross site URIs. 98 | */ 99 | $context->add('lithe.helpers.uriHelperFactory', array( 100 | 'className' => 'halo_helper_UriHelperFactory', 101 | 'constructorArgs' => array( 102 | 'uriConfiguration' => $context->ref('lithe.uriConfiguration'), 103 | ), 104 | 'lazyLoad' => false, 105 | )); 106 | 107 | /** 108 | * URI Configuration 109 | * 110 | * We default to our app configuration instance. 111 | */ 112 | $context->set('lithe.uriConfiguration', array( 113 | 'className' => 'dd_uri_UriConfiguration', 114 | 'constructorArgs' => array( 115 | 'configuration' => $context->ref('configuration') 116 | ), 117 | )); 118 | -------------------------------------------------------------------------------- /vendors/halo-php/halo_HelperUtil.php: -------------------------------------------------------------------------------- 1 | attributeExists(self::$HELPER_MANAGER_KEY) ) { 28 | 29 | $context = halo_DispatcherUtil::GET_CONTEXT($httpRequest); 30 | 31 | $httpRequest->setAttribute( 32 | self::$HELPER_MANAGER_KEY, 33 | new halo_helper_CompositeRequestHelperMapping( 34 | $httpRequest, 35 | $httpResponse, 36 | $context->findStonesByImplementation('halo_IHelperMapping'), 37 | $context->findStonesByImplementation('halo_IHelperFactory'), 38 | $context->findStonesByImplementation('halo_IRequestHelperFactory') 39 | ) 40 | ); 41 | 42 | } 43 | 44 | return $httpRequest->attribute(self::$HELPER_MANAGER_KEY); 45 | 46 | } 47 | 48 | static public function PREPARE_VIEW(halo_IView $view, halo_HttpRequest $httpRequest, halo_HttpResponse $httpResponse) { 49 | 50 | if ( $view instanceof halo_IHelperMappingAware or $view instanceof halo_IRegisteredHelpersAware ) { 51 | 52 | $helperMapping = self::MANAGER($httpRequest, $httpResponse); 53 | 54 | if ( $view instanceof halo_IRegisteredHelpersAware ) { 55 | $view->setRegisteredHelpers(self::GET_REGISTERED_HELPERS($httpRequest, $helperMapping)); 56 | } 57 | 58 | if ( $view instanceof halo_IRegisteredHelperNamesAware ) { 59 | $view->setRegisteredHelperNames(self::GET_REGISTERED_HELPER_NAMES($httpRequest)); 60 | } 61 | 62 | if ( $view instanceof halo_IHelperMappingAware ) { 63 | $view->setHelperMapping($helperMapping); 64 | } 65 | 66 | } 67 | 68 | } 69 | 70 | public static function GET_REGISTERED_HELPER_NAMES(halo_HttpRequest $httpRequest) { 71 | return $httpRequest->attributeExists(self::$REGISTERED_HELPER_NAMES_KEY) ? 72 | $httpRequest->attribute(self::$REGISTERED_HELPER_NAMES_KEY) : array(); 73 | } 74 | 75 | public static function GET_REGISTERED_HELPERS(halo_HttpRequest $httpRequest, halo_IHelperMapping $helperMapping) { 76 | $helpers = array(); 77 | foreach ( self::GET_REGISTERED_HELPER_NAMES($httpRequest) as $helperName ) { 78 | $helpers[] = $helperMapping->helper($helperName); 79 | } 80 | return $helpers; 81 | } 82 | 83 | public static function REGISTER_HELPER_NAME(halo_HttpRequest $httpRequest, $name) { 84 | $helperNames = self::GET_REGISTERED_HELPER_NAMES($httpRequest); 85 | $helperNames[] = $name; 86 | $httpRequest->setAttribute(self::$REGISTERED_HELPER_NAMES_KEY, $helperNames); 87 | } 88 | 89 | } -------------------------------------------------------------------------------- /vendors/dd-configuration-php/dd_configuration_Resolver.php: -------------------------------------------------------------------------------- 1 | resolved) ) { 29 | $this->resolved[$key] = $this->resolveValue($configuration, $configuration->getRaw($key)); 30 | } 31 | return $this->resolved[$key]; 32 | } 33 | 34 | /** 35 | * Resolve a value 36 | * @param dd_configuration_IConfiguration $configuration Configuration 37 | * @param string $key Key 38 | * @return string 39 | */ 40 | public function resolveValue(dd_configuration_IConfiguration $configuration, $value) { 41 | 42 | $counter = 0; 43 | $resolverCallback = new dd_configuration_ResolverCallback( 44 | $configuration 45 | ); 46 | while ( true ) { 47 | 48 | $newValue = preg_replace_callback( 49 | '/\${([a-zA-Z0-9\.\(\)_\:]+?)}/', 50 | array($resolverCallback, 'resolveCallback'), 51 | $value 52 | ); 53 | 54 | if ( $newValue === $value ) { 55 | break; 56 | } 57 | 58 | $value = $newValue; 59 | 60 | // Break recursion if depth goes beyond 10! 61 | // TODO Make this configurable? 62 | if ( $counter++ > 10 ) break; 63 | 64 | } 65 | 66 | return $value; 67 | 68 | } 69 | 70 | } 71 | 72 | /** 73 | * Configuration Resolver Callback. 74 | * @package dd_configuration 75 | */ 76 | class dd_configuration_ResolverCallback { 77 | 78 | /** 79 | * Configuration 80 | * @var dd_configuration_IConfiguration 81 | */ 82 | protected $configuration; 83 | 84 | /** 85 | * Constructor 86 | * @param dd_configuration_IConfiguration $configuration Configuration 87 | */ 88 | public function __construct(dd_configuration_IConfiguration $configuration) { 89 | $this->configuration = $configuration; 90 | } 91 | 92 | /** 93 | * preg_replace_callback Callback. 94 | * @param array $matches Matches 95 | */ 96 | public function resolveCallback($matches) { 97 | $key = $matches[1]; 98 | if ( preg_match('/^(ENV|SERVER|CONSTANT):(\w+)$/', $key, $special) ) { 99 | list($whole, $which, $key) = $special; 100 | if ( $which == 'ENV' ) { 101 | if ( array_key_exists($key, $_ENV) ) { 102 | return $_ENV[$key]; 103 | } 104 | } elseif ( $which == 'SERVER' ) { 105 | if ( array_key_exists($key, $_SERVER) ) { 106 | return $_SERVER[$key]; 107 | } 108 | } elseif ( $which == 'CONSTANT' ) { 109 | if ( defined($key) ) { 110 | return constant($key); 111 | } 112 | } 113 | } 114 | if ( $this->configuration->exists($key) ) { 115 | return $this->configuration->get($key); 116 | } 117 | return $matches[0]; 118 | } 119 | 120 | } 121 | 122 | ?> 123 | -------------------------------------------------------------------------------- /vendors/halo-php/halo_helper_CompositeRequestHelperMapping.php: -------------------------------------------------------------------------------- 1 | httpRequest = $httpRequest; 14 | $this->httpResponse = $httpResponse; 15 | $this->mappings = $mappings; 16 | $this->factories = $factories; 17 | $this->requestFactories = $requestFactories; 18 | } 19 | 20 | public function supports($name) { 21 | 22 | if ( array_key_exists($name, $this->found) ) { 23 | return is_array($this->found[$name]) ? true : false; 24 | } 25 | 26 | // First check the mappings. 27 | foreach ( $this->mappings as $mappingIdx => $mapping ) { 28 | if ( $mapping->supports($name) ) { 29 | $this->found[$name] = array('mapping', $mappingIdx); 30 | return true; 31 | } 32 | } 33 | 34 | // Next check the factories. 35 | foreach ( $this->factories as $factoriesIdx => $factory ) { 36 | if ( $factory->supports($name) ) { 37 | $this->found[$name] = array('factory', $factoriesIdx); 38 | return true; 39 | } 40 | } 41 | 42 | // Next check the request factories. 43 | foreach ( $this->requestFactories as $requestFactoriesIdx => $requestFactory ) { 44 | if ( $requestFactory->supports($name) ) { 45 | $this->found[$name] = array('requestFactory', $requestFactoriesIdx); 46 | return true; 47 | } 48 | } 49 | 50 | return false; 51 | } 52 | 53 | public function helper($name) { 54 | 55 | if ( isset($this->instance[$name]) ) { 56 | return $this->instance[$name]; 57 | } 58 | 59 | $value = $this->internalHelper($name); 60 | 61 | if ( $value !== null ) { 62 | $this->instance[$name] = $value; 63 | } 64 | 65 | return $value; 66 | 67 | } 68 | 69 | public function internalHelper($name) { 70 | 71 | if ( ! $this->supports($name) ) { return null; } 72 | 73 | list($type, $idx) = $this->found[$name]; 74 | 75 | switch($type) { 76 | 77 | case 'mapping': 78 | $mapping = $this->mappings[$idx]; 79 | $helper = $mapping->helper($name); 80 | if ( $helper instanceof halo_helper_IRequestHelperFactory ) { 81 | // The mapper passed back a request helper factory. 82 | return $helper->helper($name, $this->httpRequest, $this->httpResponse); 83 | } 84 | if ( $helper instanceof halo_helper_IHelperFactory ) { 85 | // The mapper passed back a helper factory. 86 | return $helper->helper($name); 87 | } 88 | return $helper; 89 | break; 90 | 91 | case 'factory': 92 | $factory = $this->factories[$idx]; 93 | return $factory->helper($name); 94 | break; 95 | 96 | case 'requestFactory': 97 | $requestFactory = $this->requestFactories[$idx]; 98 | return $requestFactory->helper($name, $this->httpRequest, $this->httpResponse); 99 | break; 100 | 101 | default: 102 | return null; 103 | break; 104 | 105 | } 106 | 107 | } 108 | 109 | } -------------------------------------------------------------------------------- /vendors/halo-php/halo_mvc_multiaction_MultiActionController.php: -------------------------------------------------------------------------------- 1 | methodNameResolver = $methodNameResolver; 30 | $this->delegate = $delegate === null ? $this : $delegate; 31 | } 32 | 33 | /** 34 | * (non-PHPdoc) 35 | * @see halo_mvc_IController::handleRequest() 36 | */ 37 | public function handleRequest(halo_HttpRequest $request, halo_HttpResponse $response){ 38 | $methodName = $this->methodNameResolver->getHandlerMethodName($request); 39 | return $this->invokeNamedMethod($methodName, $request, $response); 40 | } 41 | 42 | public function setDelegate($delegate) { 43 | $this->delegate = $delegate; 44 | } 45 | 46 | public function setMethodNameResolver(halo_mvc_multiaction_IMethodNameResolver $methodNameResolver) { 47 | $this->methodNameResolver = $methodNameResolver; 48 | } 49 | 50 | public function getMethodNameResolver() { 51 | return $this->methodNameResolver; 52 | } 53 | 54 | /** 55 | * Bind request parameters onto the given command stone 56 | * @param $request 57 | * @param $object 58 | */ 59 | public function bind(halo_HttpRequest $request, $object){ 60 | $reflectionClass = new ReflectionClass(get_class($object)); 61 | 62 | foreach ($request->getParameterNames() as $param) { 63 | $props = explode(".",$param); 64 | $value = $object; 65 | for ($index = 0; $index <= count($props)-2; $index++) { 66 | $prop = 'get'.ucfirst($props[$index]); 67 | if(method_exists($value , $prop)){ 68 | $value = $value->$prop(); 69 | } else { 70 | break; 71 | } 72 | } 73 | 74 | $prop = 'set'.ucfirst($props[count($props)-1]); 75 | if(method_exists($value , $prop)){ 76 | $value->$prop($request->getParameter($param)); 77 | $prop = 'get'.ucfirst($props[count($props)-1]); 78 | } 79 | } 80 | } 81 | 82 | /** 83 | * Invoke the method name on the delegate 84 | * @param string $methodName 85 | * @param halo_HttpRequest $request 86 | * @param halo_HttpResponse $response 87 | */ 88 | protected function invokeNamedMethod($methodName, halo_HttpRequest $request, halo_HttpResponse $response){ 89 | 90 | $method = new ReflectionMethod(get_class($this->delegate), $methodName); 91 | $parameters = $method->getParameters(); 92 | $params = Array(); 93 | $params[] = $request; 94 | $params[] = $response; 95 | 96 | if ($method->getNumberOfParameters() >= 3) { 97 | $commandReflectionClass = new ReflectionClass($parameters[2]->getClass()); 98 | $class = $parameters[2]->getClass()->getName(); 99 | $command = new $class; 100 | 101 | $this->bind($request, $command); 102 | $params[] = $command; 103 | } 104 | 105 | $returnValue = $method->invokeArgs($this->delegate, $params); 106 | return $returnValue; 107 | } 108 | 109 | } -------------------------------------------------------------------------------- /vendors/skittle-php/skittle_PathResourceLocator.php: -------------------------------------------------------------------------------- 1 | callingFile = $callingFile; 42 | } 43 | if ( $paths !== null ) { 44 | if ( ! is_array($paths) ) { 45 | $paths = array($paths); 46 | } 47 | foreach ( $paths as $path ) { 48 | $this->paths[] = $path; 49 | } 50 | } 51 | if ( $prependedPaths !== null ) { 52 | if ( ! is_array($prependedPaths) ) { 53 | $prependedPaths = array($prependedPaths); 54 | } 55 | foreach ( $prependedPaths as $path ) { 56 | $this->prependedPaths[] = $path; 57 | } 58 | } 59 | if ( $appendedPaths !== null ) { 60 | if ( ! is_array($appendedPaths) ) { 61 | $appendedPaths = array($appendedPaths); 62 | } 63 | foreach ( $appendedPaths as $path ) { 64 | $this->appendedPaths[] = $path; 65 | } 66 | } 67 | } 68 | 69 | /** 70 | * Find a target file 71 | * @param string $target Target 72 | * @return string 73 | */ 74 | public function find($target, $realPath = false) { 75 | 76 | if ( strpos($target, '/') === 0 ) { 77 | if ( file_exists($target) ) return $realPath ? realpath($target) : $target; 78 | return null; 79 | } 80 | 81 | foreach ( $this->allPaths() as $path ) { 82 | $testLocation = $path . '/' . $target; 83 | // TODO This could possibly be cached eventually. 84 | if ( file_exists($testLocation) ) return $realPath ? realpath($testLocation) : $testLocation; 85 | } 86 | 87 | // Could not be found. 88 | return null; 89 | 90 | } 91 | 92 | /** 93 | * Paths to search 94 | * @return array 95 | */ 96 | public function allPaths() { 97 | $callingFiles = array(); 98 | if ( $this->callingFile ) $callingFiles[] = dirname($this->callingFile); 99 | return array_merge( 100 | $callingFiles, 101 | $this->prependedPaths(), 102 | $this->paths(), 103 | $this->appendedPaths() 104 | ); 105 | 106 | } 107 | 108 | /** 109 | * Paths 110 | * @return array 111 | */ 112 | public function paths() { 113 | return $this->paths; 114 | } 115 | 116 | /** 117 | * Prepend a path to the classpath 118 | * @param string $path Path 119 | */ 120 | public function prependPath($path) { 121 | array_unshift($this->prependedPaths, $path); 122 | } 123 | 124 | /** 125 | * Append a path to the classpath 126 | * @param string $path Path 127 | */ 128 | public function appendPath($path) { 129 | push($this->appendedPaths, $path); 130 | } 131 | 132 | /** 133 | * Prepended paths 134 | * @return array 135 | */ 136 | public function prependedPaths() { 137 | return $this->prependedPaths; 138 | } 139 | 140 | /** 141 | * Appended paths 142 | * @return array 143 | */ 144 | public function appendedPaths() { 145 | return $this->appendedPaths; 146 | } 147 | 148 | } -------------------------------------------------------------------------------- /vendors/dd-core-php/dd_core_PathResourceLocator.php: -------------------------------------------------------------------------------- 1 | callingFile = $callingFile; 42 | } 43 | if ( $paths !== null ) { 44 | if ( ! is_array($paths) ) { 45 | $paths = array($paths); 46 | } 47 | foreach ( $paths as $path ) { 48 | $this->paths[] = $path; 49 | } 50 | } 51 | if ( $prependedPaths !== null ) { 52 | if ( ! is_array($prependedPaths) ) { 53 | $prependedPaths = array($prependedPaths); 54 | } 55 | foreach ( $prependedPaths as $path ) { 56 | $this->prependedPaths[] = $path; 57 | } 58 | } 59 | if ( $appendedPaths !== null ) { 60 | if ( ! is_array($appendedPaths) ) { 61 | $appendedPaths = array($appendedPaths); 62 | } 63 | foreach ( $appendedPaths as $path ) { 64 | $this->appendedPaths[] = $path; 65 | } 66 | } 67 | } 68 | 69 | /** 70 | * Find a target file 71 | * @param string $target Target 72 | * @return string 73 | */ 74 | public function find($target, $realPath = false) { 75 | 76 | if ( strpos($target, '/') === 0 ) { 77 | if ( file_exists($target) ) return $realPath ? realpath($target) : $target; 78 | return null; 79 | } 80 | 81 | foreach ( $this->allPaths() as $path ) { 82 | $testLocation = $path . '/' . $target; 83 | // TODO This could possibly be cached eventually. 84 | if ( file_exists($testLocation) ) return $realPath ? realpath($testLocation) : $testLocation; 85 | } 86 | 87 | // Could not be found. 88 | return null; 89 | 90 | } 91 | 92 | /** 93 | * Paths to search 94 | * @return array 95 | */ 96 | public function allPaths() { 97 | $callingFiles = array(); 98 | if ( $this->callingFile ) $callingFiles[] = dirname($this->callingFile); 99 | return array_merge( 100 | $callingFiles, 101 | $this->prependedPaths(), 102 | $this->paths(), 103 | $this->appendedPaths() 104 | ); 105 | 106 | } 107 | 108 | /** 109 | * Paths 110 | * @return array 111 | */ 112 | public function paths() { 113 | return $this->paths; 114 | } 115 | 116 | /** 117 | * Prepend a path to the classpath 118 | * @param string $path Path 119 | */ 120 | public function prependPath($path) { 121 | array_unshift($this->prependedPaths, $path); 122 | } 123 | 124 | /** 125 | * Append a path to the classpath 126 | * @param string $path Path 127 | */ 128 | public function appendPath($path) { 129 | push($this->appendedPaths, $path); 130 | } 131 | 132 | /** 133 | * Prepended paths 134 | * @return array 135 | */ 136 | public function prependedPaths() { 137 | return $this->prependedPaths; 138 | } 139 | 140 | /** 141 | * Appended paths 142 | * @return array 143 | */ 144 | public function appendedPaths() { 145 | return $this->appendedPaths; 146 | } 147 | 148 | } -------------------------------------------------------------------------------- /vendors/substrate-php/substrate_PathResourceLocator.php: -------------------------------------------------------------------------------- 1 | callingFile = $callingFile; 42 | } 43 | if ( $paths !== null ) { 44 | if ( ! is_array($paths) ) { 45 | $paths = array($paths); 46 | } 47 | foreach ( $paths as $path ) { 48 | $this->paths[] = $path; 49 | } 50 | } 51 | if ( $prependedPaths !== null ) { 52 | if ( ! is_array($prependedPaths) ) { 53 | $prependedPaths = array($prependedPaths); 54 | } 55 | foreach ( $prependedPaths as $path ) { 56 | $this->prependedPaths[] = $path; 57 | } 58 | } 59 | if ( $appendedPaths !== null ) { 60 | if ( ! is_array($appendedPaths) ) { 61 | $appendedPaths = array($appendedPaths); 62 | } 63 | foreach ( $appendedPaths as $path ) { 64 | $this->appendedPaths[] = $path; 65 | } 66 | } 67 | } 68 | 69 | /** 70 | * Find a target file 71 | * @param string $target Target 72 | * @return string 73 | */ 74 | public function find($target, $realPath = false) { 75 | 76 | if ( strpos($target, '/') === 0 ) { 77 | if ( file_exists($target) ) return $realPath ? realpath($target) : $target; 78 | return null; 79 | } 80 | 81 | foreach ( $this->allPaths() as $path ) { 82 | $testLocation = $path . '/' . $target; 83 | // TODO This could possibly be cached eventually. 84 | if ( file_exists($testLocation) ) return $realPath ? realpath($testLocation) : $testLocation; 85 | } 86 | 87 | // Could not be found. 88 | return null; 89 | 90 | } 91 | 92 | /** 93 | * Paths to search 94 | * @return array 95 | */ 96 | public function allPaths() { 97 | $callingFiles = array(); 98 | if ( $this->callingFile ) $callingFiles[] = dirname($this->callingFile); 99 | return array_merge( 100 | $callingFiles, 101 | $this->prependedPaths(), 102 | $this->paths(), 103 | $this->appendedPaths() 104 | ); 105 | 106 | } 107 | 108 | /** 109 | * Paths 110 | * @return array 111 | */ 112 | public function paths() { 113 | return $this->paths; 114 | } 115 | 116 | /** 117 | * Prepend a path to the classpath 118 | * @param string $path Path 119 | */ 120 | public function prependPath($path) { 121 | array_unshift($this->prependedPaths, $path); 122 | } 123 | 124 | /** 125 | * Append a path to the classpath 126 | * @param string $path Path 127 | */ 128 | public function appendPath($path) { 129 | push($this->appendedPaths, $path); 130 | } 131 | 132 | /** 133 | * Prepended paths 134 | * @return array 135 | */ 136 | public function prependedPaths() { 137 | return $this->prependedPaths; 138 | } 139 | 140 | /** 141 | * Appended paths 142 | * @return array 143 | */ 144 | public function appendedPaths() { 145 | return $this->appendedPaths; 146 | } 147 | 148 | } 149 | 150 | ?> -------------------------------------------------------------------------------- /vendors/dd-configuration-php/dd_configuration_PathResourceLoader.php: -------------------------------------------------------------------------------- 1 | callingFile = $callingFile; 51 | } 52 | if ( $paths !== null ) { 53 | if ( ! is_array($paths) ) { 54 | $paths = array($paths); 55 | } 56 | foreach ( $paths as $path ) { 57 | $this->paths[] = $path; 58 | } 59 | } 60 | if ( $prependedPaths !== null ) { 61 | if ( ! is_array($prependedPaths) ) { 62 | $prependedPaths = array($prependedPaths); 63 | } 64 | foreach ( $prependedPaths as $path ) { 65 | $this->prependedPaths[] = $path; 66 | } 67 | } 68 | if ( $appendedPaths !== null ) { 69 | if ( ! is_array($appendedPaths) ) { 70 | $appendedPaths = array($appendedPaths); 71 | } 72 | foreach ( $appendedPaths as $path ) { 73 | $this->appendedPaths[] = $path; 74 | } 75 | } 76 | } 77 | 78 | /** 79 | * Find the path for a location 80 | * @param string $location Location 81 | * @return string 82 | */ 83 | public function find($location) { 84 | 85 | if ( strpos($location, '/') === 0 ) { 86 | if ( file_exists($location) ) return $location; 87 | return null; 88 | } 89 | 90 | foreach ( $this->allPaths() as $path ) { 91 | $testLocation = $path . '/' . $location; 92 | // TODO This could possibly be cached eventually. 93 | if ( file_exists($testLocation) ) return $testLocation; 94 | } 95 | 96 | // Could not be found. 97 | return null; 98 | 99 | } 100 | 101 | /** 102 | * Paths to search 103 | * @return array 104 | */ 105 | public function allPaths() { 106 | 107 | $callingFiles = array(); 108 | if ( $this->callingFile ) $callingFiles[] = dirname($this->callingFile); 109 | 110 | return array_merge( 111 | $callingFiles, 112 | $this->prependedPaths(), 113 | $this->paths(), 114 | $this->appendedPaths() 115 | ); 116 | 117 | } 118 | 119 | /** 120 | * Paths 121 | * @return array 122 | */ 123 | public function paths() { 124 | return $this->paths; 125 | } 126 | 127 | /** 128 | * Prepend a path to the classpath 129 | * @param string $path Path 130 | */ 131 | public function prependPath($path) { 132 | array_unshift($this->prependedPaths, $path); 133 | } 134 | 135 | /** 136 | * Append a path to the classpath 137 | * @param string $path Path 138 | */ 139 | public function appendPath($path) { 140 | push($this->appendedPaths, $path); 141 | } 142 | 143 | /** 144 | * Prepended paths 145 | * @return array 146 | */ 147 | public function prependedPaths() { 148 | return $this->prependedPaths; 149 | } 150 | 151 | /** 152 | * Appended paths 153 | * @return array 154 | */ 155 | public function appendedPaths() { 156 | return $this->appendedPaths; 157 | } 158 | 159 | 160 | } 161 | 162 | ?> 163 | -------------------------------------------------------------------------------- /vendors/lithe-php/lithe_ContextUtil.php: -------------------------------------------------------------------------------- 1 | add('lithe.controllers.resourceLocator', array( 28 | 'className' => 'substrate_PathResourceLocator', 29 | 'constructorArgs' => array( 30 | 'paths' => $config['controllers'], 31 | ), 32 | )); 33 | } 34 | 35 | if ( isset($config['views']) ) { 36 | $context->add('lithe.views.resourceLocator', array( 37 | 'className' => 'substrate_PathResourceLocator', 38 | 'constructorArgs' => array( 39 | 'paths' => $config['views'], 40 | ), 41 | )); 42 | } 43 | 44 | } 45 | 46 | /** 47 | * Configure controller configuration 48 | * @param substrate_Context $context 49 | * @param array $paths 50 | */ 51 | static public function CONFIGURE_CONTROLLER_CONFIGURATION(substrate_Context $context, $paths) { 52 | $context->add('lithe.controllers.configuration', array( 53 | 'className' => 'dd_configuration_PropertiesConfiguration', 54 | 'constructorArgs' => array( 'locations' => $paths, ), 55 | )); 56 | } 57 | 58 | /** 59 | * Configure dependencies for the dispatcher 60 | * 61 | * Used to specify which stones should be initialized prior to the 62 | * dispatcher executing. 63 | * 64 | * @param substrate_Context $context 65 | * @param array $dependencies 66 | */ 67 | static public function CONFIGURE_DISPATCHER_DEPENDENCIES(substrate_Context $context, $dependencies = null) { 68 | 69 | if ( $dependencies and is_array($dependencies) ) { 70 | foreach ( $dependencies as $stoneName ) { 71 | $context->get($stoneName); 72 | } 73 | } 74 | 75 | } 76 | 77 | /** 78 | * Execute the dispatcher 79 | * @param substrate_Context $context 80 | * @param array $dependencies 81 | */ 82 | static public function DISPATCH(substrate_Context $context, $dependencies = null) { 83 | 84 | // Get the Lithe dispatcher 85 | $dispatcher = $context->get('lithe.dispatcher'); 86 | 87 | // Do the service. 88 | $dispatcher->doService( 89 | halo_DispatcherUtil::MAKE_HTTP_REQUEST($context), 90 | halo_DispatcherUtil::MAKE_HTTP_RESPONSE() 91 | ); 92 | 93 | } 94 | 95 | /** 96 | * Get the URI params from an HTTP Request. 97 | * @param halo_HttpRequest $httpRequest 98 | * @return substrate_Context 99 | */ 100 | public static function GET_URI_PARAMS(halo_HttpRequest $httpRequest) { 101 | return $httpRequest->attribute(self::$URI_PARAMS_CONTEXT_KEY); 102 | } 103 | 104 | /** 105 | * Set the URI params for an HTTP Request. 106 | * @param halo_HttpRequest $httpRequest 107 | * @param array 108 | */ 109 | public static function SET_URI_PARAMS(halo_HttpRequest $httpRequest, $uriParams) { 110 | return $httpRequest->setAttribute(self::$URI_PARAMS_CONTEXT_KEY, $uriParams); 111 | } 112 | 113 | /** 114 | * Get the controller method from an HTTP Request. 115 | * @param halo_HttpRequest $httpRequest 116 | * @return substrate_Context 117 | */ 118 | public static function GET_CONTROLLER_METHOD(halo_HttpRequest $httpRequest) { 119 | return $httpRequest->attribute(self::$CONTROLLER_METHOD_CONTEXT_KEY); 120 | } 121 | 122 | /** 123 | * Set the controller method for an HTTP Request. 124 | * @param halo_HttpRequest $httpRequest 125 | * @param string 126 | */ 127 | public static function SET_CONTROLLER_METHOD(halo_HttpRequest $httpRequest, $method) { 128 | return $httpRequest->setAttribute(self::$CONTROLLER_METHOD_CONTEXT_KEY, $method); 129 | } 130 | 131 | } 132 | -------------------------------------------------------------------------------- /vendors/dd-logging-php/dd_logging_AbstractLogger.php: -------------------------------------------------------------------------------- 1 | implementsInterface('dd_logging_ILogger') ) and 38 | $testClass !== 'ReflectionClass' and 39 | $testClass !== 'dd_logging_LogFactory' 40 | ) { 41 | $className = $testClass; 42 | break; 43 | } 44 | } 45 | } 46 | 47 | 48 | } 49 | $this->className = $className; 50 | $this->modifiedClassName = implode('.', explode('_', $this->className)); 51 | } 52 | 53 | 54 | protected static $LEVEL_NAMES = array( 55 | E_ERROR => 'E_ERROR', 56 | E_WARNING => 'E_WARNING', 57 | E_PARSE => 'E_PARSE', 58 | E_NOTICE => 'E_NOTICE', 59 | E_CORE_ERROR => 'E_CORE_ERROR', 60 | E_CORE_WARNING => 'E_CORE_WARNING', 61 | E_COMPILE_ERROR => 'E_COMPILE_ERROR', 62 | E_COMPILE_WARNING => 'E_COMPILE_WARNING', 63 | E_USER_ERROR => 'E_USER_ERROR', 64 | E_USER_WARNING => 'E_USER_WARNING', 65 | E_USER_NOTICE => 'E_USER_NOTICE', 66 | E_DEPRECATED => 'E_DEPRECATED', 67 | E_USER_DEPRECATED => 'E_USER_DEPRECATED', 68 | E_RECOVERABLE_ERROR => 'E_RECOVERABLE_ERROR', 69 | E_STRICT => 'E_STRICT', 70 | ); 71 | 72 | /** 73 | * (non-PHPdoc) 74 | * @see dd_logging_ILogger::handleException() 75 | */ 76 | public function handleException(Exception $e) { 77 | $this->error($e->getMessage()); 78 | foreach ( $e->getTrace() as $trace ) { 79 | $this->error($trace); 80 | } 81 | } 82 | 83 | /** 84 | * (non-PHPdoc) 85 | * @see dd_logging_ILogger::handleError() 86 | */ 87 | public function handleError($errno, $errstr, $errfile, $errline, $errcontext) { 88 | 89 | $message = '[' . self::$LEVEL_NAMES[$errno] . '] ' . $errstr . ' in ' . $errfile . ' at line ' . $errline; 90 | 91 | $die = false; 92 | $method = null; 93 | 94 | switch($errno) { 95 | 96 | case E_COMPILE_ERROR: 97 | case E_ERROR: 98 | case E_CORE_ERROR: 99 | case E_USER_ERROR: 100 | $method = 'fatal'; 101 | $die = true; 102 | break; 103 | 104 | case E_PARSE: 105 | 106 | $method = 'error'; 107 | $die = true; 108 | 109 | break; 110 | 111 | case E_WARNING: 112 | case E_CORE_WARNING: 113 | case E_COMPILE_WARNING: 114 | case E_USER_WARNING: 115 | 116 | $method = 'warn'; 117 | 118 | break; 119 | 120 | case E_NOTICE: 121 | case E_USER_NOTICE: 122 | 123 | $method = 'warn'; 124 | 125 | break; 126 | 127 | case E_STRICT: 128 | 129 | //$method = 'warn'; 130 | 131 | break; 132 | 133 | 134 | $method = 'info'; 135 | 136 | break; 137 | 138 | case E_DEPRECATED: 139 | case E_USER_DEPRECATED: 140 | case E_RECOVERABLE_ERROR: 141 | 142 | $method = 'warn'; 143 | 144 | break; 145 | 146 | default: 147 | 148 | $method = 'debug'; 149 | 150 | break; 151 | 152 | } 153 | 154 | if ( $method !== null ) { 155 | $this->$method($message); 156 | } 157 | 158 | if ( $die ) { die(); } 159 | 160 | } 161 | 162 | } 163 | 164 | ?> 165 | -------------------------------------------------------------------------------- /vendors/lithe-php/lithe_BasicHandlerMapping.php: -------------------------------------------------------------------------------- 1 | configuration = $configuration; 34 | $this->classLoader = $classLoader; 35 | } 36 | 37 | /** 38 | * Try to find a handler for the request 39 | * @param halo_HttpRequest $httpRequest 40 | */ 41 | protected function getHandlerInternal(halo_HttpRequest $httpRequest) { 42 | 43 | $requestedUri = $httpRequest->requestedUri(); 44 | $requestedUri = preg_replace('/^\/*/', '', $requestedUri); 45 | 46 | if ( ! $requestedUri ) { 47 | if ( $this->configuration->get('lithe.controllers.defaultHandlerMapping.defaultController') ) { 48 | $requestedUri = $this->configuration->get('lithe.controllers.defaultHandlerMapping.defaultController'); 49 | } else { 50 | // We requested the root URI but we have no default 51 | // controller specified. Clearly we cannot handle 52 | // this request. 53 | return null; 54 | } 55 | } 56 | 57 | if ( self::$LOGGER->isDebugEnabled() ) { 58 | self::$LOGGER->debug('Checking to see if we can handle requested URI: [' . $requestedUri . ']'); 59 | } 60 | 61 | $uriParts = explode('/', $requestedUri); 62 | $method = null; 63 | $controller = array_shift($uriParts); 64 | 65 | if ( count($uriParts) > 0 ) { 66 | $method = array_shift($uriParts); 67 | if ( $method === '' ) $method = null; 68 | } 69 | 70 | if ( $method === null ) { 71 | $method = $this->configuration->get('lithe.controllers.defaultHandlerMapping.defaultMethod'); 72 | } 73 | 74 | $controllerClassName = 75 | $this->configuration->get('lithe.controllers.defaultHandlerMapping.classNamePrefix') . 76 | ucfirst($controller) . 77 | $this->configuration->get('lithe.controllers.defaultHandlerMapping.classNameSuffix'); 78 | 79 | $controllerStoneName = 80 | ( $this->configuration->get('lithe.controllers.defaultHandlerMapping.stoneNamePrefix') ? 81 | $this->configuration->get('lithe.controllers.defaultHandlerMapping.stoneNamePrefix') . ( 82 | preg_match('/[a-zA-Z]$/', $this->configuration->get('lithe.controllers.defaultHandlerMapping.stoneNamePrefix')) ? 83 | ucfirst($controller) : 84 | lcfirst($controller) 85 | ) : 86 | lcfirst($controller)) . 87 | $this->configuration->get('lithe.controllers.defaultHandlerMapping.stoneNameSuffix'); 88 | 89 | if ( self::$LOGGER->isDebugEnabled() ) { 90 | self::$LOGGER->debug('Controller: ' . $controllerClassName . '->' . $method . '(' . implode(', ', $uriParts) . ')'); 91 | self::$LOGGER->debug('Stone: ' . $controllerStoneName); 92 | self::$LOGGER->debug('URI Params: ' . print_r($uriParts, true)); 93 | } 94 | 95 | $context = halo_DispatcherUtil::GET_CONTEXT($httpRequest); 96 | 97 | $controllerObject = null; 98 | 99 | if ( $context->exists($controllerStoneName) ) { 100 | if ( self::$LOGGER->isDebugEnabled() ) { 101 | self::$LOGGER->debug('Found stone for this controller'); 102 | } 103 | $controllerObject = $context->get($controllerStoneName); 104 | } elseif ( $this->classLoader->load($controllerClassName) ) { 105 | if ( self::$LOGGER->isDebugEnabled() ) { 106 | self::$LOGGER->debug('Found class for this controller'); 107 | } 108 | $stone = $context->add(array( 109 | 'className' => $controllerClassName, 110 | 'parent' => $this->configuration->get('lithe.controllers.defaultHandlerMapping.defaultParent'), 111 | )); 112 | $controllerObject = $context->get($stone); 113 | } 114 | 115 | if ( $controllerObject !== null ) { 116 | lithe_ContextUtil::SET_URI_PARAMS($httpRequest, $uriParts); 117 | lithe_ContextUtil::SET_CONTROLLER_METHOD($httpRequest, $method); 118 | } 119 | 120 | return $controllerObject; 121 | 122 | } 123 | 124 | } 125 | 126 | lithe_BasicHandlerMapping::$LOGGER = dd_logging_LogFactory::get('lithe_BasicHandlerMapping'); 127 | -------------------------------------------------------------------------------- /vendors/halo-php/halo_handler_AbstractHandlerMapping.php: -------------------------------------------------------------------------------- 1 | getHandlerInternal($httpRequest); 46 | if ( $handler === null ) { 47 | $handler = $this->defaultHandler; 48 | } 49 | if ( $handler === null ) { 50 | return null; 51 | } 52 | if ( is_string($handler) ) { 53 | // 54 | } 55 | return $handler; 56 | } 57 | 58 | /** 59 | * We are Substrate context aware 60 | * @param $context 61 | */ 62 | public function informAboutContext(substrate_Context $context) { 63 | $this->context = $context; 64 | $this->initContext(); 65 | } 66 | 67 | /** 68 | * Initialize context 69 | */ 70 | protected function initContext() { 71 | $this->extendInterceptors($this->interceptors); 72 | $this->initInterceptors(); 73 | } 74 | 75 | /** 76 | * Get the adapted interceptors. 77 | */ 78 | protected function getAdaptedInterceptors() { 79 | return $this->adaptedInterceptors; 80 | } 81 | 82 | /** 83 | * Get the handler execution chain 84 | * @param mixed $handler 85 | * @return halo_handler_HandlerExecutionChain 86 | */ 87 | public function getHandlerExecutionChain(halo_HttpRequest $httpRequest) { 88 | $handler = $this->getHandler($httpRequest); 89 | if ( $handler !== null ) { 90 | // We must have found a handler, wrap it! 91 | return $this->getHandlerExecutionChainInternal($handler); 92 | } 93 | return null; 94 | } 95 | 96 | /** 97 | * Get the handler execution chain (internal) 98 | * @param mixed $handler 99 | * @return halo_handler_HandlerExecutionChain 100 | */ 101 | protected function getHandlerExecutionChainInternal($handler) { 102 | if ( $handler instanceof halo_handler_HandlerExecutionChain ) { 103 | $handler->addInterceptors($this->getAdaptedInterceptors()); 104 | return $handler; 105 | } else { 106 | return new halo_handler_HandlerExecutionChain($handler, $this->getAdaptedInterceptors()); 107 | } 108 | } 109 | 110 | /** 111 | * Set interceptors 112 | * @param $interceptors 113 | */ 114 | public function setInterceptors($interceptors) { 115 | if ( ! is_array($interceptors) ) { $interceptors = array($interceptors); } 116 | foreach ( $interceptors as $interceptor ) { 117 | $this->interceptors[] = $interceptor; 118 | } 119 | } 120 | 121 | /** 122 | * Hook to allow for additional interceptors to be registred. 123 | * @param Array 124 | */ 125 | public function extendInterceptors($interceptors) { 126 | // noop 127 | } 128 | 129 | /** 130 | * Initialize interceptors 131 | */ 132 | public function initInterceptors() { 133 | foreach ( $this->interceptors as $interceptor ) { 134 | if ( is_string($interceptor) ) { 135 | $interceptor = $this->context->get($interceptor); 136 | } 137 | $this->adaptedInterceptors[] = $this->adaptInterceptor($interceptor); 138 | } 139 | } 140 | 141 | /** 142 | * Make certain that this interceptor is something we can use 143 | * @param $interceptor 144 | */ 145 | public function adaptInterceptor($interceptor) { 146 | if ( $interceptor instanceof halo_IHandlerInterceptor ) { 147 | return $interceptor; 148 | //} elseif ( $interceptor instanceof halo_ISomethingElse ) { 149 | //return new halo_HandlerInterceptorInterfaceAdapter($interceptor); 150 | } else { 151 | throw new Exception('Interceptor of type "' . get_class($interceptor) . '" not supported.'); 152 | } 153 | } 154 | 155 | /** 156 | * Get the order of this stone 157 | */ 158 | public function getStoneOrder() { 159 | return $this->stoneOrder; 160 | } 161 | 162 | /** 163 | * Set the order of this stone 164 | * @param $stoneOrder 165 | */ 166 | public function setStoneOrder($stoneOrder) { 167 | $this->stoneOrder = $stoneOrder; 168 | } 169 | 170 | /** 171 | * Get a handler 172 | * @param $httpRequest 173 | */ 174 | abstract protected function getHandlerInternal(halo_HttpRequest $httpRequest); 175 | 176 | } -------------------------------------------------------------------------------- /vendors/dd-logging-php/dd_logging_SimpleLogger.php: -------------------------------------------------------------------------------- 1 | array( 19 | 'warn' => true, 20 | 'error' => true, 21 | 'fatal' => true, 22 | ), 23 | ); 24 | 25 | /** 26 | * Configure the level settings for a specific class. 27 | * @param $className 28 | * @param $config 29 | */ 30 | static public function CONFIGURE($className, $config = null) { 31 | if ( ! isset(self::$CLASS_CONFIGURATION[$className]) ) { 32 | self::$CLASS_CONFIGURATION[$className] = array(); 33 | } 34 | foreach ( $config as $level => $enabled ) { 35 | if ( $enabled === null ) { 36 | unset(self::$CLASS_CONFIGURATION[$className][$level]); 37 | } else { 38 | self::$CLASS_CONFIGURATION[$className][$level] = $enabled; 39 | } 40 | } 41 | } 42 | 43 | /** 44 | * Configure the default level settings 45 | * @param $config 46 | */ 47 | static public function CONFIGURE_DEFAULTS($config = null) { 48 | self::CONFIGURE(self::$CLASS_DEFAULT, $config); 49 | } 50 | 51 | /** 52 | * Constructor 53 | * @param $className 54 | * @param $config 55 | */ 56 | public function __construct($className = null, $config = null) { 57 | parent::__construct($className); 58 | if ( $config ) { 59 | self::CONFIGURE($this->className, $config); 60 | } 61 | } 62 | 63 | /** 64 | * (non-PHPdoc) 65 | * @see dd_logging_ILogger::trace() 66 | */ 67 | public function trace($message) { 68 | if ( $this->isEnabled('trace') ) 69 | $this->logMessage('trace', $message); 70 | } 71 | 72 | /** 73 | * (non-PHPdoc) 74 | * @see dd_logging_ILogger::debug() 75 | */ 76 | public function debug($message) { 77 | if ( $this->isEnabled('debug') ) 78 | $this->logMessage('debug', $message); 79 | } 80 | 81 | /** 82 | * (non-PHPdoc) 83 | * @see dd_logging_ILogger::info() 84 | */ 85 | public function info($message) { 86 | if ( $this->isEnabled('info') ) 87 | $this->logMessage('info', $message); 88 | } 89 | 90 | /** 91 | * (non-PHPdoc) 92 | * @see dd_logging_ILogger::warn() 93 | */ 94 | public function warn($message) { 95 | if ( $this->isEnabled('warn') ) 96 | $this->logMessage('warn', $message); 97 | } 98 | 99 | /** 100 | * (non-PHPdoc) 101 | * @see dd_logging_ILogger::error() 102 | */ 103 | public function error($message) { 104 | if ( $this->isEnabled('error') ) 105 | $this->logMessage('error', $message); 106 | } 107 | 108 | /** 109 | * (non-PHPdoc) 110 | * @see dd_logging_ILogger::fatal() 111 | */ 112 | public function fatal($message) { 113 | if ( $this->isEnabled('fatal') ) 114 | $this->logMessage('fatal', $message); 115 | } 116 | 117 | /** 118 | * (non-PHPdoc) 119 | * @see dd_logging_ILogger::isTraceEnabled() 120 | */ 121 | public function isTraceEnabled() { 122 | return $this->isEnabled('trace'); 123 | } 124 | 125 | /** 126 | * (non-PHPdoc) 127 | * @see dd_logging_ILogger::isDebugEnabled() 128 | */ 129 | public function isDebugEnabled() { 130 | return $this->isEnabled('debug'); 131 | } 132 | 133 | /** 134 | * (non-PHPdoc) 135 | * @see dd_logging_ILogger::isInfoEnabled() 136 | */ 137 | public function isInfoEnabled() { 138 | return $this->isEnabled('info'); 139 | } 140 | 141 | /** 142 | * (non-PHPdoc) 143 | * @see dd_logging_ILogger::isDebugEnabled() 144 | */ 145 | public function isWarnEnabled() { 146 | return $this->isEnabled('warn'); 147 | } 148 | 149 | /** 150 | * (non-PHPdoc) 151 | * @see dd_logging_ILogger::isDebugEnabled() 152 | */ 153 | public function isErrorEnabled() { 154 | return $this->isEnabled('error'); 155 | } 156 | 157 | /** 158 | * (non-PHPdoc) 159 | * @see dd_logging_ILogger::isFatalEnabled() 160 | */ 161 | public function isFatalEnabled() { 162 | return $this->isEnabled('fatal'); 163 | } 164 | 165 | /** 166 | * Is logging enabled for a specific level? 167 | * @param $level 168 | * @param $default 169 | * @return bool 170 | */ 171 | protected function isEnabled($level) { 172 | if ( isset(self::$CLASS_CONFIGURATION[$this->className][$level]) ) 173 | return self::$CLASS_CONFIGURATION[$this->className][$level]; 174 | if ( isset(self::$CLASS_CONFIGURATION[self::$CLASS_DEFAULT][$level]) ) 175 | return self::$CLASS_CONFIGURATION[self::$CLASS_DEFAULT][$level]; 176 | return false; 177 | } 178 | 179 | /** 180 | * Log a message 181 | * @param $level 182 | * @param $message 183 | */ 184 | protected function logMessage($level, $message) { 185 | error_log($this->modifiedClassName . ' - ' . $level . ': ' . $message); 186 | } 187 | 188 | } 189 | 190 | ?> 191 | -------------------------------------------------------------------------------- /vendors/substrate-php/substrate_util_AntPathMatcher.php: -------------------------------------------------------------------------------- 1 | $pathIdxEnd) { 67 | // All characters in the string are used. Check if only '*'s are 68 | // left in the pattern. If so, we succeeded. Otherwise failure. 69 | for ($i = $patIdxStart; $i <= $patIdxEnd; $i++) { 70 | if ($patArr[$i] != '*') { 71 | return false; 72 | } 73 | } 74 | return true; 75 | } 76 | 77 | // Process characters after last star 78 | while (($ch = $patArr[$patIdxEnd]) != '*' && $pathIdxStart <= $pathIdxEnd) { 79 | if ($ch != '?') { 80 | if ($isCaseSensitive && $ch != $pathArr[$pathIdxEnd]) { 81 | return false; // Character mismatch 82 | } 83 | if (!$isCaseSensitive && strtoupper($ch) 84 | != strtoupper($pathArr[$pathIdxEnd])) { 85 | return false; // Character mismatch 86 | } 87 | } 88 | $patIdxEnd--; 89 | $pathIdxEnd--; 90 | } 91 | if ($pathIdxStart > $pathIdxEnd) { 92 | // All characters in the string are used. Check if only '*'s are 93 | // left in the pattern. If so, we succeeded. Otherwise failure. 94 | for ($i = $patIdxStart; $i <= $patIdxEnd; $i++) { 95 | if ($patArr[$i] != '*') { 96 | return false; 97 | } 98 | } 99 | return true; 100 | } 101 | 102 | // process pattern between stars. padIdxStart and patIdxEnd point 103 | // always to a '*'. 104 | while ($patIdxStart != $patIdxEnd && $pathIdxStart <= $pathIdxEnd) { 105 | $patIdxTmp = -1; 106 | for ($i = $patIdxStart + 1; $i <= $patIdxEnd; $i++) { 107 | if ($patArr[$i] == '*') { 108 | $patIdxTmp = $i; 109 | break; 110 | } 111 | } 112 | if ($patIdxTmp == $patIdxStart + 1) { 113 | // Two stars next to each other, skip the first one. 114 | $patIdxStart++; 115 | continue; 116 | } 117 | // Find the pattern between padIdxStart & padIdxTmp in str between 118 | // strIdxStart & strIdxEnd 119 | $patLength = ($patIdxTmp - $patIdxStart - 1); 120 | $pathLength = ($pathIdxEnd - $pathIdxStart + 1); 121 | $foundIdx = -1; 122 | //strLoop: 123 | for ($i = 0; $i <= $pathLength - $patLength; $i++) { 124 | for ($j = 0; $j < $patLength; $j++) { 125 | $ch = $patArr[$patIdxStart + $j + 1]; 126 | if ($ch != '?') { 127 | if ($isCaseSensitive && $ch != $pathArr[$pathIdxStart + $i 128 | + $j]) { 129 | continue 2; 130 | //continue strLoop; 131 | } 132 | if (!$isCaseSensitive 133 | && strtoupper($ch) 134 | != strtoupper($pathArr[$pathIdxStart + $i + $j])) { 135 | continue 2; 136 | //continue strLoop; 137 | } 138 | } 139 | } 140 | $foundIdx = $pathIdxStart + $i; 141 | break; 142 | } 143 | 144 | if ($foundIdx == -1) { 145 | return false; 146 | } 147 | 148 | $patIdxStart = $patIdxTmp; 149 | $pathIdxStart = $foundIdx + $patLength; 150 | } 151 | 152 | // All characters in the string are used. Check if only '*'s are left 153 | // in the pattern. If so, we succeeded. Otherwise failure. 154 | for ($i = $patIdxStart; $i <= $patIdxEnd; $i++) { 155 | if ($patArr[$i] != '*') { 156 | return false; 157 | } 158 | } 159 | 160 | return true; 161 | 162 | } 163 | 164 | } 165 | 166 | ?> -------------------------------------------------------------------------------- /vendors/halo-php/halo_HttpRequest.php: -------------------------------------------------------------------------------- 1 | method = $method; 111 | $this->queryParams = $queryParams; 112 | $this->postParams = $postParams; 113 | $this->fileData = $fileData; 114 | $this->env = $env; 115 | $this->body = $body; 116 | 117 | // Trim any leading slashes. 118 | $this->requestedUri = preg_replace('/^\/*/', '', $env['PATH_INFO']); 119 | 120 | if ( isset($env['REQUEST_URI']) ) { 121 | $requestUri = $env['REQUEST_URI']; 122 | $this->scriptPathRoot = $env['SCRIPT_PATH_ROOT'] = 123 | preg_replace('/\/+/', '/', $this->requestedUri ? 124 | substr($requestUri, 0, strpos($requestUri, $this->requestedUri)) : 125 | $requestUri); 126 | } else { 127 | $this->scriptPathRoot = $env['SCRIPT_PATH_ROOT'] = '/'; 128 | } 129 | 130 | // TODO: Does this actually make sense? 131 | $_SERVER = $this->env; 132 | 133 | if ( $this->requestedUri === $env['PATH_INFO'] or $this->requestedUri === '' ) { 134 | $this->requestedUri = '/'; 135 | } else{ 136 | $this->requestedUri = '/' . $this->requestedUri; 137 | } 138 | 139 | } 140 | 141 | public function method() { return $this->method; } 142 | public function requestedUri() { return $this->requestedUri; } 143 | public function getRequestedUri() { return $this->deprecated()->requestedUri(); } 144 | public function getRequestedUrl() { return $this->deprecated()->requestedUri(); } 145 | 146 | public function scriptPathRoot() { return $this->scriptPathRoot; } 147 | 148 | public function queryParamExists($key) { return array_key_exists($key, $this->queryParams); } 149 | public function queryParam($key) { return isset($this->queryParams[$key]) ? $this->queryParams[$key] : null; } 150 | public function setQueryParam($key, $value = null) { $this->queryParams[$key] = $value; } 151 | public function unsetQueryParam($key) { unset($this->queryParams[$key]); } 152 | public function queryParams() { return $this->queryParams; } 153 | public function getQueryParams() { return $this->deprecated()->queryParams(); } 154 | 155 | public function postParamExists($key) { return array_key_exists($key, $this->postParams); } 156 | public function postParam($key) { return isset($this->postParams[$key]) ? $this->postParams[$key] : null; } 157 | public function setPostParam($key, $value = null) { $this->postParams[$key] = $value; } 158 | public function unsetPostParam($key) { unset($this->postParams[$key]); } 159 | public function postParams() { return $this->postParams; } 160 | public function getPostParams() { return $this->deprecated()->postParams(); } 161 | 162 | public function attributeExists($key) { return array_key_exists($key, $this->attributes); } 163 | public function attribute($key) { return isset($this->attributes[$key]) ? $this->attributes[$key] : null; } 164 | public function setAttribute($key, $value = null) { $this->attributes[$key] = $value; } 165 | public function unsetAttribute($key) { unset($this->attributes[$key]); } 166 | public function attributes() { return $this->attributes; } 167 | public function attributeKeys() { return array_keys($this->attributes); } 168 | public function getAttributes() { return $this->deprecated()->attributes(); } 169 | public function getAttributeKeys() { return $this->deprecated()->attributeKeys(); } 170 | 171 | public function uriParamExists($key) { return array_key_exists($key, $this->uriParams); } 172 | public function uriParam($key) { return isset($this->uriParams[$key]) ? $this->uriParams[$key] : null; } 173 | public function setUriParam($key, $value = null) { $this->uriParams[$key] = $value; } 174 | public function unsetUriParam($key) { unset($this->uriParams[$key]); } 175 | public function uriParams() { return $this->uriParams; } 176 | public function uriParamNames() { return array_keys($this->uriParams); } 177 | 178 | public function urlParamExists($key) { return $this->deprecated()->uriParamExists($key); } 179 | public function urlParam($key) { $this->deprecated()->uriParam($key); } 180 | public function setUrlParam($key, $value = null) { $this->deprecated()->setUriParam($key, $value); } 181 | public function unsetUrlParam($key) { $this->deprecated()->unsetUriParam($key); } 182 | public function urlParams() { $this->deprecated()->uriParams(); } 183 | public function getUrlParams() { $this->deprecated()->uriParams(); } 184 | public function urlParamNames() { $this->deprecated()->uriParamNames($key); } 185 | public function getUrlParamNames() { $this->deprecated()->uriParamNames($key); } 186 | 187 | public function fileParams() { return $this->fileParams; } 188 | public function fileParam($key, $secondKey = null) { 189 | if ( array_key_exists($key, $this->fileData) ) { 190 | $value = $this->fileData[$key]; 191 | if ( $secondKey === null ) { return $value; } 192 | elseif ( array_key_exists($secondKey, $value) ) { return $value[$secondKey]; } 193 | } 194 | return null; 195 | } 196 | 197 | public function envExists($key) { return array_key_exists($key, $this->env); } 198 | public function envKeys() { return array_keys($this->env); } 199 | public function env($key) { return isset($this->env[$key]) ? $this->env[$key] : null; } 200 | public function envExport() { return $this->env; } 201 | 202 | public function body() { return $this->body; } 203 | 204 | public function getFileParams() { return $this->deprecated()->fileParams(); } 205 | public function getFileParam($key, $secondKey = null) { return $this->deprecated()->fileParam($key, $secondKey); } 206 | 207 | protected function deprecated() { 208 | if ( self::$LOGGER->isWarnEnabled() ) { 209 | $back = debug_backtrace(); 210 | self::$LOGGER->warn('Deprecated call to ' . $back[1]['class'] . '::' . $back[1]['function'] . ', ' . $back[1]['file'] . ':' . $back[1]['line']); 211 | } 212 | return $this; 213 | } 214 | 215 | } 216 | 217 | halo_HttpRequest::$LOGGER = dd_logging_LogFactory::get('halo_HttpRequest'); 218 | 219 | --------------------------------------------------------------------------------