[ Index ]
 

Code source de eZ Publish 3.9.0

Accédez au Source d'autres logiciels libresSoutenez Angelica Josefina !

title

Body

[fermer]

/lib/ -> version.php (source)

   1  <?php
   2  //
   3  // Created on: <29-May-2002 10:38:45 bf>
   4  //
   5  // SOFTWARE NAME: eZ publish
   6  // SOFTWARE RELEASE: 3.9.0
   7  // BUILD VERSION: 17785
   8  // COPYRIGHT NOTICE: Copyright (C) 1999-2006 eZ systems AS
   9  // SOFTWARE LICENSE: GNU General Public License v2.0
  10  // NOTICE: >
  11  //   This program is free software; you can redistribute it and/or
  12  //   modify it under the terms of version 2.0  of the GNU General
  13  //   Public License as published by the Free Software Foundation.
  14  //
  15  //   This program is distributed in the hope that it will be useful,
  16  //   but WITHOUT ANY WARRANTY; without even the implied warranty of
  17  //   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  18  //   GNU General Public License for more details.
  19  //
  20  //   You should have received a copy of version 2.0 of the GNU General
  21  //   Public License along with this program; if not, write to the Free
  22  //   Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
  23  //   MA 02110-1301, USA.
  24  //
  25  //
  26  
  27  /*!
  28    \brief contains the eZ publish SDK version.
  29  */
  30  
  31  define( "EZ_SDK_VERSION_MAJOR", 3 );
  32  define( "EZ_SDK_VERSION_MINOR", 9 );
  33  define( "EZ_SDK_VERSION_RELEASE", 0 );
  34  define( "EZ_SDK_VERSION_STATE", '' );
  35  define( "EZ_SDK_VERSION_DEVELOPMENT", true );
  36  define( "EZ_SDK_VERSION_REVISION_STRING", '$Rev: 17706 $' );
  37  define( "EZ_SDK_VERSION_ALIAS", '3.9' );
  38  define( "EZ_SDK_VERSION_REVISION", preg_replace( "#\\\$Rev:\s+([0-9]+)\s+\\\$#", '$1', EZ_SDK_VERSION_REVISION_STRING ) );
  39  
  40  class eZPublishSDK
  41  {
  42      /*!
  43        \return the SDK version as a string
  44        \param withRelease If true the release version is appended
  45        \param withAlias If true the alias is used instead
  46      */
  47      function version( $withRelease = true, $asAlias = false, $withState = true )
  48      {
  49          if ( $asAlias )
  50          {
  51              $versionText = eZPublishSDK::alias();
  52              if ( $withState )
  53                  $versionText .= "-" . eZPublishSDK::state();
  54          }
  55          else
  56          {
  57              $versionText = eZPublishSDK::majorVersion() . '.' . eZPublishSDK::minorVersion();
  58  //            $development = eZPublishSDK::developmentVersion();
  59  //            $revision = eZPublishSDK::revision();
  60  //            if ( $development !== false )
  61  //                $versionText .= '.' . $development;
  62              if ( $withRelease )
  63                  $versionText .= "." . eZPublishSDK::release();
  64              if ( $withState )
  65                  $versionText .= eZPublishSDK::state();
  66          }
  67          return $versionText;
  68      }
  69  
  70      /*!
  71       \return the major version
  72      */
  73      function majorVersion()
  74      {
  75          return EZ_SDK_VERSION_MAJOR;
  76      }
  77  
  78      /*!
  79       \return the minor version
  80      */
  81      function minorVersion()
  82      {
  83          return EZ_SDK_VERSION_MINOR;
  84      }
  85  
  86      /*!
  87       \return the state of the release
  88      */
  89      function state()
  90      {
  91          return EZ_SDK_VERSION_STATE;
  92      }
  93  
  94      /*!
  95       \return the development version or \c false if this is not a development version
  96      */
  97      function developmentVersion()
  98      {
  99          return EZ_SDK_VERSION_DEVELOPMENT;
 100      }
 101  
 102      /*!
 103       \return the release number
 104      */
 105      function release()
 106      {
 107          return EZ_SDK_VERSION_RELEASE;
 108      }
 109  
 110      /*!
 111       \return the SVN revision number
 112      */
 113      function revision()
 114      {
 115          return EZ_SDK_VERSION_REVISION;
 116      }
 117  
 118      /*!
 119       \return the alias name for the release, this is often used for beta releases and release candidates.
 120      */
 121      function alias()
 122      {
 123          return eZPublishSDK::version();
 124      }
 125  
 126      /*!
 127        \return the version of the database.
 128        \param withRelease If true the release version is appended
 129      */
 130      function databaseVersion( $withRelease = true )
 131      {
 132          include_once ( 'lib/ezdb/classes/ezdb.php' );
 133          $db =& eZDB::instance();
 134          $rows = $db->arrayQuery( "SELECT value as version FROM ezsite_data WHERE name='ezpublish-version'" );
 135          $version = false;
 136          if ( count( $rows ) > 0 )
 137          {
 138              $version = $rows[0]['version'];
 139              if ( $withRelease )
 140              {
 141                  $release = eZPublishSDK::databaseRelease();
 142                  $version .= '-' . $release;
 143              }
 144          }
 145          return $version;
 146      }
 147  
 148      /*!
 149        \return the release of the database.
 150      */
 151      function databaseRelease()
 152      {
 153          include_once ( 'lib/ezdb/classes/ezdb.php' );
 154          $db =& eZDB::instance();
 155          $rows = $db->arrayQuery( "SELECT value as release FROM ezsite_data WHERE name='ezpublish-release'" );
 156          $release = false;
 157          if ( count( $rows ) > 0 )
 158          {
 159              $release = $rows[0]['release'];
 160          }
 161          return $release;
 162      }
 163  }
 164  
 165  ?>


Généré le : Sat Feb 24 10:30:04 2007 par Balluche grâce à PHPXref 0.7