*/ if (!isset($_REQUEST['module']) || empty($_REQUEST['module'])) { header('Missing Argument', true, 400); die; } if (!isset($_REQUEST['method']) || empty($_REQUEST['method'])) { header('Missing Argument', true, 400); die; } try { /* * Load the needed lib */ From::module($tlabelReq)->uses('pluginloader.lib'); $pl = new PluginLoader('./plugins/'); if ($class = $pl->load(isset($_REQUEST['forceGeneric']) ? 'GENERIC' : $_REQUEST['module'])) { if (method_exists($class, $_REQUEST['method'])) { $method = $_REQUEST['method']; $args = array(); foreach ($allowedArgs as $allowed) { if (isset($_REQUEST[$allowed])) { $args[$allowed] = $_REQUEST[$allowed]; } } $args['module'] = $_REQUEST['module']; $result = $class->{$method}($args); } else { header('Not Implemented', true, 501); die; } } else {
/** * @covers Zepto\FileLoader\PluginLoader::load() * @expectedException UnexpectedValueException */ public function testLoadInvalidFilePath() { $this->loader->load('@£@'); }