protected static function createWildcardsIndex()
    {
        self::cacheInfoDirectories( $wildcardCacheDir, $wildcardCacheFile, $wildcardCachePath, $wildcardKeys );
        if ( !file_exists( $wildcardCacheDir ) )
        {
            eZDir::mkdir( $wildcardCacheDir, false, true );
        }

        // Index file (wildcard_md5_index.php)
        $wildcardsIndex = array();

        $limit = self::WILDCARDS_PER_CACHE_FILE;
        $offset = 0;
        $cacheFilesCount = 0;
        $wildcardNum = 0;
        while( 1 )
        {
            $wildcards = self::fetchList( $offset, $limit, false );
            if ( count( $wildcards ) === 0 )
            {
                break;
            }

            // sub cache file (wildcard_md5_<i>.php)
            $wildcardDetails = array();
            $currentSubCacheFile = self::loadCacheFile( $cacheFilesCount );
            foreach ( $wildcards as $wildcard )
            {
                $wildcardsIndex[] = self::matchRegexpCode( $wildcard );
                $wildcardDetails[$wildcardNum] = self::matchReplaceCode( $wildcard );

                ++$wildcardNum;
            }
            $binaryData = "<" . "?php\nreturn ". var_export( $wildcardDetails, true ) . ";\n?" . ">\n";
            $currentSubCacheFile->storeContents( $binaryData, "wildcard-cache-$cacheFilesCount", 'php', true );

            $offset += $limit;
            ++$cacheFilesCount;
        }

        $indexCacheFile = self::loadCacheFile();
        $indexBinaryData = "<" . "?php\nreturn ". var_export( $wildcardsIndex, true ) . ";\n?" . ">\n";
        $indexCacheFile->storeContents( $indexBinaryData, "wildcard-cache-index", 'php', true );

        return $wildcardsIndex;
        // end index cache file
    }