<?php
//
// +--------------------------------------------------------------------+
// | Sourdough PHP Application Framework |
// +--------------------------------------------------------------------+
// | Copyright (c) 2001-2007 Philip Iezzi, phpee.com |
// | Web http://sourdough.phpee.com/ |
// | License GNU Lesser General Public License (LGPL) |
// +--------------------------------------------------------------------+
// | This library is free software; you can redistribute it and/or |
// | modify it under the terms of the GNU Lesser General Public |
// | License as published by the Free Software Foundation; either |
// | version 2.1 of the License, or (at your option) any later version. |
// +--------------------------------------------------------------------+
//
/**
* Sourdough PHP Application Framework
* @package sourdough
*/
/**
* Autoload
*
* Include class files automatically.
*
* @access public
* @param string $class class name
*/
function __autoload($class)
{
static $base_path;
if(is_null($base_path)) {
$base_path = dirname(__FILE__).'/';
}
$paths = array(
$base_path.'Sd_Util/'.$class.'.class.'.SOURD_PHPEXT
);
$found = false;
for ($i = 0; $i < sizeof($paths) && !$found; $i++) {
@include_once($paths[$i]);
$found = class_exists($class);
}
}
//spl_autoload_register('__sdAutoload');
/**
* __
*
* Grab localization strings.
*
* TODO: check description
* @access public
* @param string $sMsgId
* @param boolean $plain do not apply htmlentities()
* @return mixed
*/
function __($sMsgId, $plain = false)
{
$outp = (isset($GLOBALS['__'][$sMsgId])) ? $GLOBALS['__'][$sMsgId] : $sMsgId;
return (is_string($outp) && !$plain) ? htmlentities($outp) : $outp;
}
?>