archive() public method

li3 library archive my_archive : archives current working directory to my_archive.phar.gz li3 library archive myapp my_archive : archives 'myapp' to 'my_archive.phar.gz'
public archive ( string $name = null, string $result = null ) : boolean
$name string if only param, the archive name for the current working directory otherwise, The library name or path to the directory to compress.
$result string if exists, The name of the resulting archive
return boolean
示例#1
0
 public function testArchiveNoLibrary()
 {
     $this->skipIf(!extension_loaded('zlib'), 'The zlib extension is not loaded.');
     $this->skipIf(ini_get('phar.readonly') == '1', 'INI setting phar.readonly = On');
     chdir('new');
     $app = new Library(array('request' => new Request(), 'classes' => $this->classes));
     $app->library = 'does_not_exist';
     $result = $app->archive();
     $this->assertTrue($result);
     $path = realpath($this->_testPath);
     $expected = "new.phar.gz created in {$path} from {$path}/new\n";
     $result = $app->response->output;
     $this->assertEqual($expected, $result);
     Phar::unlinkArchive($this->_testPath . '/new.phar');
     Phar::unlinkArchive($this->_testPath . '/new.phar.gz');
     $this->_cleanUp('tests/new');
     rmdir($this->_testPath . '/new');
 }