fix slow tests
These tests have machine dependant things in them. Copy Zend and change the machine things to %s. @override-unit-failures
Esse commit está contido em:
@@ -0,0 +1,14 @@
|
||||
<?php
|
||||
/**
|
||||
* require this in your tests if you want to make sure the mtimes and iterator
|
||||
* order of files in this directory is consistent
|
||||
*/
|
||||
|
||||
$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);
|
||||
Arquivo binário não exibido.
Arquivo binário não exibido.
@@ -1,3 +1,14 @@
|
||||
<?php
|
||||
|
||||
$d = dir("test/sample_dir/");echo "Path: " . $d->path . "\n";while (false !== ($entry = $d->read())) { echo $entry."\n";}$d->rewind();while (false !== ($entry = $d->read())) { echo $entry."\n";}$d->close();
|
||||
require 'test/sample_dir/fix_mtimes.inc';
|
||||
|
||||
$d = dir("test/sample_dir/");
|
||||
echo "Path: " . $d->path . "\n";
|
||||
while (false !== ($entry = $d->read())) {
|
||||
echo $entry."\n";
|
||||
}
|
||||
$d->rewind();
|
||||
while (false !== ($entry = $d->read())) {
|
||||
echo $entry."\n";
|
||||
}
|
||||
$d->close();
|
||||
|
||||
@@ -2,12 +2,14 @@ Path: test/sample_dir/
|
||||
file
|
||||
..
|
||||
symlink
|
||||
fix_mtimes.inc
|
||||
dir
|
||||
.
|
||||
empty
|
||||
file
|
||||
..
|
||||
symlink
|
||||
fix_mtimes.inc
|
||||
dir
|
||||
.
|
||||
empty
|
||||
|
||||
@@ -1,3 +1,25 @@
|
||||
<?php
|
||||
|
||||
$exif = exif_read_data('test/images/246x247.png');print_r($exif);$exif = exif_read_data('test/images/php.gif');print_r($exif);$exif = exif_read_data('test/images/simpletext.jpg');print_r($exif);$exif = exif_read_data('test/images/smile.happy.png');print_r($exif);$exif = exif_read_data('test/images/test1pix.jpg');print_r($exif);$exif = exif_read_data('test/images/test2.jpg');print_r($exif);
|
||||
touch('test/images/246x247.png', 1234567890);
|
||||
$exif = exif_read_data('test/images/246x247.png');
|
||||
print_r($exif);
|
||||
|
||||
touch('test/images/php.gif', 1234567890);
|
||||
$exif = exif_read_data('test/images/php.gif');
|
||||
print_r($exif);
|
||||
|
||||
touch('test/images/simpletext.jpg', 1234567890);
|
||||
$exif = exif_read_data('test/images/simpletext.jpg');
|
||||
print_r($exif);
|
||||
|
||||
touch('test/images/smile.happy.png', 1234567890);
|
||||
$exif = exif_read_data('test/images/smile.happy.png');
|
||||
print_r($exif);
|
||||
|
||||
touch('test/images/test1pix.jpg', 1234567890);
|
||||
$exif = exif_read_data('test/images/test1pix.jpg');
|
||||
print_r($exif);
|
||||
|
||||
touch('test/images/test2.jpg', 1234567890);
|
||||
$exif = exif_read_data('test/images/test2.jpg');
|
||||
print_r($exif);
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
Array
|
||||
(
|
||||
[FileName] => simpletext.jpg
|
||||
[FileDateTime] => 1365574959
|
||||
[FileDateTime] => 1234567890
|
||||
[FileSize] => 1298
|
||||
[FileType] => 2
|
||||
[MimeType] => image/jpeg
|
||||
@@ -24,7 +24,7 @@ Array
|
||||
Array
|
||||
(
|
||||
[FileName] => test1pix.jpg
|
||||
[FileDateTime] => 1365574959
|
||||
[FileDateTime] => 1234567890
|
||||
[FileSize] => 523
|
||||
[FileType] => 2
|
||||
[MimeType] => image/jpeg
|
||||
@@ -41,7 +41,7 @@ Array
|
||||
Array
|
||||
(
|
||||
[FileName] => test2.jpg
|
||||
[FileDateTime] => 1365574959
|
||||
[FileDateTime] => 1234567890
|
||||
[FileSize] => 122298
|
||||
[FileType] => 2
|
||||
[MimeType] => image/jpeg
|
||||
|
||||
@@ -1,3 +1,61 @@
|
||||
<?php
|
||||
|
||||
$files = array();foreach (new DirectoryIterator('test/sample_dir/') as $file) { $files[] = $file;}var_dump(count($files));$dir = new DirectoryIterator('test/sample_dir/');foreach ($dir as $fileinfo) { if (!$fileinfo->isDot()) { var_dump($fileinfo->getFilename()); }}$iterator = new DirectoryIterator("test/sample_dir");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"; }}$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"; }}
|
||||
require 'test/sample_dir/fix_mtimes.inc';
|
||||
|
||||
$files = array();
|
||||
foreach (new DirectoryIterator('test/sample_dir/') as $file) {
|
||||
$files[] = $file;
|
||||
}
|
||||
var_dump(count($files));
|
||||
$dir = new DirectoryIterator('test/sample_dir/');
|
||||
foreach ($dir as $fileinfo) {
|
||||
if (!$fileinfo->isDot()) {
|
||||
var_dump($fileinfo->getFilename());
|
||||
}
|
||||
}
|
||||
$iterator = new DirectoryIterator("test/sample_dir");
|
||||
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";
|
||||
}
|
||||
}
|
||||
$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";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+55
-19
@@ -1,15 +1,16 @@
|
||||
int(6)
|
||||
int(7)
|
||||
string(4) "file"
|
||||
string(7) "symlink"
|
||||
string(14) "fix_mtimes.inc"
|
||||
string(3) "dir"
|
||||
string(5) "empty"
|
||||
BEGIN: file
|
||||
1365834782
|
||||
%d
|
||||
file
|
||||
file
|
||||
100
|
||||
453935113
|
||||
1365834782
|
||||
%d
|
||||
1234567894
|
||||
2618
|
||||
33188
|
||||
3
|
||||
@@ -22,12 +23,12 @@ file
|
||||
1
|
||||
END
|
||||
BEGIN: symlink
|
||||
1365834782
|
||||
%d
|
||||
symlink
|
||||
symlink
|
||||
100
|
||||
453935113
|
||||
1365834782
|
||||
%d
|
||||
1234567894
|
||||
2618
|
||||
33188
|
||||
3
|
||||
@@ -36,16 +37,34 @@ link
|
||||
|
||||
|
||||
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
|
||||
1365834782
|
||||
%d
|
||||
empty
|
||||
empty
|
||||
100
|
||||
453935110
|
||||
1365834782
|
||||
%d
|
||||
1234567892
|
||||
2618
|
||||
33188
|
||||
0
|
||||
@@ -58,13 +77,13 @@ file
|
||||
1
|
||||
END
|
||||
file
|
||||
1365834782
|
||||
%d
|
||||
file
|
||||
file
|
||||
file
|
||||
100
|
||||
453935113
|
||||
1365834782
|
||||
%d
|
||||
1234567894
|
||||
2618
|
||||
33188
|
||||
3
|
||||
@@ -75,13 +94,13 @@ file
|
||||
1
|
||||
1
|
||||
symlink
|
||||
1365834782
|
||||
%d
|
||||
symlink
|
||||
symlink
|
||||
symlink
|
||||
100
|
||||
453935113
|
||||
1365834782
|
||||
%d
|
||||
1234567894
|
||||
2618
|
||||
33188
|
||||
3
|
||||
@@ -89,16 +108,33 @@ 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
|
||||
1365834782
|
||||
%d
|
||||
empty
|
||||
empty
|
||||
empty
|
||||
100
|
||||
453935110
|
||||
1365834782
|
||||
%d
|
||||
1234567892
|
||||
2618
|
||||
33188
|
||||
0
|
||||
@@ -1,3 +1,11 @@
|
||||
<?php
|
||||
|
||||
$dir = new DirectoryIterator('test/sample_dir');while($dir->valid()) { if(!$dir->isDot()) { print $dir->current()."\n"; } $dir->next();}
|
||||
require 'test/sample_dir/fix_mtimes.inc';
|
||||
|
||||
$dir = new DirectoryIterator('test/sample_dir');
|
||||
while($dir->valid()) {
|
||||
if(!$dir->isDot()) {
|
||||
print $dir->current()."\n";
|
||||
}
|
||||
$dir->next();
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
file
|
||||
symlink
|
||||
fix_mtimes.inc
|
||||
dir
|
||||
empty
|
||||
|
||||
@@ -1,3 +1,16 @@
|
||||
<?php
|
||||
|
||||
$ite=new RecursiveDirectoryIterator('test/sample_dir/');$bytestotal=0;$nbfiles=0;foreach ($ite as $filename=>$cur) { if (substr($filename,-1)=='.') continue; $filesize=$cur->getSize(); $bytestotal+=$filesize; $nbfiles++; echo "$filename => $filesize\n";}$bytestotal=number_format($bytestotal);echo "Total: $nbfiles files, $bytestotal bytes\n";
|
||||
require 'test/sample_dir/fix_mtimes.inc';
|
||||
|
||||
$ite=new RecursiveDirectoryIterator('test/sample_dir/');
|
||||
$bytestotal=0;
|
||||
$nbfiles=0;
|
||||
foreach ($ite as $filename=>$cur) {
|
||||
if (substr($filename,-1)=='.') continue;
|
||||
$filesize=$cur->getSize();
|
||||
$bytestotal+=$filesize;
|
||||
$nbfiles++;
|
||||
echo "$filename => $filesize\n";
|
||||
}
|
||||
$bytestotal=number_format($bytestotal);
|
||||
echo "Total: $nbfiles files, $bytestotal bytes\n";
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
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: 4 files, 4,102 bytes
|
||||
Total: 5 files, 4,485 bytes
|
||||
|
||||
@@ -1,3 +1,16 @@
|
||||
<?php
|
||||
|
||||
$ite=new RecursiveDirectoryIterator('test/sample_dir/');$bytestotal=0;$nbfiles=0;foreach (new RecursiveIteratorIterator($ite) as $filename=>$cur) { if (substr($filename,-1)=='.') continue; $filesize=$cur->getSize(); $bytestotal+=$filesize; $nbfiles++; echo "$filename => $filesize\n";}$bytestotal=number_format($bytestotal);echo "Total: $nbfiles files, $bytestotal bytes\n";
|
||||
require 'test/sample_dir/fix_mtimes.inc';
|
||||
|
||||
$ite=new RecursiveDirectoryIterator('test/sample_dir/');
|
||||
$bytestotal=0;
|
||||
$nbfiles=0;
|
||||
foreach (new RecursiveIteratorIterator($ite) as $filename=>$cur) {
|
||||
if (substr($filename,-1)=='.') continue;
|
||||
$filesize=$cur->getSize();
|
||||
$bytestotal+=$filesize;
|
||||
$nbfiles++;
|
||||
echo "$filename => $filesize\n";
|
||||
}
|
||||
$bytestotal=number_format($bytestotal);
|
||||
echo "Total: $nbfiles files, $bytestotal bytes\n";
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
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: 4 files, 6 bytes
|
||||
Total: 5 files, 389 bytes
|
||||
|
||||
@@ -1,3 +1,10 @@
|
||||
<?php
|
||||
|
||||
$path = "test/sample_dir/";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"; }}
|
||||
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) {
|
||||
if ($info->isDir() && substr($file,-1)!='.') {
|
||||
echo $file."\n";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,3 +1,25 @@
|
||||
<?php
|
||||
|
||||
$directory = "test/sample_dir";$fileSPLObjects = new RecursiveIteratorIterator( new RecursiveDirectoryIterator($directory), RecursiveIteratorIterator::SELF_FIRST);foreach( $fileSPLObjects as $fullFileName => $fileSPLObject ) { if (substr($fullFileName,-1)=='.') continue; print $fullFileName . " " .$fileSPLObject->getFilename(). "\n";}$fileSPLObjects = new RecursiveIteratorIterator( new RecursiveDirectoryIterator($directory), RecursiveIteratorIterator::CHILD_FIRST);foreach( $fileSPLObjects as $fullFileName => $fileSPLObject ) { if (substr($fullFileName,-1)=='.') continue; print $fullFileName . " " .$fileSPLObject->getFilename(). "\n";}$fileSPLObjects = new RecursiveIteratorIterator( new RecursiveDirectoryIterator($directory), RecursiveIteratorIterator::LEAVES_ONLY);foreach( $fileSPLObjects as $fullFileName => $fileSPLObject ) { if (substr($fullFileName,-1)=='.') continue; print $fullFileName . " " .$fileSPLObject->getFilename(). "\n";}// invalid mode -100$fileSPLObjects = new RecursiveIteratorIterator( new RecursiveDirectoryIterator($directory), -100);foreach( $fileSPLObjects as $fullFileName => $fileSPLObject ) { if (substr($fullFileName,-1)=='.') continue; print $fullFileName . " " .$fileSPLObject->getFilename(). "\n";}
|
||||
require 'test/sample_dir/fix_mtimes.inc';
|
||||
|
||||
$directory = "test/sample_dir";
|
||||
$fileSPLObjects = new RecursiveIteratorIterator( new RecursiveDirectoryIterator($directory), RecursiveIteratorIterator::SELF_FIRST);
|
||||
foreach( $fileSPLObjects as $fullFileName => $fileSPLObject ) {
|
||||
if (substr($fullFileName,-1)=='.') continue;
|
||||
print $fullFileName . " " .$fileSPLObject->getFilename(). "\n";
|
||||
}
|
||||
$fileSPLObjects = new RecursiveIteratorIterator( new RecursiveDirectoryIterator($directory), RecursiveIteratorIterator::CHILD_FIRST);
|
||||
foreach( $fileSPLObjects as $fullFileName => $fileSPLObject ) {
|
||||
if (substr($fullFileName,-1)=='.') continue;
|
||||
print $fullFileName . " " .$fileSPLObject->getFilename(). "\n";
|
||||
}
|
||||
$fileSPLObjects = new RecursiveIteratorIterator( new RecursiveDirectoryIterator($directory), RecursiveIteratorIterator::LEAVES_ONLY);
|
||||
foreach( $fileSPLObjects as $fullFileName => $fileSPLObject ) {
|
||||
if (substr($fullFileName,-1)=='.') continue;
|
||||
print $fullFileName . " " .$fileSPLObject->getFilename(). "\n";
|
||||
}
|
||||
// invalid mode -100$fileSPLObjects = new RecursiveIteratorIterator( new RecursiveDirectoryIterator($directory), -100);
|
||||
foreach( $fileSPLObjects as $fullFileName => $fileSPLObject ) {
|
||||
if (substr($fullFileName,-1)=='.') continue;
|
||||
print $fullFileName . " " .$fileSPLObject->getFilename(). "\n";
|
||||
}
|
||||
|
||||
@@ -1,14 +1,22 @@
|
||||
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
|
||||
|
||||
@@ -1,3 +1,16 @@
|
||||
<?php
|
||||
|
||||
function getFiles(&$rdi,$depth=0) { if (!is_object($rdi)) return; 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"; if ($rdi->hasChildren()) getFiles($rdi->getChildren(),1+$depth); } }}getFiles(new RecursiveDirectoryIterator('test/sample_dir'));
|
||||
require 'test/sample_dir/fix_mtimes.inc';
|
||||
|
||||
function getFiles(&$rdi,$depth=0) {
|
||||
if (!is_object($rdi)) return;
|
||||
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";
|
||||
if ($rdi->hasChildren()) getFiles($rdi->getChildren(),1+$depth);
|
||||
}
|
||||
}
|
||||
}
|
||||
getFiles(new RecursiveDirectoryIterator('test/sample_dir'));
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
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
|
||||
|
||||
@@ -1,3 +1,24 @@
|
||||
<?php
|
||||
|
||||
$info = new SplFileInfo('test/sample_dir');if (!$info->isFile()) { echo $info->getRealPath();}$info = new SplFileInfo('test/sample_dir/file');var_dump($info->getbaseName());var_dump($info->getbaseName('.cpp'));echo 'Last changed at ' . date('g:i a', $info->getCTime());var_dump($info->getGroup());var_dump($info->getInode());var_dump($info->getMTime());var_dump($info->getOwner());var_dump($info->getPerms());var_dump($info->getSize());var_dump($info->getType());var_dump($info->isDir());var_dump($info->isFile());var_dump($info->isLink());var_dump($info->isReadable());var_dump($info->isWritable());
|
||||
require 'test/sample_dir/fix_mtimes.inc';
|
||||
|
||||
$info = new SplFileInfo('test/sample_dir');
|
||||
if (!$info->isFile()) {
|
||||
echo $info->getRealPath();
|
||||
}
|
||||
$info = new SplFileInfo('test/sample_dir/file');
|
||||
var_dump($info->getbaseName());
|
||||
var_dump($info->getbaseName('.cpp'));
|
||||
var_dump($info->getCTime());
|
||||
var_dump($info->getGroup());
|
||||
var_dump($info->getInode());
|
||||
var_dump($info->getMTime());
|
||||
var_dump($info->getOwner());
|
||||
var_dump($info->getPerms());
|
||||
var_dump($info->getSize());
|
||||
var_dump($info->getType());
|
||||
var_dump($info->isDir());
|
||||
var_dump($info->isFile());
|
||||
var_dump($info->isLink());
|
||||
var_dump($info->isReadable());
|
||||
var_dump($info->isWritable());
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
%s/hphp/test/sample_dirstring(4) "file"
|
||||
string(4) "file"
|
||||
Last changed at 11:33 pmint(100)
|
||||
int(453935113)
|
||||
int(1365834782)
|
||||
int(%d)
|
||||
int(100)
|
||||
int(%d)
|
||||
int(1234567894)
|
||||
int(2618)
|
||||
int(33188)
|
||||
int(3)
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
string() "%s/hphp/test/sample_dir"
|
||||
string(%d) "%s/hphp/test/sample_dir"
|
||||
string(4) "test"
|
||||
string(15) "test/sample_dir"
|
||||
string() "%s/hphp/test/sample_dir"
|
||||
string(%d) "%s/hphp/test/sample_dir"
|
||||
string(4) "test"
|
||||
string(15) "test/sample_dir"
|
||||
string() "%s/hphp/test/sample_dir"
|
||||
string(%d) "%s/hphp/test/sample_dir"
|
||||
string(19) "test/sample_dir//.."
|
||||
string(30) "test/sample_dir//../sample_dir"
|
||||
string(4) "file"
|
||||
string() "%s/hphp/test/sample_dir/file"
|
||||
string() "%s/hphp/test/sample_dir"
|
||||
string() "%s/hphp/test/sample_dir/symlink"
|
||||
string(%d) "%s/hphp/test/sample_dir/file"
|
||||
string(%d) "%s/hphp/test/sample_dir"
|
||||
string(%d) "%s/hphp/test/sample_dir/symlink"
|
||||
|
||||
Referência em uma Nova Issue
Bloquear um usuário