本文整理汇总了PHP中test_open_basedir_after函数的典型用法代码示例。如果您正苦于以下问题:PHP test_open_basedir_after函数的具体用法?PHP test_open_basedir_after怎么用?PHP test_open_basedir_after使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了test_open_basedir_after函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: test_open_basedir_before
<?php
require_once "open_basedir.inc";
test_open_basedir_before("parse_ini_file");
$directory = dirname(__FILE__);
var_dump(parse_ini_file("../bad"));
var_dump(parse_ini_file("../bad/bad.txt"));
var_dump(parse_ini_file(".."));
var_dump(parse_ini_file("../"));
var_dump(parse_ini_file("../bad/."));
var_dump(parse_ini_file("../bad/./bad.txt"));
var_dump(parse_ini_file("./../."));
test_open_basedir_after("parse_ini_file");
require_once "open_basedir.inc";
delete_directories();
开发者ID:badlamer,项目名称:hhvm,代码行数:15,代码来源:open_basedir_parse_ini_file.php
示例2: getcwd
<?php
require_once "open_basedir.inc";
$initdir = getcwd();
test_open_basedir_before("symlink");
$target = $initdir . "/test/ok/ok.txt";
var_dump(symlink($target, "../bad/symlink.txt"));
var_dump(symlink($target, "../symlink.txt"));
var_dump(symlink($target, "../bad/./symlink.txt"));
var_dump(symlink($target, "./.././symlink.txt"));
$symlink = $initdir . "/test/ok/symlink.txt";
var_dump(symlink("../bad/bad.txt", $symlink));
var_dump(symlink("../bad", $symlink));
var_dump(symlink("../bad/./bad.txt", $symlink));
var_dump(symlink("../bad/bad.txt", $symlink));
var_dump(symlink("./.././bad", $symlink));
$target = $initdir . "/test/ok/ok.txt";
var_dump(symlink($target, $symlink));
var_dump(unlink($symlink));
var_dump(mkdir("ok2"));
$symlink = $initdir . "/test/ok/ok2/ok.txt";
var_dump(symlink("../ok.txt", $symlink));
// $target == (dirname($symlink)."/".$target) == ($initdir."/test/ok/ok.txt");
var_dump(unlink($symlink));
test_open_basedir_after("symlink");
require_once "open_basedir.inc";
delete_directories();
开发者ID:alphaxxl,项目名称:hhvm,代码行数:27,代码来源:open_basedir_symlink.php
示例3: getcwd
<?php
require_once "open_basedir.inc";
$initdir = getcwd();
test_open_basedir_before("file");
test_open_basedir_error("file");
var_dump(file("ok.txt"));
var_dump(file("../ok/ok.txt"));
var_dump(file($initdir . "/test/ok/ok.txt"));
var_dump(file($initdir . "/test/ok/../ok/ok.txt"));
test_open_basedir_after("file");
开发者ID:gleamingthecube,项目名称:php,代码行数:11,代码来源:tests_security_open_basedir_file.php
示例4: getcwd
<?php
require_once "open_basedir.inc";
$initdir = getcwd();
test_open_basedir_before("tempnam");
var_dump(tempnam("../bad", "test"));
var_dump(tempnam("..", "test"));
var_dump(tempnam("../", "test"));
var_dump(tempnam("/", "test"));
var_dump(tempnam("../bad/.", "test"));
var_dump(tempnam("./../.", "test"));
var_dump(tempnam("", "test"));
//absolute test
$file = tempnam($initdir . "/test/ok", "test");
var_dump($file);
var_dump(unlink($file));
//relative test
$file = tempnam(".", "test");
var_dump($file);
var_dump(unlink($file));
$file = tempnam("../ok", "test");
var_dump($file);
var_dump(unlink($file));
test_open_basedir_after("tempnam");
error_reporting(0);
require_once "open_basedir.inc";
delete_directories();
开发者ID:badlamer,项目名称:hhvm,代码行数:27,代码来源:open_basedir_tempnam.php
示例5: getcwd
<?php
require_once "open_basedir.inc";
$initdir = getcwd();
test_open_basedir_before("error_log");
var_dump(ini_set("error_log", $initdir . "/test/bad/bad.txt"));
var_dump(ini_set("error_log", $initdir . "/test/bad.txt"));
var_dump(ini_set("error_log", $initdir . "/bad.txt"));
var_dump(ini_set("error_log", $initdir . "/test/ok/ok.txt"));
var_dump(ini_set("error_log", $initdir . "/test/ok/ok.txt"));
test_open_basedir_after("error_log");
error_reporting(0);
require_once "open_basedir.inc";
delete_directories();
开发者ID:badlamer,项目名称:hhvm,代码行数:14,代码来源:open_basedir_error_log.php
示例6: chdir
<?php
chdir(__DIR__);
ini_set("open_basedir", ".");
require_once "open_basedir.inc";
$initdir = getcwd();
test_open_basedir_before("readlink", FALSE);
chdir($initdir);
$target = $initdir . "/test/bad/bad.txt";
$symlink = $initdir . "/test/ok/symlink.txt";
var_dump(symlink($target, $symlink));
chdir($initdir . "/test/ok");
var_dump(readlink("symlink.txt"));
var_dump(readlink("../ok/symlink.txt"));
var_dump(readlink("../ok/./symlink.txt"));
var_dump(readlink("./symlink.txt"));
var_dump(readlink($initdir . "/test/ok/symlink.txt"));
$target = $initdir . "/test/ok/ok.txt";
$symlink = $initdir . "/test/ok/symlink.txt";
var_dump(symlink($target, $symlink));
var_dump(readlink($symlink));
test_open_basedir_after("readlink");
开发者ID:gleamingthecube,项目名称:php,代码行数:22,代码来源:tests_security_open_basedir_readlink.php
示例7: test_open_basedir_before
<?php
require_once "open_basedir.inc";
test_open_basedir_before("chdir");
var_dump(chdir("../bad"));
var_dump(chdir(".."));
var_dump(chdir("../"));
var_dump(chdir("/"));
var_dump(chdir("../bad/."));
var_dump(chdir("./../."));
test_open_basedir_after("chdir");
require_once "open_basedir.inc";
delete_directories();
开发者ID:alphaxxl,项目名称:hhvm,代码行数:13,代码来源:open_basedir_chdir.php
示例8: getcwd
<?php
require_once "open_basedir.inc";
$initdir = getcwd();
test_open_basedir_before("unlink");
var_dump(unlink("../bad/bad.txt"));
var_dump(unlink(".././bad/bad.txt"));
var_dump(unlink("../bad/../bad/bad.txt"));
var_dump(unlink("./.././bad/bad.txt"));
var_dump(unlink($initdir . "/test/bad/bad.txt"));
test_open_basedir_after("unlink");
error_reporting(0);
require_once "open_basedir.inc";
delete_directories();
开发者ID:badlamer,项目名称:hhvm,代码行数:14,代码来源:open_basedir_unlink.php
示例9: getcwd
<?php
require_once "open_basedir.inc";
$initdir = getcwd();
test_open_basedir_before("is_executable");
test_open_basedir_error("is_executable");
var_dump(is_executable("ok.txt"));
var_dump(is_executable("../ok/ok.txt"));
var_dump(is_executable($initdir . "/test/ok/ok.txt"));
var_dump(is_executable($initdir . "/test/ok/../ok/ok.txt"));
test_open_basedir_after("is_executable");
开发者ID:gleamingthecube,项目名称:php,代码行数:11,代码来源:tests_security_open_basedir_is_executable.php
示例10: getcwd
<?php
require_once "open_basedir.inc";
$initdir = getcwd();
test_open_basedir_before("fopen");
var_dump(fopen("../bad", "r"));
var_dump(fopen("../bad/bad.txt", "r"));
var_dump(fopen("..", "r"));
var_dump(fopen("../", "r"));
var_dump(fopen("/", "r"));
var_dump(fopen("../bad/.", "r"));
var_dump(fopen("../bad/./bad.txt", "r"));
var_dump(fopen("./../.", "r"));
var_dump(fopen($initdir . "/test/ok/ok.txt", "r"));
var_dump(fopen("./ok.txt", "r"));
var_dump(fopen("ok.txt", "r"));
var_dump(fopen("../ok/ok.txt", "r"));
var_dump(fopen("../ok/./ok.txt", "r"));
test_open_basedir_after("fopen");
error_reporting(0);
require_once "open_basedir.inc";
delete_directories();
开发者ID:badlamer,项目名称:hhvm,代码行数:22,代码来源:open_basedir_fopen.php
示例11: test_open_basedir_before
<?php
require_once "open_basedir.inc";
test_open_basedir_before("copy");
var_dump(copy("ok.txt", "../bad"));
var_dump(copy("ok.txt", "../bad/bad.txt"));
var_dump(copy("ok.txt", ".."));
var_dump(copy("ok.txt", "../"));
var_dump(copy("ok.txt", "/"));
var_dump(copy("ok.txt", "../bad/."));
var_dump(copy("ok.txt", "../bad/./bad.txt"));
var_dump(copy("ok.txt", "./../."));
var_dump(copy("ok.txt", "copy.txt"));
var_dump(unlink("copy.txt"));
test_open_basedir_after("copy");
error_reporting(0);
require_once "open_basedir.inc";
delete_directories();
开发者ID:badlamer,项目名称:hhvm,代码行数:18,代码来源:open_basedir_copy.php
示例12: chdir
<?php
chdir(__DIR__);
ini_set("open_basedir", ".");
require_once "open_basedir.inc";
$initdir = getcwd();
test_open_basedir_before("linkinfo", FALSE);
chdir($initdir);
$target = $initdir . "/test/bad/bad.txt";
$symlink = $initdir . "/test/ok/symlink.txt";
var_dump(symlink($target, $symlink));
chdir($initdir . "/test/ok");
var_dump(linkinfo("symlink.txt"));
var_dump(linkinfo("../ok/symlink.txt"));
var_dump(linkinfo("../ok/./symlink.txt"));
var_dump(linkinfo("./symlink.txt"));
var_dump(linkinfo($initdir . "/test/ok/symlink.txt"));
$target = $initdir . "/test/ok/ok.txt";
$symlink = $initdir . "/test/ok/symlink.txt";
var_dump(symlink($target, $symlink));
var_dump(linkinfo($symlink));
var_dump(unlink($symlink));
test_open_basedir_after("linkinfo");
error_reporting(0);
chdir(__DIR__);
require_once "open_basedir.inc";
delete_directories();
开发者ID:badlamer,项目名称:hhvm,代码行数:27,代码来源:open_basedir_linkinfo.php
示例13: getcwd
<?php
require_once "open_basedir.inc";
$initdir = getcwd();
test_open_basedir_before("mkdir");
var_dump(mkdir("../bad/blah"));
var_dump(mkdir("../blah"));
var_dump(mkdir("../bad/./blah"));
var_dump(mkdir("./.././blah"));
var_dump(mkdir($initdir . "/test/ok/blah"));
var_dump(rmdir($initdir . "/test/ok/blah"));
test_open_basedir_after("mkdir");
开发者ID:gleamingthecube,项目名称:php,代码行数:12,代码来源:tests_security_open_basedir_mkdir.php
示例14: getcwd
<?php
require_once "open_basedir.inc";
$initdir = getcwd();
test_open_basedir_before("chmod");
var_dump(chmod("../bad", 0600));
var_dump(chmod("../bad/bad.txt", 0600));
var_dump(chmod("..", 0600));
var_dump(chmod("../", 0600));
var_dump(chmod("/", 0600));
var_dump(chmod("../bad/.", 0600));
var_dump(chmod("../bad/./bad.txt", 0600));
var_dump(chmod("./../.", 0600));
var_dump(chmod($initdir . "/test/ok/ok.txt", 0600));
var_dump(chmod("./ok.txt", 0600));
var_dump(chmod("ok.txt", 0600));
var_dump(chmod("../ok/ok.txt", 0600));
var_dump(chmod("../ok/./ok.txt", 0600));
chmod($initdir . "/test/ok/ok.txt", 0777);
test_open_basedir_after("chmod");
error_reporting(0);
require_once "open_basedir.inc";
delete_directories();
开发者ID:badlamer,项目名称:hhvm,代码行数:23,代码来源:open_basedir_chmod.php
示例15: getcwd
<?php
require_once "open_basedir.inc";
$initdir = getcwd();
test_open_basedir_before("scandir");
test_open_basedir_error("scandir");
var_dump(scandir($initdir . "/test/ok/"));
var_dump(scandir($initdir . "/test/ok"));
var_dump(scandir($initdir . "/test/ok/../ok"));
test_open_basedir_after("scandir");
开发者ID:gleamingthecube,项目名称:php,代码行数:10,代码来源:tests_security_open_basedir_scandir.php
示例16: getcwd
<?php
require_once "open_basedir.inc";
$initdir = getcwd();
test_open_basedir_before("disk_free_space");
test_open_basedir_error("disk_free_space");
var_dump(disk_free_space($initdir . "/test/ok"));
test_open_basedir_after("disk_free_space");
开发者ID:gleamingthecube,项目名称:php,代码行数:8,代码来源:tests_security_open_basedir_disk_free_space.php
示例17: getcwd
<?php
require_once "open_basedir.inc";
$initdir = getcwd();
test_open_basedir_before("opendir");
test_open_basedir_error("opendir");
var_dump(opendir($initdir . "/test/ok/"));
var_dump(opendir($initdir . "/test/ok"));
var_dump(opendir($initdir . "/test/ok/../ok"));
test_open_basedir_after("opendir");
require_once "open_basedir.inc";
delete_directories();
开发者ID:alphaxxl,项目名称:hhvm,代码行数:12,代码来源:open_basedir_opendir.php
示例18: getcwd
<?php
require_once "open_basedir.inc";
$initdir = getcwd();
test_open_basedir_before("file_put_contents");
var_dump(file_put_contents("../bad/bad.txt", "Hello World!"));
var_dump(file_put_contents(".././bad/bad.txt", "Hello World!"));
var_dump(file_put_contents("../bad/../bad/bad.txt", "Hello World!"));
var_dump(file_put_contents("./.././bad/bad.txt", "Hello World!"));
var_dump(file_put_contents($initdir . "/test/bad/bad.txt", "Hello World!"));
test_open_basedir_after("file_put_contents");
开发者ID:gleamingthecube,项目名称:php,代码行数:11,代码来源:tests_security_open_basedir_file_put_contents.php
示例19: getcwd
<?php
require_once "open_basedir.inc";
$initdir = getcwd();
test_open_basedir_before("touch");
var_dump(touch("../bad"));
var_dump(touch("../bad/bad.txt"));
var_dump(touch(".."));
var_dump(touch("../"));
var_dump(touch("/"));
var_dump(touch("../bad/."));
var_dump(touch("../bad/./bad.txt"));
var_dump(touch("./../."));
var_dump(touch($initdir . "/test/ok/ok.txt"));
var_dump(touch("./ok.txt"));
var_dump(touch("ok.txt"));
var_dump(touch("../ok/ok.txt"));
var_dump(touch("../ok/./ok.txt"));
test_open_basedir_after("touch");
error_reporting(0);
require_once "open_basedir.inc";
delete_directories();
开发者ID:badlamer,项目名称:hhvm,代码行数:22,代码来源:open_basedir_touch.php
示例20: getcwd
<?php
require_once "open_basedir.inc";
$initdir = getcwd();
test_open_basedir_before("rename");
var_dump(rename("../bad/bad.txt", "rename.txt"));
var_dump(rename(".././bad/bad.txt", "rename.txt"));
var_dump(rename("../bad/../bad/bad.txt", "rename.txt"));
var_dump(rename("./.././bad/bad.txt", "rename.txt"));
var_dump(rename($initdir . "/test/bad/bad.txt", "rename.txt"));
test_open_basedir_after("rename");
error_reporting(0);
require_once "open_basedir.inc";
delete_directories();
开发者ID:badlamer,项目名称:hhvm,代码行数:14,代码来源:open_basedir_rename.php
注:本文中的test_open_basedir_after函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论