$52 GRAYBYTE WORDPRESS FILE MANAGER $41

SERVER : vnpttt-amd7f72-h1.vietnix.vn #1 SMP Fri May 24 12:42:50 UTC 2024
SERVER IP : 103.200.23.149 | ADMIN IP 216.73.216.22
OPTIONS : CRL = ON | WGT = ON | SDO = OFF | PKEX = OFF
DEACTIVATED : NONE

/home/bqrcodec/contact.malloca.com/wp-content/plugins/loco-translate/src/gettext/

HOME
Current File : /home/bqrcodec/contact.malloca.com/wp-content/plugins/loco-translate/src/gettext//SearchPaths.php
<?php
/**
 * A file finder built from search path references in a PO/POT file
 */
class Loco_gettext_SearchPaths extends Loco_fs_FileFinder {
    
    
    /**
     * Look up a relative file reference against search paths
     * @param string relative file path reference
     * @return Loco_fs_File
     */
    public function match( $ref ){
        $excluded = new Loco_fs_Locations( $this->getExcluded() );
        /* @var Loco_fs_Directory */
        foreach( $this->getRootDirectories() as $base ){
            $file = new Loco_fs_File($ref);
            $path = $file->normalize( (string) $base );
            if( $file->exists() && ! $excluded->check($path) ){
                return $file;
            }
        }
    }



    /**
     * Build search paths from a given PO/POT file that references other files
     * @return Loco_gettext_SearchPaths
     */
    public function init( Loco_fs_File $pofile, LocoHeaders $head = null ){
        if( is_null($head) ){
            loco_require_lib('compiled/gettext.php');
            $head = LocoPoHeaders::fromSource( $pofile->getContents() );
        }
        $ninc = 0;
        foreach( ['Poedit'] as $vendor ){
            $key = 'X-'.$vendor.'-Basepath';
            if( ! $head->has($key) ){
                continue;
            }
            $dir = new Loco_fs_Directory( $head[$key] );   
            $base = $dir->normalize( $pofile->dirname() );
            // base should be absolute, with the following search paths relative to it
            $i = 0;
            while( true ){
                $key = sprintf('X-%s-SearchPath-%u', $vendor, $i++);
                if( ! $head->has($key) ){
                    break;
                }
                // map search path to given base
                $include = new Loco_fs_File( $head[$key] );
                $include->normalize( $base );
                if( $include->exists() ){
                    if( $include->isDirectory() ){
                        $this->addRoot( (string) $include );
                        $ninc++;
                    }
                    /*else {
                        TODO force specific file in Loco_fs_FileFinder
                    }*/
                }
            }
            // exclude from search paths
            $i = 0;
            while( true ){
                $key = sprintf('X-%s-SearchPathExcluded-%u', $vendor, $i++);
                if( ! $head->has($key) ){
                    break;
                }
                // map excluded path to given base
                $exclude = new Loco_fs_File( $head[$key] );
                $exclude->normalize($base);
                if( $exclude->exists() ){
                     $this->exclude( (string) $exclude );
                }
                // TODO implement wildcard exclusion
            }
        }

        // Add po file location if no proprietary headers used
        if( ! $ninc ){
            $this->addRoot( $pofile->dirname() );
        }

        return $this;
    }
    
    
}

Current_dir [ WRITEABLE ] Document_root [ WRITEABLE ]


[ Back ]
NAME
SIZE
LAST TOUCH
USER
CAN-I?
FUNCTIONS
..
--
29 Jan 2024 10.33 AM
bqrcodec / bqrcodec
0755
Compiler.php
10.74 KB
29 Jan 2024 10.33 AM
bqrcodec / bqrcodec
0644
Data.php
13.507 KB
29 Jan 2024 10.33 AM
bqrcodec / bqrcodec
0644
Extraction.php
6.201 KB
29 Jan 2024 10.33 AM
bqrcodec / bqrcodec
0644
Matcher.php
8.958 KB
29 Jan 2024 10.33 AM
bqrcodec / bqrcodec
0644
Metadata.php
6.831 KB
29 Jan 2024 10.33 AM
bqrcodec / bqrcodec
0644
SearchPaths.php
2.94 KB
29 Jan 2024 10.33 AM
bqrcodec / bqrcodec
0644
String.php
2.116 KB
29 Jan 2024 10.33 AM
bqrcodec / bqrcodec
0644
SyncOptions.php
2.256 KB
29 Jan 2024 10.33 AM
bqrcodec / bqrcodec
0644
WordCount.php
2.866 KB
29 Jan 2024 10.33 AM
bqrcodec / bqrcodec
0644

GRAYBYTE WORDPRESS FILE MANAGER @ 2026 CONTACT ME
Static GIF