Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix weird alias issues, add tests to check for new-found problems
- Loading branch information
Greg Beaver
committed
May 12, 2008
1 parent
ac8ea81
commit 82dc039
Showing
11 changed files
with
262 additions
and
61 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
--TEST-- | ||
Phar: alias edge cases | ||
--SKIPIF-- | ||
<?php if (!extension_loaded("phar")) die("skip"); ?> | ||
--INI-- | ||
phar.readonly=0 | ||
--FILE-- | ||
<?php | ||
|
||
$fname = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar'; | ||
$fname2 = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.2.phar'; | ||
|
||
$p = new Phar($fname); | ||
|
||
$p->setAlias('foo'); | ||
$p['unused'] = 'hi'; | ||
try { | ||
$a = new Phar($fname2, 0, 'foo'); | ||
} catch (Exception $e) { | ||
echo $e->getMessage(),"\n"; | ||
} | ||
copy($fname, $fname2); | ||
echo "2\n"; | ||
try { | ||
$a = new Phar($fname2); | ||
} catch (Exception $e) { | ||
echo $e->getMessage(),"\n"; | ||
} | ||
try { | ||
$b = new Phar($fname, 0, 'another'); | ||
} catch (Exception $e) { | ||
echo $e->getMessage(),"\n"; | ||
} | ||
?> | ||
===DONE=== | ||
--CLEAN-- | ||
<?php | ||
unlink(dirname(__FILE__) . '/' . basename(__FILE__, '.clean.php') . '.phar'); | ||
unlink(dirname(__FILE__) . '/' . basename(__FILE__, '.clean.php') . '.2.phar'); | ||
?> | ||
--EXPECTF-- | ||
alias "foo" is already used for archive "%salias_acrobatics.phar" cannot be overloaded with "%salias_acrobatics.2.phar" | ||
2 | ||
Cannot open archive "%salias_acrobatics.2.phar", alias is already in use by existing archive | ||
alias "another" is already used for archive "%salias_acrobatics.phar" cannot be overloaded with "%salias_acrobatics.phar" | ||
===DONE=== |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
--TEST-- | ||
Phar: alias edge cases | ||
--SKIPIF-- | ||
<?php if (!extension_loaded("phar")) die("skip"); ?> | ||
--INI-- | ||
phar.readonly=0 | ||
--FILE-- | ||
<?php | ||
|
||
$fname = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.tar'; | ||
$fname2 = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.2.phar.tar'; | ||
|
||
$p = new Phar($fname); | ||
|
||
$p->setAlias('foo'); | ||
$p['unused'] = 'hi'; | ||
try { | ||
$a = new Phar($fname2, 0, 'foo'); | ||
} catch (Exception $e) { | ||
echo $e->getMessage(),"\n"; | ||
} | ||
copy($fname, $fname2); | ||
echo "2\n"; | ||
try { | ||
$a = new Phar($fname2); | ||
} catch (Exception $e) { | ||
echo $e->getMessage(),"\n"; | ||
} | ||
try { | ||
$b = new Phar($fname, 0, 'another'); | ||
} catch (Exception $e) { | ||
echo $e->getMessage(),"\n"; | ||
} | ||
?> | ||
===DONE=== | ||
--CLEAN-- | ||
<?php | ||
unlink(dirname(__FILE__) . '/' . basename(__FILE__, '.clean.php') . '.phar.tar'); | ||
unlink(dirname(__FILE__) . '/' . basename(__FILE__, '.clean.php') . '.2.phar.tar'); | ||
?> | ||
--EXPECTF-- | ||
alias "foo" is already used for archive "%salias_acrobatics.phar.tar" cannot be overloaded with "%salias_acrobatics.2.phar.tar" | ||
2 | ||
phar error: Unable to add tar-based phar "%salias_acrobatics.2.phar.tar", alias is already in use | ||
alias "another" is already used for archive "%salias_acrobatics.phar.tar" cannot be overloaded with "%salias_acrobatics.phar.tar" | ||
===DONE=== |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
--TEST-- | ||
Phar: alias edge cases | ||
--SKIPIF-- | ||
<?php if (!extension_loaded("phar")) die("skip"); ?> | ||
--INI-- | ||
phar.readonly=0 | ||
--FILE-- | ||
<?php | ||
|
||
$fname = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.zip'; | ||
$fname2 = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.2.phar.zip'; | ||
|
||
$p = new Phar($fname); | ||
|
||
$p->setAlias('foo'); | ||
$p['unused'] = 'hi'; | ||
try { | ||
$a = new Phar($fname2, 0, 'foo'); | ||
} catch (Exception $e) { | ||
echo $e->getMessage(),"\n"; | ||
} | ||
copy($fname, $fname2); | ||
echo "2\n"; | ||
try { | ||
$a = new Phar($fname2); | ||
} catch (Exception $e) { | ||
echo $e->getMessage(),"\n"; | ||
} | ||
try { | ||
$b = new Phar($fname, 0, 'another'); | ||
} catch (Exception $e) { | ||
echo $e->getMessage(),"\n"; | ||
} | ||
?> | ||
===DONE=== | ||
--CLEAN-- | ||
<?php | ||
unlink(dirname(__FILE__) . '/' . basename(__FILE__, '.clean.php') . '.phar.zip'); | ||
unlink(dirname(__FILE__) . '/' . basename(__FILE__, '.clean.php') . '.2.phar.zip'); | ||
?> | ||
--EXPECTF-- | ||
alias "foo" is already used for archive "%salias_acrobatics.phar.zip" cannot be overloaded with "%salias_acrobatics.2.phar.zip" | ||
2 | ||
phar error: Unable to add zip-based phar "%salias_acrobatics.2.phar.zip" with implicit alias, alias is already in use | ||
alias "another" is already used for archive "%salias_acrobatics.phar.zip" cannot be overloaded with "%salias_acrobatics.phar.zip" | ||
===DONE=== |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.