Permalink
Browse files

updating phar templates and adding some exception handlign to Library

  • Loading branch information...
gwoo committed Mar 9, 2010
1 parent 986f49f commit 597828fbb1cd3e01aec700ca9b5135a9ac09ec4b
@@ -176,7 +176,12 @@ public function extract($name = 'new', $result = null) {
}
}
if (file_exists($from)) {
- $archive = new Phar($from);
+ try {
+ $archive = new Phar($from);
+ } catch (\Exception $e) {
+ $this->error($e->getMessage());
+ return false;
+ }
if ($archive->extractTo($to)) {
$this->out(basename($to) . " created in " . dirname($to) . " from {$from}");
return true;
@@ -220,7 +225,12 @@ public function archive($name = null, $result = null) {
}
Phar::unlinkArchive("{$path}.phar");
}
- $archive = new Phar("{$path}.phar");
+ try {
+ $archive = new Phar("{$path}.phar");
+ } catch (\Exception $e) {
+ $this->error($e->getMessage());
+ return false;
+ }
$from = $this->_toPath($from);
$result = (boolean) $archive->buildFromDirectory($from, $this->filter);
Binary file not shown.

0 comments on commit 597828f

Please sign in to comment.