Subversion-Projekte lars-tiefland.ci

Revision

Revision 2049 | Revision 2242 | Zur aktuellen Revision | Ganze Datei anzeigen | Leerzeichen ignorieren | Details | Blame | Letzte Änderung | Log anzeigen | RSS feed

Revision 2049 Revision 2107
Zeile 103... Zeile 103...
103
	 * @var array
103
	 * @var array
104
	 */
104
	 */
105
	protected $_levels = array('ERROR' => 1, 'DEBUG' => 2, 'INFO' => 3, 'ALL' => 4);
105
	protected $_levels = array('ERROR' => 1, 'DEBUG' => 2, 'INFO' => 3, 'ALL' => 4);
Zeile 106... Zeile 106...
106
 
106
 
107
	/**
107
	/**
108
	 * mbstring.func_override flag
108
	 * mbstring.func_overload flag
109
	 *
109
	 *
110
	 * @var	bool
110
	 * @var	bool
111
	 */
111
	 */
Zeile 112... Zeile 112...
112
	protected static $func_override;
112
	protected static $func_overload;
Zeile 113... Zeile 113...
113
 
113
 
114
	// --------------------------------------------------------------------
114
	// --------------------------------------------------------------------
Zeile 120... Zeile 120...
120
	 */
120
	 */
121
	public function __construct()
121
	public function __construct()
122
	{
122
	{
123
		$config =& get_config();
123
		$config =& get_config();
Zeile 124... Zeile 124...
124
 
124
 
Zeile 125... Zeile 125...
125
		isset(self::$func_override) OR self::$func_override = (extension_loaded('mbstring') && ini_get('mbstring.func_override'));
125
		isset(self::$func_overload) OR self::$func_overload = (extension_loaded('mbstring') && ini_get('mbstring.func_overload'));
126
 
126
 
127
		$this->_log_path = ($config['log_path'] !== '') ? $config['log_path'] : APPPATH.'logs/';
127
		$this->_log_path = ($config['log_path'] !== '') ? $config['log_path'] : APPPATH.'logs/';
Zeile 262... Zeile 262...
262
	 * @param	string	$str
262
	 * @param	string	$str
263
	 * @return	int
263
	 * @return	int
264
	 */
264
	 */
265
	protected static function strlen($str)
265
	protected static function strlen($str)
266
	{
266
	{
267
		return (self::$func_override)
267
		return (self::$func_overload)
268
			? mb_strlen($str, '8bit')
268
			? mb_strlen($str, '8bit')
269
			: strlen($str);
269
			: strlen($str);
270
	}
270
	}
Zeile 271... Zeile 271...
271
 
271
 
Zeile 279... Zeile 279...
279
	 * @param	int	$length
279
	 * @param	int	$length
280
	 * @return	string
280
	 * @return	string
281
	 */
281
	 */
282
	protected static function substr($str, $start, $length = NULL)
282
	protected static function substr($str, $start, $length = NULL)
283
	{
283
	{
284
		if (self::$func_override)
284
		if (self::$func_overload)
285
		{
285
		{
286
			// mb_substr($str, $start, null, '8bit') returns an empty
286
			// mb_substr($str, $start, null, '8bit') returns an empty
287
			// string on PHP 5.3
287
			// string on PHP 5.3
288
			isset($length) OR $length = ($start >= 0 ? self::strlen($str) - $start : -$start);
288
			isset($length) OR $length = ($start >= 0 ? self::strlen($str) - $start : -$start);
289
			return mb_substr($str, $start, $length, '8bit');
289
			return mb_substr($str, $start, $length, '8bit');