????JFIF??x?x????'
Server IP : 79.136.114.73 / Your IP : 216.73.216.86 Web Server : Apache/2.4.7 (Ubuntu) PHP/5.5.9-1ubuntu4.29 OpenSSL/1.0.1f System : Linux b8009 3.13.0-170-generic #220-Ubuntu SMP Thu May 9 12:40:49 UTC 2019 x86_64 User : www-data ( 33) PHP Version : 5.5.9-1ubuntu4.29 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority, MySQL : ON | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /proc/self/root/home/b8009/php-5.6.22/ext/standard/tests/file/ |
Upload File : |
--TEST-- Stream wrappers in include_path --FILE-- <?php $data1 = $data2 = $data3 = $data4 = $data5 = $data6 = <<<'EOD' <?php echo __FILE__ . "\n";?> EOD; /*<?*/ class mystream { public $path; public $mode; public $options; public $position; public $varname; function url_stat($path, $flags) { return array(); } function stream_stat() { return array(); } function stream_open($path, $mode, $options, &$opened_path) { $this->path = $path; $this->mode = $mode; $this->options = $options; $split = parse_url($path); if ($split["host"] !== b"GLOBALS" || empty($split["path"]) || empty($GLOBALS[substr($split["path"],1)])) { return false; } $this->varname = substr($split["path"],1); if (strchr($mode, 'a')) $this->position = strlen($GLOBALS[$this->varname]); else $this->position = 0; return true; } function stream_read($count) { $ret = substr($GLOBALS[$this->varname], $this->position, $count); $this->position += strlen($ret); return $ret; } function stream_tell() { return $this->position; } function stream_eof() { return $this->position >= strlen($GLOBALS[$this->varname]); } function stream_seek($offset, $whence) { switch($whence) { case SEEK_SET: if ($offset < strlen($GLOBALS[$this->varname]) && $offset >= 0) { $this->position = $offset; return true; } else { return false; } break; case SEEK_CUR: if ($offset >= 0) { $this->position += $offset; return true; } else { return false; } break; case SEEK_END: if (strlen($GLOBALS[$this->varname]) + $offset >= 0) { $this->position = strlen($GLOBALS[$this->varname]) + $offset; return true; } else { return false; } break; default: return false; } } } if (!stream_wrapper_register("test", "mystream")) { die("test wrapper registration failed"); } echo file_get_contents("test://GLOBALS/data1"); include("test://GLOBALS/data1"); include_once("test://GLOBALS/data2"); include_once("test://GLOBALS/data2"); $include_path = get_include_path(); set_include_path($include_path . PATH_SEPARATOR . "test://GLOBALS"); echo file_get_contents("data3", true); include("data3"); include_once("data4"); include_once("data4"); set_include_path("test://GLOBALS" . PATH_SEPARATOR . $include_path); echo file_get_contents("data5", true); include("data5"); include_once("data6"); include_once("data6"); ?> --EXPECT-- <?php echo __FILE__ . "\n";?> test://GLOBALS/data1 test://GLOBALS/data2 <?php echo __FILE__ . "\n";?> test://GLOBALS/data3 test://GLOBALS/data4 <?php echo __FILE__ . "\n";?> test://GLOBALS/data5 test://GLOBALS/data6