src/Core/Extensible.php
public static function get_extra_config_sources($class = null)
    {
        if (!$class) {
            $class = get_called_class();
        }

        // If this class is unextendable, NOP
        if (in_array($class, self::$unextendable_classes)) {
            return null;
        }

        // Variable to hold sources in
        $sources = null;

        // Get a list of extensions
        $extensions = Config::inst()->get($class, 'extensions', Config::EXCLUDE_EXTRA_SOURCES | Config::UNINHERITED);

        if (!$extensions) {
            return null;
        }

        // Build a list of all sources;
        $sources = array();

        foreach ($extensions as $extension) {
            list($extensionClass, $extensionArgs) = ClassInfo::parse_class_spec($extension);
            // Strip service name specifier
            $extensionClass = strtok($extensionClass, '.');
            $sources[] = $extensionClass;

            if (!class_exists($extensionClass)) {
                throw new InvalidArgumentException("$class references nonexistent $extensionClass in \$extensions");
            }

            call_user_func(array($extensionClass, 'add_to_class'), $class, $extensionClass, $extensionArgs);

            foreach (array_reverse(ClassInfo::ancestry($extensionClass)) as $extensionClassParent) {
                if (ClassInfo::has_method_from($extensionClassParent, 'get_extra_config', $extensionClassParent)) {
                    $extras = $extensionClassParent::get_extra_config($class, $extensionClass, $extensionArgs);
                    if ($extras) {
                        $sources[] = $extras;
                    }
                }
            }
        }

        return $sources;
    }
public static function get_extra_config_sources($class = null)
    {
        if (!$class) {
            $class = get_called_class();
        }

        // If this class is unextendable, NOP
        if (in_array($class, self::$unextendable_classes)) {
            return null;
        }

        // Variable to hold sources in
        $sources = null;

        // Get a list of extensions
        $extensions = Config::inst()->get($class, 'extensions', Config::EXCLUDE_EXTRA_SOURCES | Config::UNINHERITED);

        if (!$extensions) {
            return null;
        }

        // Build a list of all sources;
        $sources = array();

        foreach ($extensions as $extension) {
            list($extensionClass, $extensionArgs) = ClassInfo::parse_class_spec($extension);
            // Strip service name specifier
            $extensionClass = strtok($extensionClass, '.');
            $sources[] = $extensionClass;

            if (!class_exists($extensionClass)) {
                throw new InvalidArgumentException("$class references nonexistent $extensionClass in \$extensions");
            }

            call_user_func(array($extensionClass, 'add_to_class'), $class, $extensionClass, $extensionArgs);

            foreach (array_reverse(ClassInfo::ancestry($extensionClass)) as $extensionClassParent) {
                if (ClassInfo::has_method_from($extensionClassParent, 'get_extra_config', $extensionClassParent)) {
                    $extras = $extensionClassParent::get_extra_config($class, $extensionClass, $extensionArgs);
                    if ($extras) {
                        $sources[] = $extras;
                    }
                }
            }
        }

        return $sources;
    }
public static function get_extra_config_sources ( $ class = null ) { if ( ! $ class ) { $ class = get_called_class ( ) ; } // If this class is unextendable, NOP if ( in_array ( $ class , self :: $ unextendable_classes ) ) { return null ; } // Variable to hold sources in $ sources = null ; // Get a list of extensions $ extensions = Config :: inst ( ) -> get ( $ class , 'extensions' , Config :: EXCLUDE_EXTRA_SOURCES | Config :: UNINHERITED ) ; if ( ! $ extensions ) { return null ; } // Build a list of all sources; $ sources = array ( ) ; foreach ( $ extensions as $ extension ) { list ( $ extensionClass , $ extensionArgs ) = ClassInfo :: parse_class_spec ( $ extension ) ; // Strip service name specifier $ extensionClass = strtok ( $ extensionClass , '.' ) ; $ sources [ ] = $ extensionClass ; if ( ! class_exists ( $ extensionClass ) ) { throw new InvalidArgumentException ( "$class references nonexistent $extensionClass in \$extensions" ) ; } call_user_func ( array ( $ extensionClass , 'add_to_class' ) , $ class , $ extensionClass , $ extensionArgs ) ; foreach ( array_reverse ( ClassInfo :: ancestry ( $ extensionClass ) ) as $ extensionClassParent ) { if ( ClassInfo :: has_method_from ( $ extensionClassParent , 'get_extra_config' , $ extensionClassParent ) ) { $ extras = $ extensionClassParent :: get_extra_config ( $ class , $ extensionClass , $ extensionArgs ) ; if ( $ extras ) { $ sources [ ] = $ extras ; } } } } return $ sources ; }
Get extra config sources for this class

@param string $class Name of class. If left null will return for the current class
@return array|null
Get extra config sources for this class