Esempio n. 1
0
 /**
  * Retrieve the themes details file
  *
  * @version 1.0
  * @since   1.0.0
  * @author  Daniel Noel-Davies, Dan Aldridge
  *
  * @param   string     $themeName
  *
  * @return  array
  */
 public static function getDetails($themeName)
 {
     $detailsFile = sprintf('%1$sthemes/%2$s/details.php', cmsROOT, $themeName);
     $detailsClassName = sprintf('Details_%s', str_replace('-', '_', $themeName));
     // Make sure the details file exists
     if (file_exists($detailsFile) === false) {
         trigger_error('Error getting Module Details :: Details file doesn\'t exist');
         return false;
     }
     require_once $detailsFile;
     return reflectMethod($detailsClassName, 'details');
 }
Esempio n. 2
0
 /**
  * Decides what to do with the current url setup
  *
  * @version 1.0
  * @since   1.0.0
  * @author  Dan Aldridge
  * 
  * @return  void
  */
 public function invokeRoute()
 {
     // Get instanced
     $objRoute = Core_Classes_coreObj::getRoute();
     $module = $this->module;
     $this->module = 'Admin_Modules_' . $this->module;
     // if defaults are being loaded for the core acp panel, then we want dashboard not index
     if ($this->action == 'index' && $module == 'core') {
         $this->action = 'dashboard';
     }
     // if nothing is selected, index all the way
     if (is_empty($this->action)) {
         $this->action = 'index';
     }
     $action = array($this->action);
     if (strpos($this->action, '/') !== false) {
         $action = explode('/', $this->action);
     }
     $panels = cmsROOT . 'modules/%s/panels/';
     $panels = sprintf($panels, $module);
     // check if we are dealing with the sub panels or not
     if (file_exists($panels) && is_readable($panels) && count(glob($panels . 'panel.*.php'))) {
         // we are !
         $method = array_shift($action);
         if (!isset($action[0]) || is_empty($action[0])) {
             $action[0] = $method;
         }
         $args = array('method' => $method, 'args' => $action);
         // check the panel to see if it exists, if so include it
         $path = sprintf($panels, $module) . 'panel.' . $args['method'] . '.php';
         if (file_exists($path) && is_readable($path)) {
             require_once $path;
             DEBUG ? debugLog($path, 'invokeRoute(): Loaded sub panel... ') : '';
         } else {
             trigger_error('Error: Could not load ACP Panel: ' . $path);
         }
         // then call to it like normal :D
         $method = reflectMethod($this->module . '_' . $args['method'], $args['args'][0], $args);
     } else {
         $method = reflectMethod($this->module, array_shift($action), $action);
     }
     if ($method === false) {
         $objRoute->throwHTTP(404);
     }
 }
Esempio n. 3
0
 /**
  * Retrieve the details from the details file of a module
  *
  * @version 1.1
  * @since   1.0.0
  * @author  Daniel Noel-Davies
  *
  * @param   string     $moduleName
  *
  * @return  array
  */
 public static function getModuleDetails($moduleName)
 {
     // Check module exists
     if (self::moduleExists($moduleName) === false) {
         return false;
     }
     $detailsFile = sprintf('%1$smodules/%2$s/details.php', cmsROOT, $moduleName);
     $detailsClassName = sprintf('Details_%s', $moduleName);
     // Make sure the details file exists
     if (file_exists($detailsFile) === false) {
         trigger_error('Error getting Module Details :: Details file doesn\'t exist');
         return false;
     }
     require_once $detailsFile;
     $details = reflectMethod($detailsClassName, 'details');
     return array('version' => doArgs('version', 'N/A', $details), 'hash' => doArgs('hash', 'N/A', $details), 'name' => doArgs('name', 'N/A', $details), 'author' => doArgs('author', 'N/A', $details));
 }
Esempio n. 4
0
    static function stat()
    {
        echo "Called stat()\n";
    }
    private function priv()
    {
        echo "Called priv()\n";
    }
    protected function prot()
    {
    }
    public function __destruct()
    {
    }
}
class DerivedClass extends TestClass
{
}
interface TestInterface
{
    public function int();
}
reflectMethod("DerivedClass", "foo");
reflectMethod("TestClass", "stat");
reflectMethod("TestClass", "priv");
reflectMethod("TestClass", "prot");
reflectMethod("DerivedClass", "prot");
reflectMethod("TestInterface", "int");
reflectMethod("ReflectionProperty", "__construct");
reflectMethod("TestClass", "__destruct");