Lines Matching refs:directory
5 // SAPIs set the working directory differently. So simply creating a directory
6 // relative to the current working directory like this: mkdir("blah") might
12 // For this reason we set the open_basedir to . (current directory) and then
19 function recursive_delete_directory($directory) {
22 if (substr($directory, -1) == '/') {
23 $directory = substr($directory, 0, -1);
26 // Make sure the directory is valid
27 if (is_dir($directory) == FALSE) {
31 // Check we can access the directory
32 if (is_readable($directory) == FALSE) {
36 $handle = opendir($directory);
38 // Scan through the directory contents
42 $path = ($directory.'/'.$item);
54 @chmod($directory, 0777);
55 rmdir($directory);
62 $directory = getcwd();
64 var_dump(mkdir($directory."/test"));
65 var_dump(mkdir($directory."/test/ok"));
66 var_dump(mkdir($directory."/test/bad"));
67 file_put_contents($directory."/test/ok/ok.txt", "Hello World!");
68 file_put_contents($directory."/test/bad/bad.txt", "Hello World!");
72 $directory = (getcwd()."/test");
73 recursive_delete_directory($directory);
84 $directory = $savedDirectory;
85 var_dump($function($directory."/test/bad/bad.txt"));
86 var_dump($function($directory."/test/bad/../bad/bad.txt"));
92 $directory = getcwd();
93 $savedDirectory = $directory;
94 var_dump(chdir($directory));
97 // Optionally change directory
99 var_dump(chdir($directory."/test/ok"));
118 $directory = $savedDirectory;
119 var_dump(is_array($function($directory."/test/ok/ok.txt")));
120 var_dump(is_array($function($directory."/test/ok/../ok/ok.txt")));
132 $directory = $savedDirectory;
133 var_dump($function($directory."/test/ok/ok.txt"));
134 var_dump($function($directory."/test/ok/../ok/ok.txt"));