kernel/classes/ezcontentlanguage.php
static function fetchList( $forceReloading = false )
    {
        if( isset( $GLOBALS['eZContentLanguageList'] ) && $forceReloading === false )
            return $GLOBALS['eZContentLanguageList'];

        $cachePath = eZSys::cacheDirectory() . '/ezcontentlanguage_cache.php';
        $clusterFileHandler = eZClusterFileHandler::instance( $cachePath );

        if( $forceReloading || !$clusterFileHandler->fileExists( $cachePath ) )
        {
            $languages = eZPersistentObject::fetchObjectList( eZContentLanguage::definition() );
            $clusterFileHandler->fileStoreContents( $cachePath, serialize( $languages ), 'content', 'php' );
        }
        else
        {
            $languages = unserialize( $clusterFileHandler->fetchContents() );
            // If for some reason unserialize operation fails, we force the cache file to regenerate
            // See http://issues.ez.no/18613
            if ( $languages === false )
            {
                eZDebug::writeError(
                    "An error occurred while reading content language cache file $cachePath. File is being re-generated",
                    __METHOD__
                );
                return self::fetchList( true );
            }
        }

        unset( $GLOBALS['eZContentLanguageList'] );
        unset( $GLOBALS['eZContentLanguageMask'] );
        $GLOBALS['eZContentLanguageList'] = array();
        $mask = 1; // we want have 0-th bit set too!
        foreach ( $languages as $language )
        {
            $GLOBALS['eZContentLanguageList'][$language->attribute( 'id' )] = $language;
            $mask += $language->attribute( 'id' );
        }

        $GLOBALS['eZContentLanguageMask'] = $mask;

        return $GLOBALS['eZContentLanguageList'];
    }
static function fetchList( $forceReloading = false )
    {
        if( isset( $GLOBALS['eZContentLanguageList'] ) && $forceReloading === false )
            return $GLOBALS['eZContentLanguageList'];

        $cachePath = eZSys::cacheDirectory() . '/ezcontentlanguage_cache.php';
        $clusterFileHandler = eZClusterFileHandler::instance( $cachePath );

        if( $forceReloading || !$clusterFileHandler->fileExists( $cachePath ) )
        {
            $languages = eZPersistentObject::fetchObjectList( eZContentLanguage::definition() );
            $clusterFileHandler->fileStoreContents( $cachePath, serialize( $languages ), 'content', 'php' );
        }
        else
        {
            $languages = unserialize( $clusterFileHandler->fetchContents() );
            // If for some reason unserialize operation fails, we force the cache file to regenerate
            // See http://issues.ez.no/18613
            if ( $languages === false )
            {
                eZDebug::writeError(
                    "An error occurred while reading content language cache file $cachePath. File is being re-generated",
                    __METHOD__
                );
                return self::fetchList( true );
            }
        }

        unset( $GLOBALS['eZContentLanguageList'] );
        unset( $GLOBALS['eZContentLanguageMask'] );
        $GLOBALS['eZContentLanguageList'] = array();
        $mask = 1; // we want have 0-th bit set too!
        foreach ( $languages as $language )
        {
            $GLOBALS['eZContentLanguageList'][$language->attribute( 'id' )] = $language;
            $mask += $language->attribute( 'id' );
        }

        $GLOBALS['eZContentLanguageMask'] = $mask;

        return $GLOBALS['eZContentLanguageList'];
    }
static function fetchList ( $ forceReloading = false ) { if ( isset ( $ GLOBALS [ 'eZContentLanguageList' ] ) && $ forceReloading === false ) return $ GLOBALS [ 'eZContentLanguageList' ] ; $ cachePath = eZSys :: cacheDirectory ( ) . '/ezcontentlanguage_cache.php' ; $ clusterFileHandler = eZClusterFileHandler :: instance ( $ cachePath ) ; if ( $ forceReloading || ! $ clusterFileHandler -> fileExists ( $ cachePath ) ) { $ languages = eZPersistentObject :: fetchObjectList ( eZContentLanguage :: definition ( ) ) ; $ clusterFileHandler -> fileStoreContents ( $ cachePath , serialize ( $ languages ) , 'content' , 'php' ) ; } else { $ languages = unserialize ( $ clusterFileHandler -> fetchContents ( ) ) ; // If for some reason unserialize operation fails, we force the cache file to regenerate // See http://issues.ez.no/18613 if ( $ languages === false ) { eZDebug :: writeError ( "An error occurred while reading content language cache file $cachePath. File is being re-generated" , __METHOD__ ) ; return self :: fetchList ( true ) ; } } unset ( $ GLOBALS [ 'eZContentLanguageList' ] ) ; unset ( $ GLOBALS [ 'eZContentLanguageMask' ] ) ; $ GLOBALS [ 'eZContentLanguageList' ] = array ( ) ; $ mask = 1 ; // we want have 0-th bit set too! foreach ( $ languages as $ language ) { $ GLOBALS [ 'eZContentLanguageList' ] [ $ language -> attribute ( 'id' ) ] = $ language ; $ mask += $ language -> attribute ( 'id' ) ; } $ GLOBALS [ 'eZContentLanguageMask' ] = $ mask ; return $ GLOBALS [ 'eZContentLanguageList' ] ; }
Fetches the list of the languages used on the site.

\param forceReloading Optional. If true, the list will be fetched from database even if it is cached in memory.
Default value is false.
\return Array of the eZContentLanguage objects of languages used on the site.
\static
Fetches the list of the languages used on the site .