403Webshell
Server IP : 104.21.28.229  /  Your IP : 216.73.216.216
Web Server : Apache/2
System : Linux hosting8537.lvs 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64
User : mienphi ( 1014)
PHP Version : 8.2.14
Disable Function : exec,system,passthru,shell_exec,proc_close,proc_open,dl,popen,show_source,posix_kill,posix_mkfifo,posix_getpwuid,posix_setpgid,posix_setsid,posix_setuid,posix_setgid,posix_seteuid,posix_setegid,posix_uname
MySQL : OFF  |  cURL : ON  |  WGET : OFF  |  Perl : OFF  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /home/mienphi/public_html/wp-content/plugins/loco-translate/src/gettext/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /home/mienphi/public_html/wp-content/plugins/loco-translate/src/gettext/String.php
<?php
/**
 * Gettext source string. Does not contain translations.
 */
class Loco_gettext_String {

    /**
     * @var array
     */
    private $raw;

    /**
     * @var string
     */
    private $plural;
    

    /**
     * Loco_gettext_String constructor.
     *
     * @param string $msgid Mandatory source
     * @param string $msgctxt Optional context
     */
    public function __construct( $msgid, $msgctxt = '' ){
        $this->raw =  [
            'source' => (string) $msgid,
            'context' => (string) $msgctxt,
        ];
    }


    /**
     * Get singular form as raw array data
     * @internal
     * @return string[]
     */
    public function exportSingular(){
        return $this->raw;
    }


    /**
     * Get plural form as raw array data
     * @internal
     * @return string[]
     */
    public function exportPlural(){
        return  [
            'source' => $this->plural,
        ];
    }


    /**
     * @param string $prop
     * @param string|array $value
     * @param string $glue
     * @return void
     */
    private function merge( $prop, $value, $glue ){
        if( is_string($value) ){
            $value = [$value];
        }
        else if( ! is_array($value) ){
            throw new InvalidArgumentException('Expected Array or String');
        }
        if( array_key_exists($prop,$this->raw) ){
            $value = array_merge( explode($glue,$this->raw[$prop]), $value );
        }
        $this->raw[$prop] = implode($glue,$value);
    }


    /**
     * @param array|string $refs
     * @return self
     */
    public function addFileReferences( $refs ){
        $this->merge('refs',$refs,' ');
        return $this;
    }


    /**
     * @param array|string $notes
     * @return self
     */
    public function addExtractedComment( $notes ){
        $this->merge('notes',$notes,' ');
        return $this;
    }

    /**
     * @param string $msgid_plural
     * @return self
     */
    public function pluralize( $msgid_plural ){
        $this->plural = (string) $msgid_plural;
        return $this;
    }


    /**
     * @return bool
     */
    public function hasPlural(){
        return is_string($this->plural) && '' !== $this->plural;
    }
    
    
    /*public function __toString(){
        return json_encode( $this->raw );
    }*/
    

}

Youez - 2016 - github.com/yon3zu
LinuXploit