pluginsConfig = array('AmfphpDiscovery' => array('excludePaths' => array('dBug', 'classes', 'Vo/'))); * default is for ignoring Vo/ folder */ protected $excludePaths = array('Vo/'); /** * restrict access to amfphp_admin, the role set when using the back office. default is true. * @var boolean */ protected $restrictAccess = true; /** * constructor. * adds filters to grab config about services and add discovery service. Low priority so that other plugins can add their services first * @param array $config optional key/value pairs in an associative array. Used to override default configuration values. */ public function __construct(array $config = null) { $filterManager = Amfphp_Core_FilterManager::getInstance(); $filterManager->addFilter(Amfphp_Core_Gateway::FILTER_SERVICE_NAMES_2_CLASS_FIND_INFO, $this, 'filterServiceNames2ClassFindInfo', 99); $filterManager->addFilter(Amfphp_Core_Gateway::FILTER_SERVICE_FOLDER_PATHS, $this, 'filterServiceFolderPaths', 99); if(isset($config['excludePaths'])){ $this->excludePaths = $config['excludePaths']; } AmfphpDiscoveryService::$excludePaths = $this->excludePaths; if(isset($config['restrictAccess'])){ $this->restrictAccess = $config['restrictAccess']; } AmfphpDiscoveryService::$restrictAccess = $this->restrictAccess; } /** * grabs serviceFolders from config * @param array serviceFolders array of absolute paths */ public function filterServiceFolderPaths(array $serviceFolders){ AmfphpDiscoveryService::$serviceFolders = $serviceFolders; return $serviceFolders; } /** * grabs serviceNames2ClassFindInfo from config and add discovery service * @param array $serviceNames2ClassFindInfo associative array of key -> class find info */ public function filterServiceNames2ClassFindInfo(array $serviceNames2ClassFindInfo){ $serviceNames2ClassFindInfo['AmfphpDiscoveryService'] = new Amfphp_Core_Common_ClassFindInfo( dirname(__FILE__) . '/AmfphpDiscoveryService.php', 'AmfphpDiscoveryService'); AmfphpDiscoveryService::$serviceNames2ClassFindInfo = $serviceNames2ClassFindInfo; return $serviceNames2ClassFindInfo; } } ?>