From 5253ae09106615fba85332aba9e045e4e69ad923 Mon Sep 17 00:00:00 2001 From: helgi Date: Fri, 27 Jan 2012 15:36:56 +0100 Subject: [PATCH] Imrpove create scripts --- autoload/create.php | 2 +- cli/create.php | 4 ++-- combo/create.php | 11 +++-------- example2/create.php | 4 ++-- example3/create.php | 4 ++-- phpmyadmin/phpmyadmin.php | 2 +- web/create.php | 4 ++-- 7 files changed, 13 insertions(+), 18 deletions(-) diff --git a/autoload/create.php b/autoload/create.php index 1ae1319..cdaff69 100644 --- a/autoload/create.php +++ b/autoload/create.php @@ -3,7 +3,7 @@ die("Phar is in read-only mode, try php -d phar.readonly=0 autoload/create.php\n"); } -@unlink('project.phar'); +@unlink(__DIR__ . '/project.phar'); $p = new Phar('project.phar', 0, 'project.phar'); $p->buildFromDirectory(__DIR__); diff --git a/cli/create.php b/cli/create.php index fc85f89..1d91e95 100644 --- a/cli/create.php +++ b/cli/create.php @@ -3,8 +3,8 @@ die("Phar is in read-only mode, try php -d phar.readonly=0 cli/create.php\n"); } -@unlink('project.phar'); -$p = new Phar('project.phar', 0, 'project.phar'); +@unlink(__DIR__ . '/project.phar'); +$p = new Phar(__DIR__ . '/project.phar', 0, 'project.phar'); $p->buildFromDirectory(__DIR__); $stub = <<<'EOD' diff --git a/combo/create.php b/combo/create.php index 52ab082..c66bac0 100644 --- a/combo/create.php +++ b/combo/create.php @@ -3,7 +3,8 @@ die("Phar is in read-only mode, try php -d phar.readonly=0 combo/create.php\n"); } -$p = new Phar('project.phar', 0, 'project.phar'); +@unlink(__DIR__ . '/project.phar'); +$p = new Phar(__DIR__ . '/project.phar', 0, 'project.phar'); $p->buildFromDirectory(__DIR__); $stub = <<<'EOD' @@ -14,10 +15,4 @@ include "phar://" . __FILE__ . DIRECTORY_SEPARATOR . "cli.php"; __HALT_COMPILER(); EOD; -$p->setStub($stub); - - Phar::interceptFileFuncs(); - Phar::mungServer(array('REQUEST_URI', 'PHP_SELF', 'SCRIPT_NAME')); - Phar::WebPhar(null, 'web.php'); - include "phar://" . __FILE__ . DIRECTORY_SEPARATOR . "cli.php"; - __HALT_COMPILER(); \ No newline at end of file +$p->setStub($stub); \ No newline at end of file diff --git a/example2/create.php b/example2/create.php index 848bcd1..3e93bd6 100644 --- a/example2/create.php +++ b/example2/create.php @@ -3,7 +3,7 @@ die("Phar is in read-only mode, try php -d phar.readonly=0 example2/create.php\n"); } -@unlink('project.phar'); -$p = new Phar('example2/project.phar'); +@unlink(__DIR__ . '/project.phar'); +$p = new Phar(__DIR__ . '/project.phar', 0, 'project.phar'); $p['awesome.php'] = 'buildFromDirectory(__DIR__); \ No newline at end of file diff --git a/phpmyadmin/phpmyadmin.php b/phpmyadmin/phpmyadmin.php index d2afca6..098b05d 100644 --- a/phpmyadmin/phpmyadmin.php +++ b/phpmyadmin/phpmyadmin.php @@ -3,7 +3,7 @@ die("Phar is in read-only mode, try php -d phar.readonly=0 phpmyadmin.php\n"); } -@unlink('phpmyadmin.phar'); +@unlink(__DIR__ . '/phpmyadmin.phar'); $a = new Phar(__DIR__ . '/phpmyadmin.phar', 0, 'phpmyadmin.phar'); $a->buildFromDirectory("phpMyAdmin-3.4.9-english"); $a->startBuffering(); diff --git a/web/create.php b/web/create.php index ba82c54..ddc7276 100644 --- a/web/create.php +++ b/web/create.php @@ -3,8 +3,8 @@ die("Phar is in read-only mode, try php -d phar.readonly=0 web/create.php\n"); } -@unlink('project.phar'); -$p = new Phar('project.phar', 0, 'project.phar'); +@unlink(__DIR__ . '/project.phar'); +$p = new Phar(__DIR__ . '/project.phar', 0, 'project.phar'); $p->buildFromDirectory(__DIR__); $stub = <<<'EOD'