summaryrefslogtreecommitdiff
path: root/win32
diff options
context:
space:
mode:
authorGreg Beaver <cellog@php.net>2009-06-11 14:39:37 +0000
committerGreg Beaver <cellog@php.net>2009-06-11 14:39:37 +0000
commitf7246e20869f50d32409be1c323046b286662ef0 (patch)
tree535b9a3cae7f7325ad5a1b4036ae6ba06afd0858 /win32
parentf2fcd8fb291f8f61b6bb635726dd681d66065df7 (diff)
downloadphp-git-f7246e20869f50d32409be1c323046b286662ef0.tar.gz
add phar.phar creation on windows
Diffstat (limited to 'win32')
-rw-r--r--win32/build/Makefile2
-rw-r--r--win32/build/mkdist.php22
2 files changed, 23 insertions, 1 deletions
diff --git a/win32/build/Makefile b/win32/build/Makefile
index a4635b4bc8..69442fe1cb 100644
--- a/win32/build/Makefile
+++ b/win32/build/Makefile
@@ -128,7 +128,7 @@ build-dist: $(BUILD_DIR)\deplister.exe
-del /f /q $(BUILD_DIR)\php-$(PHP_VERSION_STRING)$(PHP_ZTS_ARCHIVE_POSTFIX)-Win32-$(PHP_COMPILER_SHORT)-$(PHP_ARCHITECTURE).zip
-del /f /q $(BUILD_DIR)\php-debug-pack-$(PHP_VERSION_STRING)$(PHP_ZTS_ARCHIVE_POSTFIX)-Win32-$(PHP_COMPILER_SHORT)-$(PHP_ARCHITECTURE).zip
-del /f /q $(BUILD_DIR)\pecl-$(PHP_VERSION_STRING)$(PHP_ZTS_ARCHIVE_POSTFIX)-Win32-$(PHP_COMPILER_SHORT)-$(PHP_ARCHITECTURE).zip
- $(BUILD_DIR)\php.exe -d date.timezone=UTC -n win32/build/mkdist.php "$(BUILD_DIR)" "$(PHPDLL)" "$(SAPI_TARGETS)" "$(EXT_TARGETS) $(PHP_EXTRA_DIST_FILES)" "$(PECL_TARGETS) $(PECL_EXTRA_DIST_FILES)" "$(SNAPSHOT_TEMPLATE)"
+ $(BUILD_DIR)\php.exe -d date.timezone=UTC -n -dphar.readonly=0 win32/build/mkdist.php "$(BUILD_DIR)" "$(PHPDLL)" "$(SAPI_TARGETS)" "$(EXT_TARGETS) $(PHP_EXTRA_DIST_FILES)" "$(PECL_TARGETS) $(PECL_EXTRA_DIST_FILES)" "$(SNAPSHOT_TEMPLATE)"
cd $(BUILD_DIR)\php-$(PHP_VERSION_STRING)
-$(ZIP) -9 -q -r ..\php-$(PHP_VERSION_STRING)$(PHP_ZTS_ARCHIVE_POSTFIX)-Win32-$(PHP_COMPILER_SHORT)-$(PHP_ARCHITECTURE).zip .
cd ..\..
diff --git a/win32/build/mkdist.php b/win32/build/mkdist.php
index 5f11908015..6a795f9b64 100644
--- a/win32/build/mkdist.php
+++ b/win32/build/mkdist.php
@@ -393,6 +393,27 @@ function copy_test_dir($directory, $dest)
closedir($directory_list);
}
+function make_phar_dot_phar($dist_dir)
+{
+ if (!extension_loaded('phar')) return;
+ $path_to_php = $dist_dir;
+ $path_to_phar = realpath(__DIR__ . '/../../ext/phar');
+ echo "Generating pharcommand.phar\n";
+ $phar = new Phar($path_to_php . '/pharcommand.phar', 0, 'pharcommand');
+ foreach (new DirectoryIterator($path_to_phar . '/phar') as $file) {
+ if ($file->isDir() || $file == 'phar.php') continue;
+ echo 'adding ', $file, "\n";
+ $phar[(string) $file] = file_get_contents($path_to_phar. '/phar/' . $file);
+ }
+ $phar->setSignatureAlgorithm(Phar::SHA1);
+ $stub = file($path_to_phar . '/phar/phar.php');
+ unset($stub[0]); // remove hashbang
+ $phar->setStub(implode('', $stub));
+
+ echo "Creating phar.phar.bat\n";
+ file_put_contents($path_to_php . '/phar.phar.bat', "%~dp0php.exe %~dp0pharcommand.phar %1 %2 %3 %4 %5 %6 %7 %8 %9\r\n");
+}
+
if (!is_dir($test_dir)) {
mkdir($test_dir);
}
@@ -489,4 +510,5 @@ if (file_exists($snapshot_template)) {
echo "WARNING: you don't have a snapshot template, your dist will not be complete\n";
}
+make_phar_dot_phar($dist_dir);
?>