From b79bc6f501bbcb6a930cdcb3a1a9acba513404bc Mon Sep 17 00:00:00 2001 From: connor Date: Wed, 27 Mar 2024 10:43:25 +0100 Subject: [PATCH] added release prepare --- bin/release.php | 66 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) diff --git a/bin/release.php b/bin/release.php index 50b6e27df..85e7191b4 100644 --- a/bin/release.php +++ b/bin/release.php @@ -73,4 +73,70 @@ echo sprintf("Prepare symfony version \"%s\".\n", $rawVersion); +/** + * prepare sfCoreAutoload class + */ +$file = __DIR__.'/../lib/autoload/sfCoreAutoload.class.php'; +$content = file_get_contents($file); + +$content = preg_replace('/^define\(.*SYMFONY_VERSION.*$/m', 'define(\'SYMFONY_VERSION\', \''.$rawVersion.'\');', $content, -1, $count); + +if ($count !== 1) { + throw new \RuntimeException('Preparing sfCoreAutoload failed, SYMFONY_VERSION constant not found.'); +} + +file_put_contents($file, $content); + +/** + * prepare CHANGELOG.md + */ +$file = __DIR__.'/../CHANGELOG.md'; +$content = file_get_contents($file); + +$nextVersionHeader = <<