dvadf
File manager - Edit - /home/theblueo/tv/wp-includes/pomo/lib/compat.tar
Back
JsonSerializable.php 0000666 00000001101 15214173131 0010510 0 ustar 00 <?php // @codeCoverageIgnoreStart /** * Placeholder for missing interface in PHP < 5.4. * Can't be invoked automatically, so always do: json_encode( $obj->jsonSerialize() ) * Note that this shim is also present in WordPress >= 4.4.0 */ if( ! interface_exists('JsonSerializable') ){ interface JsonSerializable { public function jsonSerialize(); } } // @codeCoverageIgnoreEnd /** * Redundant interface so this file will autoload when JsonSerializable is referenced * @internal */ interface Loco_compat_JsonSerializable extends JsonSerializable { } MbstringExtension.php 0000666 00000003635 15214173131 0010750 0 ustar 00 <?php /** * Placeholder for missing PHP "mbstring" extension. * Just avoids fatal errors. Does not actually replace functionality. * * If the mbstring library is missing any PO files that aren't UTF-8 encoded will result in parsing failures. */ abstract class Loco_compat_MbstringExtension { public static function mb_detect_encoding( $str, array $encoding_list = null, $strict = null ){ // return ! $str || preg_match('/^(?:[\\0-\\x7F]|[\\xC0-\\xDF][\\x80-\\xBF]|[\\xE0-\\xEF][\\x80-\\xBF]{2}|[\\xF0-\\xFF][\\x80-\\xBF]{3})+$/',$str) return ! $str || preg_match('/./u',$str) ? 'UTF-8' : 'ISO-8859-1' ; } public static function mb_list_encodings(){ return array('UTF-8','ISO-8859-1'); } public static function mb_strlen( $str, $encoding = null ){ return strlen($str); } public static function mb_convert_encoding( $str, $to_encoding, $from_encoding ){ return $str; } } // @codeCoverageIgnoreStart if( ! function_exists('mb_detect_encoding') ){ function mb_detect_encoding( $str = '', array $encoding_list = array(), $strict = false ){ return Loco_compat_MbstringExtension::mb_detect_encoding( $str, $encoding_list, $strict ); } } if( ! function_exists('mb_list_encodings') ){ function mb_list_encodings(){ return Loco_compat_MbstringExtension::mb_list_encodings(); } } if( ! function_exists('mb_strlen') ){ function mb_strlen( $str, $encoding = null ){ return Loco_compat_MbstringExtension::mb_strlen( $str, $encoding ); } } if( ! function_exists('mb_convert_encoding') ){ function mb_convert_encoding( $str, $to_encoding, $from_encoding = null ){ return Loco_compat_MbstringExtension::mb_convert_encoding( $str, $to_encoding, $from_encoding ); } } if( ! function_exists('mb_encoding_aliases') ){ function mb_encoding_aliases(){ return false; } } JsonExtension.php 0000666 00000001454 15214173131 0010071 0 ustar 00 <?php /** * Placeholder for missing PHP "json" extension. * Just avoids fatal errors. Does not actually replace functionality. * * If this extension is missing no JavaScript will work in the plugin at all. */ abstract class Loco_compat_JsonExtension { public static function json_encode( $value ){ return '{"error":{"code":-1,"message":"json extension is not installed"}}'; } public static function json_decode( $json ){ return null; } } // @codeCoverageIgnoreStart if( ! function_exists('json_encode') ){ function json_encode( $value ){ return Loco_compat_JsonExtension::json_encode( $value ); } } if( ! function_exists('json_decode') ){ function json_decode( $json ){ return Loco_compat_JsonExtension::json_decode($json); } } TokenizerExtension.php 0000666 00000001047 15214173131 0011130 0 ustar 00 <?php /** * Placeholder for missing PHP "tokenizer" extension. * Just avoids fatal errors. Does not actually replace functionality. * * If this extension is missing PHP string extraction will not work at all. */ abstract class Loco_compat_TokenizerExtension { public static function token_get_all( $value ){ return array(); } } // @codeCoverageIgnoreStart if( ! function_exists('token_get_all') ){ function token_get_all( $value ){ return Loco_compat_TokenizerExtension::token_get_all($value); } } DummyInterface.php 0000666 00000000117 15214173131 0010172 0 ustar 00 <?php /** * Just for testing autoloader */ interface DummyInterface { } Failure.php 0000666 00000001653 15214173131 0006653 0 ustar 00 <?php /** * Class containing reasons for total incompatibility with current WordPress environment. * It won't be loaded unless total failure occurs * * @codeCoverageIgnore */ abstract class Loco_compat_Failure { /** * "admin_notices" callback, renders failure notice if plugin failed to start up admin hooks. * If this is hooked and not unhooked then auto-hooks using annotations have failed. */ public static function print_hook_failure(){ $texts = array( 'Loco Translate failed to start up' ); /*/ Hooks currently not using annotatons (would be if we enabled @priority tag) if( ini_get('opcache.enable') && ( ! ini_get('opcache.save_comments') || ! ini_get('opcache.load_comments') ) ){ $texts[] = 'Try configuring opcache to preserve comments'; }*/ echo '<div class="notice error"><p><strong>Error:</strong> '.implode('. ',$texts).'</p></div>'; } } PosixExtension.php 0000666 00000006066 15214173131 0010266 0 ustar 00 <?php /** * Abstraction of PHP "posix" extension. * Basic functionality substitution, but cannot get user/group names so falls back to numeric */ abstract class Loco_compat_PosixExtension { /** * @param int */ private static $uid = null; /** * @param int */ private static $gid = null; /** * @return int */ public static function getuid(){ if( is_null(self::$uid) ){ // use posix function if extension available if( function_exists('posix_geteuid') ){ self::$uid = posix_geteuid(); } // else use temp file system to establish owner else { self::$uid = self::getuidViaTempDir(); } } return self::$uid; } /** * @return int */ public static function getgid(){ if( is_null(self::$gid) ){ // use posix function if extension available if( function_exists('posix_getegid') ){ self::$gid = posix_getegid(); } // else use temp file system to establish group owner else { self::$gid = self::getgidViaTempDir(); } } return self::$gid; } /** * Attempt to get effective user ID by reading a temporary file * @return int */ public static function getuidViaTempDir(){ $dir = get_temp_dir(); if( 04000 & fileperms($dir) ){ trigger_error( sprintf('%s directory has setuid bit, getuid may not be accurate'), E_USER_NOTICE ); } $path = wp_tempnam( 'loco-sniff-'.time(), $dir ); $uid = fileowner($path); unlink( $path ); return $uid; } /** * Attempt to get effective group ID by reading a temporary file * @return int */ public static function getgidViaTempDir(){ $dir = get_temp_dir(); if( 02000 & fileperms($dir) ){ trigger_error( sprintf('%s directory has setgid bit, getgid may not be accurate'), E_USER_NOTICE ); } $path = wp_tempnam( 'loco-sniff-'.time(), $dir ); $gid = filegroup($path); unlink( $path ); return $gid; } /** * Get the name of the user that the web server runs under * This is only for visual/info purposes. * @return string */ public static function getHttpdUser(){ if( function_exists('posix_geteuid') ){ $info = posix_getpwuid( posix_geteuid() ); return $info['name']; } // @codeCoverageIgnoreStart foreach( array('apache','nginx') as $name ){ if( false !== stripos(PHP_SAPI,$name) ){ return $name; } if( isset($_SERVER['SERVER_SOFTWARE']) && false !== stripos($_SERVER['SERVER_SOFTWARE'],$name) ){ return $name; } } // translators: used when user name of web server process is unknown return __('the web server','loco-translate'); // @codeCoverageIgnoreEnd } } CtypeExtension.php 0000666 00000000607 15214212673 0010250 0 ustar 00 <?php /** * Placeholder for missing PHP "ctype" extension. */ abstract class Loco_compat_CtypeExtension { public static function digit( $value ){ return 1 === preg_match('/^[0-9]+$/',$value); } } // @codeCoverageIgnoreStart if( ! function_exists('ctype_digit') ){ function ctype_digit( $value ){ return Loco_compat_CtypeExtension::digit( $value ); } }
dvadf
dvadf
| ver. 1.4 |
Github
|
.
| PHP 7.0.33 | Generation time: 0 |
proxy
|
phpinfo
|
Settings