Ejemplo n.º 1
0
<?php

$fileName = 'filename.txt';
$fileInfo = new SPLFileInfo($fileName);
$fileProps = array();
$fileProps['path'] = $fileInfo->getPath();
$fileProps['filename'] = $fileInfo->getFilename();
$fileProps['pathname'] = $fileInfo->getPathname();
$fileProps['perms'] = $fileInfo->getPerms();
$fileProps['inode'] = $fileInfo->getInode();
$fileProps['size'] = $fileInfo->getSize();
$fileProps['owner'] = $fileInfo->getOwner();
$fileProps['group'] = $fileInfo->getGroup();
$fileProps['atime'] = $fileInfo->getATime();
$fileProps['mtime'] = $fileInfo->getMTime();
$fileProps['ctime'] = $fileInfo->getCTime();
$fileProps['type'] = $fileInfo->getType();
$fileProps['isWritable'] = $fileInfo->isWritable();
$fileProps['isReadable'] = $fileInfo->isReadable();
$fileProps['isExecutable'] = $fileInfo->isExecutable();
$fileProps['isFile'] = $fileInfo->isFile();
$fileProps['isDir'] = $fileInfo->isDir();
$fileProps['isLink'] = $fileInfo->isLink();
var_export($fileProps);
Ejemplo n.º 2
0
 public function cTime()
 {
     return parent::getCTime();
 }
Ejemplo n.º 3
0
require '../vendor/autoload.php';
# instantiate the backup
$backup = new Backup([]);
$backup->addFolder('../vendor')->compressWith('zip')->saveAt(['local']);
var_dump("Backup: {$backup}");
$file = new SPLFileInfo(realpath('../src/Backup.php'));
$inspected = $backup->inspect();
echo '<ul>';
foreach ($inspected as $class => $data) {
    echo '<li><h2><code>' . $class . '</h2></code>';
    echo '<ul>';
    foreach ($data as $key => $values) {
        echo '<li><h3><code>' . $key . '</h3></code>';
        echo '<ul id="' . $key . '">';
        foreach ($values as $value) {
            if ($value instanceof \ReflectionProperty) {
                $value->setAccessible(true);
                echo '<li><h4><code>' . $value->getName() . '</code>' . ($value->isPublic() ? ' [public]' : '') . '</h4><pre>' . json_encode($value->getValue($backup), JSON_PRETTY_PRINT) . '</pre>';
            } else {
                echo '<li><h4><code>' . $value->getName() . '</code>' . ($value->isPublic() ? ' [public]' : '') . '</h4><pre>' . $value . '</pre></li>';
            }
        }
        echo '</ul>';
    }
    echo '</ul>';
    echo '</li>';
}
echo '</ul>';
echo '<h2>Hash von backup.php: <code>';
echo murmurhash3($file->getRealPath() . $file->getSize() . $file->getCTime());
echo '</code></h2>';