diff --git a/bin/doctrine.php b/bin/doctrine.php index 02df253ae..905dd17d2 100644 --- a/bin/doctrine.php +++ b/bin/doctrine.php @@ -30,7 +30,7 @@ if (file_exists($configFile)) { $helperSet = ($helperSet) ?: new \Symfony\Components\Console\Helper\HelperSet(); -$cli = new \Symfony\Components\Console\Application('Doctrine Command Line Interface', Doctrine\Common\Version::VERSION); +$cli = new \Symfony\Components\Console\Application('Doctrine Command Line Interface', Doctrine\ORM\Version::VERSION); $cli->setCatchExceptions(true); $cli->setHelperSet($helperSet); $cli->addCommands(array( diff --git a/build.xml b/build.xml index ada5f2738..dd72e366c 100644 --- a/build.xml +++ b/build.xml @@ -11,8 +11,8 @@ - - @@ -27,35 +27,35 @@ - - - - - + - - @@ -69,6 +69,9 @@ + @@ -78,6 +81,9 @@ + @@ -89,9 +95,9 @@ - - @@ -109,15 +115,16 @@ + + - + - - - @@ -126,7 +133,7 @@ - + - @@ -149,11 +155,10 @@ - - DoctrineORM Doctrine Object Relational Mapper @@ -180,8 +185,6 @@ - - + - - + \ No newline at end of file diff --git a/lib/Doctrine/ORM/Version.php b/lib/Doctrine/ORM/Version.php new file mode 100644 index 000000000..607fb80d8 --- /dev/null +++ b/lib/Doctrine/ORM/Version.php @@ -0,0 +1,55 @@ +. + */ + +namespace Doctrine\ORM; + +/** + * Class to store and retrieve the version of Doctrine + * + * @license http://www.opensource.org/licenses/lgpl-license.php LGPL + * @link www.doctrine-project.org + * @since 2.0 + * @version $Revision$ + * @author Benjamin Eberlei + * @author Guilherme Blanco + * @author Jonathan Wage + * @author Roman Borschel + */ +class Version +{ + /** + * Current Doctrine Version + */ + const VERSION = '2.0.0BETA2-DEV'; + + /** + * Compares a Doctrine version with the current one. + * + * @param string $version Doctrine version to compare. + * @return int Returns -1 if older, 0 if it is the same, 1 if version + * passed as argument is newer. + */ + public static function compare($version) + { + $currentVersion = str_replace(' ', '', strtolower(self::VERSION)); + $version = str_replace(' ', '', $version); + + return version_compare($version, $currentVersion); + } +} \ No newline at end of file