lib/ezutils/classes/ezextension.php
public static function extensionOrdering( array $activeExtensions )
    {
        $activeExtensionsSet = array_flip( $activeExtensions );

        $dependencies = array();
        foreach ( $activeExtensions as $extension )
        {
            $loadingOrderData = ezpExtension::getInstance( $extension )->getLoadingOrder();

            // The extension should appear even without dependencies to be taken into account
            if ( ! isset( $dependencies[$extension] ) )
                $dependencies[$extension] = array();

            if ( isset( $loadingOrderData['after'] ) )
            {
                foreach ( $loadingOrderData['after'] as $dependency )
                {
                    if ( isset( $activeExtensionsSet[$dependency] ) )
                        $dependencies[$extension][] = $dependency;
                }
            }
            if ( isset( $loadingOrderData['before'] ) )
            {
                foreach ( $loadingOrderData['before'] as $dependency )
                {
                    if ( isset( $activeExtensionsSet[$dependency] ) )
                        $dependencies[$dependency][] = $extension;
                }
            }
        }

        $topologySort = new ezpTopologicalSort( $dependencies );
        $activeExtensionsSorted = $topologySort->sort();

        return $activeExtensionsSorted !== false ? $activeExtensionsSorted : $activeExtensions;
    }
public static function extensionOrdering( array $activeExtensions )
    {
        $activeExtensionsSet = array_flip( $activeExtensions );

        $dependencies = array();
        foreach ( $activeExtensions as $extension )
        {
            $loadingOrderData = ezpExtension::getInstance( $extension )->getLoadingOrder();

            // The extension should appear even without dependencies to be taken into account
            if ( ! isset( $dependencies[$extension] ) )
                $dependencies[$extension] = array();

            if ( isset( $loadingOrderData['after'] ) )
            {
                foreach ( $loadingOrderData['after'] as $dependency )
                {
                    if ( isset( $activeExtensionsSet[$dependency] ) )
                        $dependencies[$extension][] = $dependency;
                }
            }
            if ( isset( $loadingOrderData['before'] ) )
            {
                foreach ( $loadingOrderData['before'] as $dependency )
                {
                    if ( isset( $activeExtensionsSet[$dependency] ) )
                        $dependencies[$dependency][] = $extension;
                }
            }
        }

        $topologySort = new ezpTopologicalSort( $dependencies );
        $activeExtensionsSorted = $topologySort->sort();

        return $activeExtensionsSorted !== false ? $activeExtensionsSorted : $activeExtensions;
    }
public static function extensionOrdering ( array $ activeExtensions ) { $ activeExtensionsSet = array_flip ( $ activeExtensions ) ; $ dependencies = array ( ) ; foreach ( $ activeExtensions as $ extension ) { $ loadingOrderData = ezpExtension :: getInstance ( $ extension ) -> getLoadingOrder ( ) ; // The extension should appear even without dependencies to be taken into account if ( ! isset ( $ dependencies [ $ extension ] ) ) $ dependencies [ $ extension ] = array ( ) ; if ( isset ( $ loadingOrderData [ 'after' ] ) ) { foreach ( $ loadingOrderData [ 'after' ] as $ dependency ) { if ( isset ( $ activeExtensionsSet [ $ dependency ] ) ) $ dependencies [ $ extension ] [ ] = $ dependency ; } } if ( isset ( $ loadingOrderData [ 'before' ] ) ) { foreach ( $ loadingOrderData [ 'before' ] as $ dependency ) { if ( isset ( $ activeExtensionsSet [ $ dependency ] ) ) $ dependencies [ $ dependency ] [ ] = $ extension ; } } } $ topologySort = new ezpTopologicalSort ( $ dependencies ) ; $ activeExtensionsSorted = $ topologySort -> sort ( ) ; return $ activeExtensionsSorted !== false ? $ activeExtensionsSorted : $ activeExtensions ; }
Returns the provided array reordered with loading order information taken into account.

@see activeExtensions

@param array $activeExtensions Array of extensions.
Returns the provided array reordered with loading order information taken into account .