示例#1
0
    }
    if ($fake) {
        var_export($result);
    } else {
        echo "result: " . var_export($result, true) . PHP_EOL;
        echo "saved to " . $filename . PHP_EOL;
        echo number_format(filesize($filename)) . PHP_EOL;
        exec('xdg-open ' . escapeshellarg($filename));
        echo "Delete?" . PHP_EOL;
        if (fgets(STDIN)) {
            unlink($filename);
            echo "deleted" . PHP_EOL;
        }
    }
} elseif (isset($opts['e'])) {
    $nodes = array(array('source' => '/etc/php5/fpm/php.ini', 'destination' => 'php.ini'), array('source' => '/home/wapmorgan/Pictures/*', 'destination' => 'Pictures/'), array('source' => '/home/wapmorgan/Pictures/Screenshots/*', 'destination' => 'Pictures/', 'recursive' => true), array('source' => '/home/wapmorgan/Dropbox/0203/s01v00_files/', 'destination' => 'lec/'), array('source' => '/home/wapmorgan/Dropbox/0203/s01v01_files/', 'destination' => 'lec/'), array('source' => '/home/wapmorgan/Dropbox/0203/s02v00_files/', 'destination' => 'lec/'), array('source' => '/home/wapmorgan/Dropbox/Notes/1/', 'destination' => 'Notes/', 'recursive' => true), array('source' => '/home/wapmorgan/Dropbox/Notes/2/', 'destination' => 'Notes/', 'recursive' => true));
    $result = UnifiedArchive::archiveNodes($nodes, $filename, $fake);
    if ($fake) {
        var_export($result);
    } else {
        echo "result: " . var_export($result, true) . PHP_EOL;
        echo "saved to " . $filename . PHP_EOL;
        echo number_format(filesize($filename)) . PHP_EOL;
        exec('xdg-open ' . escapeshellarg($filename));
        echo "Delete?" . PHP_EOL;
        if (fgets(STDIN)) {
            unlink($filename);
            echo "deleted" . PHP_EOL;
        }
    }
}
示例#2
0
#!/usr/bin/php
<?php 
$config = ['git_urls' => ['https://github.com/yfix/php-unified-archive.git' => 'php-unified-archive/'], 'autoload_config' => ['php-unified-archive/src/' => 'wapmorgan\\UnifiedArchive'], 'example' => function () {
    $out = \wapmorgan\UnifiedArchive\UnifiedArchive::archiveNodes('./', 'samples_archive.zip', $fake = true);
    var_export($out);
}];
if ($return_config) {
    return $config;
}
require_once __DIR__ . '/_yf_autoloader.php';
new yf_autoloader($config);