Exemplo n.º 1
0
 /**
  * Load a constant, or array of constants
  *
  * @param   string|array    $constant The constant or constants to load
  * @return  bool|array      TRUE if loaded, FALSE if not
  */
 function loadConstant($constant)
 {
     // Recursiveness
     if (is_array($constant)) {
         $res = array();
         foreach ($constant as $singleconst) {
             $res[$singleconst] = PHP_Compat::loadConstant($singleconst);
         }
         return $res;
     }
     // Load constant
     $file = sprintf('PHP/Compat/Constant/%s.php', $constant);
     if (@(include_once $file) !== false) {
         return true;
     }
     return false;
 }
Exemplo n.º 2
0
 /**
  * Load a constant, or array of constants
  *
  * @param   string|array    $constant   The constant or constants to load
  * @return  bool|array      TRUE if loaded, FALSE if not
  */
 function loadConstant($constant)
 {
     // Multiple
     if (is_array($constant)) {
         $res = array();
         foreach ($constant as $singleconst) {
             $res[$singleconst] = PHP_Compat::loadConstant($singleconst);
         }
         return $res;
     }
     // Single
     $file = sprintf(dirname(__FILE__) . '/Compat/Constant/%s.php', $constant);
     if (@(include_once $file) !== false) {
         return true;
     }
     return false;
 }
Exemplo n.º 3
0
 /**
  * Load a constant, or array of constants
  *
  * @param   string|array    $constant The constant or constants to load.
  * @return  bool|array      true if loaded, false if not
  */
 function loadConstant($constant)
 {
     if (is_array($constant)) {
         $res = array();
         foreach ($constant as $singleconst) {
             $res[] = PHP_Compat::loadConstant($singleconst);
         }
         return $res;
     } else {
         if (!defined($constant)) {
             $file = sprintf('PHP/Compat/Constant/%s.php', $constant);
             if (@(include_once $file) !== false) {
                 return true;
             }
         }
         return false;
     }
 }
Exemplo n.º 4
0
 * @category   HTML
 * @package    HTML_Progress2
 * @author     Laurent Laville <*****@*****.**>
 * @copyright  2005-2007 The PHP Group
 * @license    http://www.php.net/license/3_01.txt  PHP License 3.01
 * @version    CVS: $Id: Progress2.php,v 1.33 2007/01/03 16:44:05 farell Exp $
 * @link       http://pear.php.net/package/HTML_Progress2
 * @since      File available since Release 2.0.0RC1
 */
require_once 'HTML/Common.php';
require_once 'HTML/CSS.php';
require_once 'Event/Dispatcher.php';
if (version_compare(phpversion(), '5.0.0', '<')) {
    include_once 'PHP/Compat.php';
    PHP_Compat::loadFunction('ob_get_clean');
    PHP_Compat::loadConstant('PHP_EOL');
}
/**#@+
 * Progress Bar shape types
 *
 * @var        integer
 * @since      2.0.0
 */
define('HTML_PROGRESS2_BAR_HORIZONTAL', 1);
define('HTML_PROGRESS2_BAR_VERTICAL', 2);
define('HTML_PROGRESS2_POLYGONAL', 3);
define('HTML_PROGRESS2_CIRCLE', 4);
/**#@-*/
/**#@+
 * Progress Bar label types
 *