try to fix machine dependant problems again
I think these are dependant on relative directories. Seeing if this helps.
Esse commit está contido em:
@@ -6,9 +6,9 @@
|
||||
|
||||
$dir = dirname(__FILE__).'/';
|
||||
$base = 1234567890;
|
||||
touch($dir, $base);
|
||||
touch($dir.'dir', $base + 1);
|
||||
touch($dir.'empty', $base + 2);
|
||||
touch($dir.'file', $base + 3);
|
||||
touch($dir.'symlink', $base + 4);
|
||||
touch($dir.'fix_mtimes.inc', $base + 5);
|
||||
touch($dir, $base++);
|
||||
touch($dir.'dir', $base++);
|
||||
touch($dir.'empty', $base++);
|
||||
touch($dir.'file', $base++);
|
||||
touch($dir.'symlink', $base++);
|
||||
touch($dir.'fix_mtimes.inc', $base++);
|
||||
|
||||
Arquivo binário não exibido.
@@ -1,14 +1,22 @@
|
||||
<?php
|
||||
|
||||
chdir(__DIR__.'/../../..');
|
||||
require 'test/sample_dir/fix_mtimes.inc';
|
||||
|
||||
$d = dir("test/sample_dir/");
|
||||
echo "Path: " . $d->path . "\n";
|
||||
$files = array(); // order changes per machine
|
||||
while (false !== ($entry = $d->read())) {
|
||||
echo $entry."\n";
|
||||
$files[] = $entry."\n";
|
||||
}
|
||||
asort($files);
|
||||
var_dump(array_values($files));
|
||||
|
||||
$d->rewind();
|
||||
$files = array(); // order changes per machine
|
||||
while (false !== ($entry = $d->read())) {
|
||||
echo $entry."\n";
|
||||
$files[] = $entry."\n";
|
||||
}
|
||||
asort($files);
|
||||
var_dump(array_values($files));
|
||||
$d->close();
|
||||
|
||||
@@ -1,15 +1,47 @@
|
||||
Path: test/sample_dir/
|
||||
file
|
||||
..
|
||||
symlink
|
||||
fix_mtimes.inc
|
||||
dir
|
||||
.
|
||||
empty
|
||||
file
|
||||
..
|
||||
symlink
|
||||
fix_mtimes.inc
|
||||
dir
|
||||
.
|
||||
empty
|
||||
array(7) {
|
||||
[0]=>
|
||||
string(2) ".
|
||||
"
|
||||
[1]=>
|
||||
string(3) "..
|
||||
"
|
||||
[2]=>
|
||||
string(4) "dir
|
||||
"
|
||||
[3]=>
|
||||
string(6) "empty
|
||||
"
|
||||
[4]=>
|
||||
string(5) "file
|
||||
"
|
||||
[5]=>
|
||||
string(15) "fix_mtimes.inc
|
||||
"
|
||||
[6]=>
|
||||
string(8) "symlink
|
||||
"
|
||||
}
|
||||
array(7) {
|
||||
[0]=>
|
||||
string(2) ".
|
||||
"
|
||||
[1]=>
|
||||
string(3) "..
|
||||
"
|
||||
[2]=>
|
||||
string(4) "dir
|
||||
"
|
||||
[3]=>
|
||||
string(6) "empty
|
||||
"
|
||||
[4]=>
|
||||
string(5) "file
|
||||
"
|
||||
[5]=>
|
||||
string(15) "fix_mtimes.inc
|
||||
"
|
||||
[6]=>
|
||||
string(8) "symlink
|
||||
"
|
||||
}
|
||||
|
||||
+2
-2
@@ -504,13 +504,13 @@ array(9) {
|
||||
int(64)
|
||||
}
|
||||
Locale: 'EN-US-ODESSA'
|
||||
ULOC_VALID_LOCALE = 'en_US'
|
||||
ULOC_VALID_LOCALE = 'en_US%S'
|
||||
Locale: 'UK_UA_ODESSA'
|
||||
ULOC_VALID_LOCALE = 'uk_UA'
|
||||
Locale: 'uk-ua_CALIFORNIA@currency=;currency=GRN'
|
||||
ULOC_VALID_LOCALE = 'uk_UA'
|
||||
Locale: ''
|
||||
ULOC_VALID_LOCALE = 'en_US'
|
||||
ULOC_VALID_LOCALE = 'en_US%S'
|
||||
Locale: 'root'
|
||||
ULOC_VALID_LOCALE = 'root'
|
||||
Locale: 'uk@currency=EURO'
|
||||
@@ -1,5 +1,6 @@
|
||||
<?php
|
||||
|
||||
chdir(__DIR__.'/../../..');
|
||||
require 'test/sample_dir/fix_mtimes.inc';
|
||||
|
||||
$files = array();
|
||||
@@ -7,55 +8,70 @@ foreach (new DirectoryIterator('test/sample_dir/') as $file) {
|
||||
$files[] = $file;
|
||||
}
|
||||
var_dump(count($files));
|
||||
|
||||
$dir = new DirectoryIterator('test/sample_dir/');
|
||||
$files = array(); // order changes per machine
|
||||
foreach ($dir as $fileinfo) {
|
||||
if (!$fileinfo->isDot()) {
|
||||
var_dump($fileinfo->getFilename());
|
||||
$files[] = $fileinfo->getFilename();
|
||||
}
|
||||
}
|
||||
asort($files);
|
||||
var_dump(array_values($files));
|
||||
|
||||
$iterator = new DirectoryIterator("test/sample_dir");
|
||||
$files = array(); // order changes per machine
|
||||
foreach ($iterator as $fileinfo) {
|
||||
if ($fileinfo->isFile()) {
|
||||
echo "BEGIN: " . $fileinfo->getFilename() . "\n";
|
||||
echo $fileinfo->getCTime() . "\n";
|
||||
echo $fileinfo->getBasename() . "\n";
|
||||
echo $fileinfo->getBasename('.cpp') . "\n";
|
||||
echo $fileinfo->getGroup() . "\n";
|
||||
echo $fileinfo->getInode() . "\n";
|
||||
echo $fileinfo->getMTime() . "\n";
|
||||
echo $fileinfo->getOwner() . "\n";
|
||||
echo $fileinfo->getPerms() . "\n";
|
||||
echo $fileinfo->getSize() . "\n";
|
||||
echo $fileinfo->getType() . "\n";
|
||||
echo $fileinfo->isDir() . "\n";
|
||||
echo $fileinfo->isDot() . "\n";
|
||||
echo $fileinfo->isExecutable() . "\n";
|
||||
echo $fileinfo->isLink() . "\n";
|
||||
echo $fileinfo->isReadable() . "\n";
|
||||
echo $fileinfo->isWritable() . "\n";
|
||||
echo "END" . "\n";
|
||||
$files[$fileinfo->getFilename()] = $fileinfo;
|
||||
}
|
||||
}
|
||||
$iterator = new RecursiveDirectoryIterator("test/sample_dir");
|
||||
foreach ($iterator as $fileinfo) {
|
||||
if ($fileinfo->isFile()) {
|
||||
echo $fileinfo->getFilename() . "\n";
|
||||
echo $fileinfo->getCTime() . "\n";
|
||||
echo $fileinfo->getBasename() . "\n";
|
||||
echo $fileinfo->getBasename('.cpp') . "\n";
|
||||
echo $fileinfo->getFilename() . "\n";
|
||||
echo $fileinfo->getGroup() . "\n";
|
||||
echo $fileinfo->getInode() . "\n";
|
||||
echo $fileinfo->getMTime() . "\n";
|
||||
echo $fileinfo->getOwner() . "\n";
|
||||
echo $fileinfo->getPerms() . "\n";
|
||||
echo $fileinfo->getSize() . "\n";
|
||||
echo $fileinfo->getType() . "\n";
|
||||
echo $fileinfo->isDir() . "\n";
|
||||
echo $fileinfo->isExecutable() . "\n";
|
||||
echo $fileinfo->isLink() . "\n";
|
||||
echo $fileinfo->isReadable() . "\n";
|
||||
echo $fileinfo->isWritable() . "\n";
|
||||
}
|
||||
ksort($files);
|
||||
foreach ($files as $fileinfo) {
|
||||
echo "BEGIN: " . $fileinfo->getFilename() . "\n";
|
||||
echo $fileinfo->getCTime() . "\n";
|
||||
echo $fileinfo->getBasename() . "\n";
|
||||
echo $fileinfo->getBasename('.cpp') . "\n";
|
||||
echo $fileinfo->getGroup() . "\n";
|
||||
echo $fileinfo->getInode() . "\n";
|
||||
echo $fileinfo->getMTime() . "\n";
|
||||
echo $fileinfo->getOwner() . "\n";
|
||||
echo $fileinfo->getPerms() . "\n";
|
||||
echo $fileinfo->getSize() . "\n";
|
||||
echo $fileinfo->getType() . "\n";
|
||||
echo $fileinfo->isDir() . "\n";
|
||||
echo $fileinfo->isDot() . "\n";
|
||||
echo $fileinfo->isExecutable() . "\n";
|
||||
echo $fileinfo->isLink() . "\n";
|
||||
echo $fileinfo->isReadable() . "\n";
|
||||
echo $fileinfo->isWritable() . "\n";
|
||||
echo "END" . "\n";
|
||||
}
|
||||
|
||||
$iterator = new RecursiveDirectoryIterator("test/sample_dir");
|
||||
$files = array(); // order changes per machine
|
||||
foreach ($iterator as $fileinfo) {
|
||||
if ($fileinfo->isFile()) {
|
||||
$files[$fileinfo->getFilename()] = $fileinfo;
|
||||
}
|
||||
}
|
||||
ksort($files);
|
||||
foreach ($files as $fileinfo) {
|
||||
echo $fileinfo->getFilename() . "\n";
|
||||
echo $fileinfo->getCTime() . "\n";
|
||||
echo $fileinfo->getBasename() . "\n";
|
||||
echo $fileinfo->getBasename('.cpp') . "\n";
|
||||
echo $fileinfo->getFilename() . "\n";
|
||||
echo $fileinfo->getGroup() . "\n";
|
||||
echo $fileinfo->getInode() . "\n";
|
||||
echo $fileinfo->getMTime() . "\n";
|
||||
echo $fileinfo->getOwner() . "\n";
|
||||
echo $fileinfo->getPerms() . "\n";
|
||||
echo $fileinfo->getSize() . "\n";
|
||||
echo $fileinfo->getType() . "\n";
|
||||
echo $fileinfo->isDir() . "\n";
|
||||
echo $fileinfo->isExecutable() . "\n";
|
||||
echo $fileinfo->isLink() . "\n";
|
||||
echo $fileinfo->isReadable() . "\n";
|
||||
echo $fileinfo->isWritable() . "\n";
|
||||
}
|
||||
|
||||
@@ -1,146 +1,153 @@
|
||||
int(7)
|
||||
string(4) "file"
|
||||
string(7) "symlink"
|
||||
string(14) "fix_mtimes.inc"
|
||||
string(3) "dir"
|
||||
string(5) "empty"
|
||||
BEGIN: file
|
||||
array(5) {
|
||||
[0]=>
|
||||
string(3) "dir"
|
||||
[1]=>
|
||||
string(5) "empty"
|
||||
[2]=>
|
||||
string(4) "file"
|
||||
[3]=>
|
||||
string(14) "fix_mtimes.inc"
|
||||
[4]=>
|
||||
string(7) "symlink"
|
||||
}
|
||||
BEGIN:
|
||||
%d
|
||||
file
|
||||
file
|
||||
100
|
||||
|
||||
|
||||
%d
|
||||
1234567894
|
||||
2618
|
||||
33188
|
||||
3
|
||||
file
|
||||
|
||||
|
||||
%d
|
||||
%d
|
||||
%d
|
||||
16877
|
||||
4096
|
||||
dir
|
||||
1
|
||||
|
||||
1
|
||||
|
||||
1
|
||||
1
|
||||
END
|
||||
BEGIN: symlink
|
||||
BEGIN:
|
||||
%d
|
||||
symlink
|
||||
symlink
|
||||
100
|
||||
%d
|
||||
1234567894
|
||||
2618
|
||||
33188
|
||||
3
|
||||
link
|
||||
|
||||
|
||||
%d
|
||||
%d
|
||||
%d
|
||||
%d
|
||||
16877
|
||||
4096
|
||||
dir
|
||||
1
|
||||
|
||||
1
|
||||
1
|
||||
1
|
||||
END
|
||||
BEGIN: fix_mtimes.inc
|
||||
%d
|
||||
fix_mtimes.inc
|
||||
fix_mtimes.inc
|
||||
100
|
||||
%d
|
||||
1234567895
|
||||
2618
|
||||
33188
|
||||
383
|
||||
file
|
||||
|
||||
|
||||
|
||||
|
||||
1
|
||||
1
|
||||
END
|
||||
BEGIN: empty
|
||||
BEGIN:
|
||||
%d
|
||||
|
||||
|
||||
%d
|
||||
%d
|
||||
%d
|
||||
%d
|
||||
16877
|
||||
4096
|
||||
dir
|
||||
1
|
||||
|
||||
1
|
||||
|
||||
1
|
||||
1
|
||||
END
|
||||
BEGIN:
|
||||
%d
|
||||
|
||||
|
||||
%d
|
||||
%d
|
||||
%d
|
||||
%d
|
||||
16877
|
||||
4096
|
||||
dir
|
||||
1
|
||||
|
||||
1
|
||||
|
||||
1
|
||||
1
|
||||
END
|
||||
empty
|
||||
%d
|
||||
empty
|
||||
empty
|
||||
100
|
||||
empty
|
||||
%d
|
||||
%d
|
||||
1234567892
|
||||
2618
|
||||
33188
|
||||
0
|
||||
file
|
||||
|
||||
|
||||
|
||||
|
||||
1
|
||||
1
|
||||
END
|
||||
file
|
||||
%d
|
||||
file
|
||||
file
|
||||
file
|
||||
100
|
||||
%d
|
||||
1234567894
|
||||
2618
|
||||
33188
|
||||
3
|
||||
file
|
||||
|
||||
|
||||
|
||||
1
|
||||
1
|
||||
symlink
|
||||
%d
|
||||
symlink
|
||||
symlink
|
||||
symlink
|
||||
100
|
||||
%d
|
||||
1234567894
|
||||
2618
|
||||
33188
|
||||
3
|
||||
link
|
||||
|
||||
|
||||
1
|
||||
1
|
||||
1
|
||||
fix_mtimes.inc
|
||||
%d
|
||||
fix_mtimes.inc
|
||||
fix_mtimes.inc
|
||||
fix_mtimes.inc
|
||||
100
|
||||
%d
|
||||
1234567895
|
||||
2618
|
||||
33188
|
||||
383
|
||||
file
|
||||
|
||||
|
||||
|
||||
1
|
||||
1
|
||||
empty
|
||||
%d
|
||||
empty
|
||||
empty
|
||||
empty
|
||||
100
|
||||
%d
|
||||
1234567892
|
||||
2618
|
||||
33188
|
||||
0
|
||||
file
|
||||
|
||||
|
||||
|
||||
1
|
||||
1
|
||||
file
|
||||
%d
|
||||
file
|
||||
file
|
||||
file
|
||||
%d
|
||||
%d
|
||||
1234567894
|
||||
%d
|
||||
33188
|
||||
3
|
||||
file
|
||||
|
||||
|
||||
|
||||
1
|
||||
1
|
||||
fix_mtimes.inc
|
||||
%d
|
||||
fix_mtimes.inc
|
||||
fix_mtimes.inc
|
||||
fix_mtimes.inc
|
||||
%d
|
||||
%d
|
||||
1234567895
|
||||
%d
|
||||
33188
|
||||
375
|
||||
file
|
||||
|
||||
|
||||
|
||||
1
|
||||
1
|
||||
symlink
|
||||
%d
|
||||
symlink
|
||||
symlink
|
||||
symlink
|
||||
%d
|
||||
%d
|
||||
1234567894
|
||||
%d
|
||||
33188
|
||||
3
|
||||
link
|
||||
|
||||
|
||||
1
|
||||
1
|
||||
1
|
||||
|
||||
@@ -1,11 +1,15 @@
|
||||
<?php
|
||||
|
||||
chdir(__DIR__.'/../../..');
|
||||
require 'test/sample_dir/fix_mtimes.inc';
|
||||
|
||||
$dir = new DirectoryIterator('test/sample_dir');
|
||||
$files = array(); // order changes per machine
|
||||
while($dir->valid()) {
|
||||
if(!$dir->isDot()) {
|
||||
print $dir->current()."\n";
|
||||
$files[] = $dir->current()."\n";
|
||||
}
|
||||
$dir->next();
|
||||
}
|
||||
asort($files);
|
||||
var_dump(array_values($files));
|
||||
|
||||
@@ -1,5 +1,17 @@
|
||||
file
|
||||
symlink
|
||||
fix_mtimes.inc
|
||||
dir
|
||||
empty
|
||||
array(5) {
|
||||
[0]=>
|
||||
string(4) "dir
|
||||
"
|
||||
[1]=>
|
||||
string(6) "empty
|
||||
"
|
||||
[2]=>
|
||||
string(5) "file
|
||||
"
|
||||
[3]=>
|
||||
string(15) "fix_mtimes.inc
|
||||
"
|
||||
[4]=>
|
||||
string(8) "symlink
|
||||
"
|
||||
}
|
||||
|
||||
@@ -1,16 +1,20 @@
|
||||
<?php
|
||||
|
||||
chdir(__DIR__.'/../../..');
|
||||
require 'test/sample_dir/fix_mtimes.inc';
|
||||
|
||||
$ite=new RecursiveDirectoryIterator('test/sample_dir/');
|
||||
$bytestotal=0;
|
||||
$nbfiles=0;
|
||||
$files = array(); // order changes per machine
|
||||
foreach ($ite as $filename=>$cur) {
|
||||
if (substr($filename,-1)=='.') continue;
|
||||
$filesize=$cur->getSize();
|
||||
$bytestotal+=$filesize;
|
||||
$nbfiles++;
|
||||
echo "$filename => $filesize\n";
|
||||
$files[] = "$filename => $filesize\n";
|
||||
}
|
||||
asort($files);
|
||||
var_dump(array_values($files));
|
||||
$bytestotal=number_format($bytestotal);
|
||||
echo "Total: $nbfiles files, $bytestotal bytes\n";
|
||||
|
||||
@@ -1,6 +1,18 @@
|
||||
test/sample_dir/file => 3
|
||||
test/sample_dir/symlink => 3
|
||||
test/sample_dir/fix_mtimes.inc => 383
|
||||
test/sample_dir/dir => 4096
|
||||
test/sample_dir/empty => 0
|
||||
Total: 5 files, 4,485 bytes
|
||||
array(5) {
|
||||
[0]=>
|
||||
string(28) "test/sample_dir/dir => 4096
|
||||
"
|
||||
[1]=>
|
||||
string(27) "test/sample_dir/empty => 0
|
||||
"
|
||||
[2]=>
|
||||
string(26) "test/sample_dir/file => 3
|
||||
"
|
||||
[3]=>
|
||||
string(38) "test/sample_dir/fix_mtimes.inc => 375
|
||||
"
|
||||
[4]=>
|
||||
string(29) "test/sample_dir/symlink => 3
|
||||
"
|
||||
}
|
||||
Total: 5 files, 4,477 bytes
|
||||
|
||||
@@ -1,16 +1,20 @@
|
||||
<?php
|
||||
|
||||
chdir(__DIR__.'/../../..');
|
||||
require 'test/sample_dir/fix_mtimes.inc';
|
||||
|
||||
$ite=new RecursiveDirectoryIterator('test/sample_dir/');
|
||||
$bytestotal=0;
|
||||
$nbfiles=0;
|
||||
$files = array(); // order changes per machine
|
||||
foreach (new RecursiveIteratorIterator($ite) as $filename=>$cur) {
|
||||
if (substr($filename,-1)=='.') continue;
|
||||
$filesize=$cur->getSize();
|
||||
$bytestotal+=$filesize;
|
||||
$nbfiles++;
|
||||
echo "$filename => $filesize\n";
|
||||
$files[] = "$filename => $filesize\n";
|
||||
}
|
||||
asort($files);
|
||||
var_dump(array_values($files));
|
||||
$bytestotal=number_format($bytestotal);
|
||||
echo "Total: $nbfiles files, $bytestotal bytes\n";
|
||||
|
||||
@@ -1,6 +1,18 @@
|
||||
test/sample_dir/file => 3
|
||||
test/sample_dir/symlink => 3
|
||||
test/sample_dir/fix_mtimes.inc => 383
|
||||
test/sample_dir/dir/empty => 0
|
||||
test/sample_dir/empty => 0
|
||||
Total: 5 files, 389 bytes
|
||||
array(5) {
|
||||
[0]=>
|
||||
string(31) "test/sample_dir/dir/empty => 0
|
||||
"
|
||||
[1]=>
|
||||
string(27) "test/sample_dir/empty => 0
|
||||
"
|
||||
[2]=>
|
||||
string(26) "test/sample_dir/file => 3
|
||||
"
|
||||
[3]=>
|
||||
string(38) "test/sample_dir/fix_mtimes.inc => 375
|
||||
"
|
||||
[4]=>
|
||||
string(29) "test/sample_dir/symlink => 3
|
||||
"
|
||||
}
|
||||
Total: 5 files, 381 bytes
|
||||
|
||||
@@ -1,10 +1,17 @@
|
||||
<?php
|
||||
|
||||
chdir(__DIR__.'/../../..');
|
||||
require 'test/sample_dir/fix_mtimes.inc';
|
||||
|
||||
$path = "test/sample_dir/";
|
||||
foreach (new RecursiveIteratorIterator( new RecursiveDirectoryIterator($path, RecursiveDirectoryIterator::KEY_AS_PATHNAME), RecursiveIteratorIterator::CHILD_FIRST) as $file => $info) {
|
||||
$files = array(); // order changes per machine
|
||||
foreach (new RecursiveIteratorIterator(
|
||||
new RecursiveDirectoryIterator($path,
|
||||
RecursiveDirectoryIterator::KEY_AS_PATHNAME),
|
||||
RecursiveIteratorIterator::CHILD_FIRST) as $file => $info) {
|
||||
if ($info->isDir() && substr($file,-1)!='.') {
|
||||
echo $file."\n";
|
||||
$files[] = $file."\n";
|
||||
}
|
||||
}
|
||||
asort($files);
|
||||
var_dump(array_values($files));
|
||||
|
||||
@@ -1 +1,5 @@
|
||||
test/sample_dir/dir
|
||||
array(1) {
|
||||
[0]=>
|
||||
string(20) "test/sample_dir/dir
|
||||
"
|
||||
}
|
||||
|
||||
@@ -1,25 +1,48 @@
|
||||
<?php
|
||||
|
||||
chdir(__DIR__.'/../../..');
|
||||
require 'test/sample_dir/fix_mtimes.inc';
|
||||
|
||||
$directory = "test/sample_dir";
|
||||
$fileSPLObjects = new RecursiveIteratorIterator( new RecursiveDirectoryIterator($directory), RecursiveIteratorIterator::SELF_FIRST);
|
||||
$fileSPLObjects = new RecursiveIteratorIterator(
|
||||
new RecursiveDirectoryIterator($directory),
|
||||
RecursiveIteratorIterator::SELF_FIRST);
|
||||
$files = array(); // order changes per machine
|
||||
foreach( $fileSPLObjects as $fullFileName => $fileSPLObject ) {
|
||||
if (substr($fullFileName,-1)=='.') continue;
|
||||
print $fullFileName . " " .$fileSPLObject->getFilename(). "\n";
|
||||
$files[] = $fullFileName . " " .$fileSPLObject->getFilename(). "\n";
|
||||
}
|
||||
$fileSPLObjects = new RecursiveIteratorIterator( new RecursiveDirectoryIterator($directory), RecursiveIteratorIterator::CHILD_FIRST);
|
||||
asort($files);
|
||||
var_dump(array_values($files));
|
||||
|
||||
$fileSPLObjects = new RecursiveIteratorIterator(
|
||||
new RecursiveDirectoryIterator($directory),
|
||||
RecursiveIteratorIterator::CHILD_FIRST);
|
||||
$files = array(); // order changes per machine
|
||||
foreach( $fileSPLObjects as $fullFileName => $fileSPLObject ) {
|
||||
if (substr($fullFileName,-1)=='.') continue;
|
||||
print $fullFileName . " " .$fileSPLObject->getFilename(). "\n";
|
||||
$files[] = $fullFileName . " " .$fileSPLObject->getFilename(). "\n";
|
||||
}
|
||||
$fileSPLObjects = new RecursiveIteratorIterator( new RecursiveDirectoryIterator($directory), RecursiveIteratorIterator::LEAVES_ONLY);
|
||||
asort($files);
|
||||
var_dump(array_values($files));
|
||||
|
||||
$fileSPLObjects = new RecursiveIteratorIterator(
|
||||
new RecursiveDirectoryIterator($directory),
|
||||
RecursiveIteratorIterator::LEAVES_ONLY);
|
||||
$files = array(); // order changes per machine
|
||||
foreach( $fileSPLObjects as $fullFileName => $fileSPLObject ) {
|
||||
if (substr($fullFileName,-1)=='.') continue;
|
||||
print $fullFileName . " " .$fileSPLObject->getFilename(). "\n";
|
||||
$files[] = $fullFileName . " " .$fileSPLObject->getFilename(). "\n";
|
||||
}
|
||||
// invalid mode -100$fileSPLObjects = new RecursiveIteratorIterator( new RecursiveDirectoryIterator($directory), -100);
|
||||
asort($files);
|
||||
var_dump(array_values($files));
|
||||
|
||||
// invalid mode -100$fileSPLObjects = new RecursiveIteratorIterator(
|
||||
// new RecursiveDirectoryIterator($directory), -100);
|
||||
$files = array(); // order changes per machine
|
||||
foreach( $fileSPLObjects as $fullFileName => $fileSPLObject ) {
|
||||
if (substr($fullFileName,-1)=='.') continue;
|
||||
print $fullFileName . " " .$fileSPLObject->getFilename(). "\n";
|
||||
$files[] = $fullFileName . " " .$fileSPLObject->getFilename(). "\n";
|
||||
}
|
||||
asort($files);
|
||||
var_dump(array_values($files));
|
||||
|
||||
@@ -1,22 +1,74 @@
|
||||
test/sample_dir/file file
|
||||
test/sample_dir/symlink symlink
|
||||
test/sample_dir/fix_mtimes.inc fix_mtimes.inc
|
||||
test/sample_dir/dir dir
|
||||
test/sample_dir/dir/empty empty
|
||||
test/sample_dir/empty empty
|
||||
test/sample_dir/file file
|
||||
test/sample_dir/symlink symlink
|
||||
test/sample_dir/fix_mtimes.inc fix_mtimes.inc
|
||||
test/sample_dir/dir/empty empty
|
||||
test/sample_dir/dir dir
|
||||
test/sample_dir/empty empty
|
||||
test/sample_dir/file file
|
||||
test/sample_dir/symlink symlink
|
||||
test/sample_dir/fix_mtimes.inc fix_mtimes.inc
|
||||
test/sample_dir/dir/empty empty
|
||||
test/sample_dir/empty empty
|
||||
test/sample_dir/file file
|
||||
test/sample_dir/symlink symlink
|
||||
test/sample_dir/fix_mtimes.inc fix_mtimes.inc
|
||||
test/sample_dir/dir/empty empty
|
||||
test/sample_dir/empty empty
|
||||
array(6) {
|
||||
[0]=>
|
||||
string(24) "test/sample_dir/dir dir
|
||||
"
|
||||
[1]=>
|
||||
string(32) "test/sample_dir/dir/empty empty
|
||||
"
|
||||
[2]=>
|
||||
string(28) "test/sample_dir/empty empty
|
||||
"
|
||||
[3]=>
|
||||
string(26) "test/sample_dir/file file
|
||||
"
|
||||
[4]=>
|
||||
string(46) "test/sample_dir/fix_mtimes.inc fix_mtimes.inc
|
||||
"
|
||||
[5]=>
|
||||
string(32) "test/sample_dir/symlink symlink
|
||||
"
|
||||
}
|
||||
array(6) {
|
||||
[0]=>
|
||||
string(24) "test/sample_dir/dir dir
|
||||
"
|
||||
[1]=>
|
||||
string(32) "test/sample_dir/dir/empty empty
|
||||
"
|
||||
[2]=>
|
||||
string(28) "test/sample_dir/empty empty
|
||||
"
|
||||
[3]=>
|
||||
string(26) "test/sample_dir/file file
|
||||
"
|
||||
[4]=>
|
||||
string(46) "test/sample_dir/fix_mtimes.inc fix_mtimes.inc
|
||||
"
|
||||
[5]=>
|
||||
string(32) "test/sample_dir/symlink symlink
|
||||
"
|
||||
}
|
||||
array(5) {
|
||||
[0]=>
|
||||
string(32) "test/sample_dir/dir/empty empty
|
||||
"
|
||||
[1]=>
|
||||
string(28) "test/sample_dir/empty empty
|
||||
"
|
||||
[2]=>
|
||||
string(26) "test/sample_dir/file file
|
||||
"
|
||||
[3]=>
|
||||
string(46) "test/sample_dir/fix_mtimes.inc fix_mtimes.inc
|
||||
"
|
||||
[4]=>
|
||||
string(32) "test/sample_dir/symlink symlink
|
||||
"
|
||||
}
|
||||
array(5) {
|
||||
[0]=>
|
||||
string(32) "test/sample_dir/dir/empty empty
|
||||
"
|
||||
[1]=>
|
||||
string(28) "test/sample_dir/empty empty
|
||||
"
|
||||
[2]=>
|
||||
string(26) "test/sample_dir/file file
|
||||
"
|
||||
[3]=>
|
||||
string(46) "test/sample_dir/fix_mtimes.inc fix_mtimes.inc
|
||||
"
|
||||
[4]=>
|
||||
string(32) "test/sample_dir/symlink symlink
|
||||
"
|
||||
}
|
||||
|
||||
@@ -1,16 +1,21 @@
|
||||
<?php
|
||||
|
||||
chdir(__DIR__.'/../../..');
|
||||
require 'test/sample_dir/fix_mtimes.inc';
|
||||
|
||||
function getFiles(&$rdi,$depth=0) {
|
||||
if (!is_object($rdi)) return;
|
||||
$files = array(); // order changes per machine
|
||||
for ($rdi->rewind(); $rdi->valid(); $rdi->next()) {
|
||||
if ($rdi->isDot()) continue;
|
||||
if ($rdi->isDir() || $rdi->isFile()) {
|
||||
for ($i = 0; $i<=$depth; ++$i) echo " ";
|
||||
echo $rdi->current()."\n";
|
||||
$indent = '';
|
||||
for ($i = 0; $i<=$depth; ++$i) $indent .= " ";
|
||||
$files[] = $indent.$rdi->current()."\n";
|
||||
if ($rdi->hasChildren()) getFiles($rdi->getChildren(),1+$depth);
|
||||
}
|
||||
}
|
||||
asort($files);
|
||||
var_dump(array_values($files));
|
||||
}
|
||||
getFiles(new RecursiveDirectoryIterator('test/sample_dir'));
|
||||
|
||||
@@ -1,6 +1,22 @@
|
||||
test/sample_dir/file
|
||||
test/sample_dir/symlink
|
||||
test/sample_dir/fix_mtimes.inc
|
||||
test/sample_dir/dir
|
||||
test/sample_dir/dir/empty
|
||||
test/sample_dir/empty
|
||||
array(1) {
|
||||
[0]=>
|
||||
string(28) " test/sample_dir/dir/empty
|
||||
"
|
||||
}
|
||||
array(5) {
|
||||
[0]=>
|
||||
string(21) " test/sample_dir/dir
|
||||
"
|
||||
[1]=>
|
||||
string(23) " test/sample_dir/empty
|
||||
"
|
||||
[2]=>
|
||||
string(22) " test/sample_dir/file
|
||||
"
|
||||
[3]=>
|
||||
string(32) " test/sample_dir/fix_mtimes.inc
|
||||
"
|
||||
[4]=>
|
||||
string(25) " test/sample_dir/symlink
|
||||
"
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
<?php
|
||||
|
||||
chdir(__DIR__.'/../../..');
|
||||
require 'test/sample_dir/fix_mtimes.inc';
|
||||
|
||||
$info = new SplFileInfo('test/sample_dir');
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
%s/hphp/test/sample_dirstring(4) "file"
|
||||
string(4) "file"
|
||||
int(%d)
|
||||
int(100)
|
||||
int(%d)
|
||||
int(%d)
|
||||
int(1234567894)
|
||||
int(2618)
|
||||
int(%d)
|
||||
int(33188)
|
||||
int(3)
|
||||
string(4) "file"
|
||||
|
||||
@@ -1,3 +1,22 @@
|
||||
<?php
|
||||
|
||||
$info = new SplFileInfo('test/sample_dir');var_dump($info->getRealPath());var_dump($info->getPath());var_dump($info->getPathName());$info = new SplFileInfo('test/sample_dir/');var_dump($info->getRealPath());var_dump($info->getPath());var_dump($info->getPathName());$info = new SplFileInfo('test/sample_dir//../sample_dir');var_dump($info->getRealPath());var_dump($info->getPath());var_dump($info->getPathName());$p=realpath('test');$info = new SplFileInfo($p.'/sample_dir/symlink');var_dump($info->getLinkTarget());var_dump($info->getRealPath());var_dump($info->getPath());var_dump($info->getPathName());
|
||||
chdir(__DIR__.'/../../..');
|
||||
|
||||
$info = new SplFileInfo('test/sample_dir');
|
||||
var_dump($info->getRealPath());
|
||||
var_dump($info->getPath());
|
||||
var_dump($info->getPathName());
|
||||
$info = new SplFileInfo('test/sample_dir/');
|
||||
var_dump($info->getRealPath());
|
||||
var_dump($info->getPath());
|
||||
var_dump($info->getPathName());
|
||||
$info = new SplFileInfo('test/sample_dir//../sample_dir');
|
||||
var_dump($info->getRealPath());
|
||||
var_dump($info->getPath());
|
||||
var_dump($info->getPathName());
|
||||
$p=realpath('test');
|
||||
$info = new SplFileInfo($p.'/sample_dir/symlink');
|
||||
var_dump($info->getLinkTarget());
|
||||
var_dump($info->getRealPath());
|
||||
var_dump($info->getPath());
|
||||
var_dump($info->getPathName());
|
||||
|
||||
Referência em uma Nova Issue
Bloquear um usuário