From 0600ec94caf93e80afebc5ab25aa8b6a8bc4f6cc Mon Sep 17 00:00:00 2001 From: connor Date: Thu, 4 Apr 2024 16:33:33 +0200 Subject: [PATCH] new location of symfony version [BC break] --- lib/autoload/sfCoreAutoload.class.php | 1 - lib/command/sfSymfonyCommandApplication.class.php | 2 +- lib/config/sfProjectConfiguration.class.php | 2 ++ lib/debug/sfDebug.class.php | 2 +- lib/debug/sfWebDebugPanelSymfonyVersion.class.php | 2 +- lib/exception/data/exception.html.php | 2 +- lib/exception/data/exception.txt.php | 2 +- lib/plugin/sfPearRest.class.php | 2 +- lib/plugin/sfSymfonyPluginManager.class.php | 8 ++++---- 9 files changed, 12 insertions(+), 11 deletions(-) diff --git a/lib/autoload/sfCoreAutoload.class.php b/lib/autoload/sfCoreAutoload.class.php index 926d9caad..b71c98282 100755 --- a/lib/autoload/sfCoreAutoload.class.php +++ b/lib/autoload/sfCoreAutoload.class.php @@ -9,7 +9,6 @@ */ // The current symfony version. -define('SYMFONY_VERSION', '1.5.20-dev'); /** * @deprecated diff --git a/lib/command/sfSymfonyCommandApplication.class.php b/lib/command/sfSymfonyCommandApplication.class.php index bec81a576..34422c8a8 100644 --- a/lib/command/sfSymfonyCommandApplication.class.php +++ b/lib/command/sfSymfonyCommandApplication.class.php @@ -36,7 +36,7 @@ public function configure() // application $this->setName('symfony'); - $this->setVersion(SYMFONY_VERSION); + $this->setVersion(sfProjectConfiguration::SYMFONY_VERSION); $this->loadTasks($configuration); } diff --git a/lib/config/sfProjectConfiguration.class.php b/lib/config/sfProjectConfiguration.class.php index 68f006e20..baa4e3580 100644 --- a/lib/config/sfProjectConfiguration.class.php +++ b/lib/config/sfProjectConfiguration.class.php @@ -15,6 +15,8 @@ */ class sfProjectConfiguration { + public const SYMFONY_VERSION = '1.5.20-dev'; + /** @var string */ protected $rootDir; diff --git a/lib/debug/sfDebug.class.php b/lib/debug/sfDebug.class.php index e671fe03a..100bd528b 100644 --- a/lib/debug/sfDebug.class.php +++ b/lib/debug/sfDebug.class.php @@ -23,7 +23,7 @@ class sfDebug public static function symfonyInfoAsArray() { return [ - 'version' => SYMFONY_VERSION, + 'version' => sfProjectConfiguration::SYMFONY_VERSION, 'path' => sfConfig::get('sf_symfony_lib_dir'), ]; } diff --git a/lib/debug/sfWebDebugPanelSymfonyVersion.class.php b/lib/debug/sfWebDebugPanelSymfonyVersion.class.php index 872453c52..416a47f83 100644 --- a/lib/debug/sfWebDebugPanelSymfonyVersion.class.php +++ b/lib/debug/sfWebDebugPanelSymfonyVersion.class.php @@ -17,7 +17,7 @@ class sfWebDebugPanelSymfonyVersion extends sfWebDebugPanel { public function getTitle() { - return ''.SYMFONY_VERSION.''; + return ''.sfProjectConfiguration::SYMFONY_VERSION.''; } public function getPanelTitle() diff --git a/lib/exception/data/exception.html.php b/lib/exception/data/exception.html.php index 8e47ef618..f40b71d15 100644 --- a/lib/exception/data/exception.html.php +++ b/lib/exception/data/exception.html.php @@ -56,7 +56,7 @@ function toggle(id) diff --git a/lib/exception/data/exception.txt.php b/lib/exception/data/exception.txt.php index 2e5bea7f0..66d5ca600 100644 --- a/lib/exception/data/exception.txt.php +++ b/lib/exception/data/exception.txt.php @@ -7,5 +7,5 @@ -[symfony] v. (symfony-project.org) +[symfony] v. (symfony-project.org) [PHP] v. diff --git a/lib/plugin/sfPearRest.class.php b/lib/plugin/sfPearRest.class.php index 5b918b617..546b08dbb 100644 --- a/lib/plugin/sfPearRest.class.php +++ b/lib/plugin/sfPearRest.class.php @@ -24,6 +24,6 @@ class sfPearRest extends PEAR_REST */ public function downloadHttp($url, $lastmodified = null, $accept = false, $channel = false) { - return parent::downloadHttp($url, $lastmodified, array_merge(false !== $accept ? $accept : [], ["\r\nX-SYMFONY-VERSION: ".SYMFONY_VERSION])); + return parent::downloadHttp($url, $lastmodified, array_merge(false !== $accept ? $accept : [], ["\r\nX-SYMFONY-VERSION: ".sfProjectConfiguration::SYMFONY_VERSION])); } } diff --git a/lib/plugin/sfSymfonyPluginManager.class.php b/lib/plugin/sfSymfonyPluginManager.class.php index 514ca471a..f36c586c5 100644 --- a/lib/plugin/sfSymfonyPluginManager.class.php +++ b/lib/plugin/sfSymfonyPluginManager.class.php @@ -174,10 +174,10 @@ protected function registerSymfonyPackage() $symfony->setChannel('pear.symfony-project.com'); $symfony->setConfig($this->environment->getConfig()); $symfony->setPackageType('php'); - $symfony->setAPIVersion(preg_replace('/\d+(\-\w+)?$/', '0', SYMFONY_VERSION)); - $symfony->setAPIStability(false === strpos(SYMFONY_VERSION, 'DEV') ? 'stable' : 'beta'); - $symfony->setReleaseVersion(preg_replace('/\-\w+$/', '', SYMFONY_VERSION)); - $symfony->setReleaseStability(false === strpos(SYMFONY_VERSION, 'DEV') ? 'stable' : 'beta'); + $symfony->setAPIVersion(preg_replace('/\d+(\-\w+)?$/', '0', sfProjectConfiguration::SYMFONY_VERSION)); + $symfony->setAPIStability(false === strpos(sfProjectConfiguration::SYMFONY_VERSION, 'DEV') ? 'stable' : 'beta'); + $symfony->setReleaseVersion(preg_replace('/\-\w+$/', '', sfProjectConfiguration::SYMFONY_VERSION)); + $symfony->setReleaseStability(false === strpos(sfProjectConfiguration::SYMFONY_VERSION, 'DEV') ? 'stable' : 'beta'); $symfony->setDate(date('Y-m-d')); $symfony->setDescription('symfony'); $symfony->setSummary('symfony');