public function getComponentInstallDirectory($component)
    {
        list($type, $name) = $this->normalizeComponent($component);

        // Must use reflection to avoid using static cache.
        $method = new \ReflectionMethod('core_component', 'fetch_plugintypes');
        $method->setAccessible(true);
        $result = $method->invoke(null);

        if (!array_key_exists($type, $result[0])) {
            throw new \InvalidArgumentException(sprintf('The component %s has an unknown plugin type of %s', $component, $type));
        }

        return $result[0][$type].'/'.$name;
    }
public function getComponentInstallDirectory($component)
    {
        list($type, $name) = $this->normalizeComponent($component);

        // Must use reflection to avoid using static cache.
        $method = new \ReflectionMethod('core_component', 'fetch_plugintypes');
        $method->setAccessible(true);
        $result = $method->invoke(null);

        if (!array_key_exists($type, $result[0])) {
            throw new \InvalidArgumentException(sprintf('The component %s has an unknown plugin type of %s', $component, $type));
        }

        return $result[0][$type].'/'.$name;
    }
public function getComponentInstallDirectory ( $ component ) { list ( $ type , $ name ) = $ this -> normalizeComponent ( $ component ) ; // Must use reflection to avoid using static cache. $ method = new \ ReflectionMethod ( 'core_component' , 'fetch_plugintypes' ) ; $ method -> setAccessible ( true ) ; $ result = $ method -> invoke ( null ) ; if ( ! array_key_exists ( $ type , $ result [ 0 ] ) ) { throw new \ InvalidArgumentException ( sprintf ( 'The component %s has an unknown plugin type of %s' , $ component , $ type ) ) ; } return $ result [ 0 ] [ $ type ] . '/' . $ name ; }
Get the absolute install directory path within Moodle.

@param string $component Moodle component, EG: mod_forum

@return string Absolute path, EG: /path/to/mod/forum
Get the absolute install directory path within Moodle .