[ Index ]
 

Code source de eZ Publish 3.9.0

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

title

Body

[fermer]

/lib/ -> compat.php (source)

   1  <?php
   2  //
   3  // Custom versions of PHP functions for older PHP versions
   4  //
   5  // Created on: <15-Nov-2004 10:05:41 dr>
   6  //
   7  // SOFTWARE NAME: eZ publish
   8  // SOFTWARE RELEASE: 3.9.0
   9  // BUILD VERSION: 17785
  10  // COPYRIGHT NOTICE: Copyright (C) 1999-2006 eZ systems AS
  11  // SOFTWARE LICENSE: GNU General Public License v2.0
  12  // NOTICE: >
  13  //   This program is free software; you can redistribute it and/or
  14  //   modify it under the terms of version 2.0  of the GNU General
  15  //   Public License as published by the Free Software Foundation.
  16  //
  17  //   This program is distributed in the hope that it will be useful,
  18  //   but WITHOUT ANY WARRANTY; without even the implied warranty of
  19  //   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  20  //   GNU General Public License for more details.
  21  //
  22  //   You should have received a copy of version 2.0 of the GNU General
  23  //   Public License along with this program; if not, write to the Free
  24  //   Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
  25  //   MA 02110-1301, USA.
  26  //
  27  //
  28  
  29  if ( version_compare( phpversion(), '4.3.10', '<' ) )
  30  {
  31      if ( !function_exists( 'ezprintf_format_f' ) )
  32      {
  33          function ezprintf_format_f()
  34          {
  35              $params = func_get_args();
  36              $decimals = 6;
  37              if ( count( $params[0] ) == 3 )
  38              {
  39                  $decimals = $params[0][2];
  40              }
  41              return number_format( $GLOBALS['printf_parameter'], $decimals, '.', '' );
  42          }
  43      }
  44  
  45      if ( !function_exists( 'ezsprintf' ) )
  46      {
  47          function ezsprintf()
  48          {
  49              $params = func_get_args();
  50              preg_match_all( '/%[-+.0-9]*[A-Za-z]/', $params[0], $m );
  51              $format_strings = $m[0];
  52              foreach ( $format_strings as $id => $fmt )
  53              {
  54                  if ( $fmt[strlen($fmt) - 1] == 'F' )
  55                  {
  56                      $GLOBALS['printf_parameter'] = $params[$id + 1];
  57                      $params[0] = preg_replace_callback( '/%[-+]?[0-9]?(\.([0-9]))?F/', 'ezprintf_format_f', $params[0], 1 );
  58                  }
  59              }
  60              return call_user_func_array('sprintf', $params);
  61          }
  62      }
  63  
  64      if ( !function_exists( 'ezprintf' ) )
  65      {
  66          function ezprintf()
  67          {
  68              $params = func_get_args();
  69              echo call_user_func_array('ezsprintf', $params);
  70          }
  71      }
  72  }
  73  else
  74  {
  75      if ( !function_exists( 'ezprintf' ) )
  76      {
  77          function ezprintf()
  78          {
  79              $params = func_get_args();
  80              return call_user_func_array( 'printf', $params );
  81          }
  82      }
  83  
  84      if ( !function_exists( 'ezsprintf' ) )
  85      {
  86          function ezsprintf()
  87          {
  88              $params = func_get_args();
  89              return call_user_func_array( 'sprintf', $params );
  90          }
  91      }
  92  }
  93  
  94  ?>


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