本文整理汇总了PHP中test_open_basedir_before函数的典型用法代码示例。如果您正苦于以下问题:PHP test_open_basedir_before函数的具体用法?PHP test_open_basedir_before怎么用?PHP test_open_basedir_before使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了test_open_basedir_before函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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();
示例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();
示例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");
示例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();
示例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();
示例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");
示例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();
示例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();
示例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");
示例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();
示例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();
示例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();
示例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");
示例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();
示例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");