/** * Constructor. * * @param ComponentCollection $collection * @param array $settings * @throws PermitException */ public function __construct(ComponentCollection $collection, $settings = array()) { $this->settings['permit_include_path'] = APP . 'Config' . DS . 'permit.php'; $settings = array_merge($this->settings, $settings); if (!$settings['isTest']) { if (!file_exists($settings['permit_include_path'])) { throw new PermitException("File containing permissions not found. It should be located at " . APP . 'Config' . DS . "permit.php"); } try { include $settings['permit_include_path']; } catch (Exception $e) { throw new PermitException("File containing permissions not found. It should be located at " . APP . 'config' . DS . "permit.php"); } } parent::__construct($collection, $settings); Permit::$settings = $this->settings; }