mirror of
https://github.com/dg/dibi.git
synced 2025-08-05 21:58:10 +02:00
DateTime53 renamed to DibiDateTime
This commit is contained in:
@@ -41,8 +41,6 @@ if (!defined('NETTE')) {
|
||||
class IOException extends RuntimeException {}
|
||||
class FileNotFoundException extends IOException {}
|
||||
/**#@-*/
|
||||
|
||||
require_once dirname(__FILE__) . '/Nette/DateTime53.php';
|
||||
}
|
||||
|
||||
|
||||
@@ -65,21 +63,9 @@ class PcreException extends Exception {
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @deprecated
|
||||
*/
|
||||
class DibiVariable extends DateTime53
|
||||
{
|
||||
function __construct($val)
|
||||
{
|
||||
parent::__construct($val);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
// dibi libraries
|
||||
require_once dirname(__FILE__) . '/libs/interfaces.php';
|
||||
require_once dirname(__FILE__) . '/libs/DibiDateTime.php';
|
||||
require_once dirname(__FILE__) . '/libs/DibiObject.php';
|
||||
require_once dirname(__FILE__) . '/libs/DibiLazyStorage.php';
|
||||
require_once dirname(__FILE__) . '/libs/DibiException.php';
|
||||
@@ -95,6 +81,19 @@ require_once dirname(__FILE__) . '/libs/DibiProfiler.php';
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @deprecated
|
||||
*/
|
||||
class DibiVariable extends DibiDateTime
|
||||
{
|
||||
function __construct($val)
|
||||
{
|
||||
parent::__construct($val);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
@@ -593,7 +592,7 @@ class dibi
|
||||
*/
|
||||
public static function datetime($time = NULL)
|
||||
{
|
||||
return new DateTime53(is_numeric($time) ? date('Y-m-d H:i:s', $time) : $time);
|
||||
return new DibiDateTime(is_numeric($time) ? date('Y-m-d H:i:s', $time) : $time);
|
||||
}
|
||||
|
||||
|
||||
@@ -603,7 +602,7 @@ class dibi
|
||||
*/
|
||||
public static function date($date = NULL)
|
||||
{
|
||||
return new DateTime53(is_numeric($date) ? date('Y-m-d', $date) : $date);
|
||||
return new DibiDateTime(is_numeric($date) ? date('Y-m-d', $date) : $date);
|
||||
}
|
||||
|
||||
|
||||
|
@@ -1,25 +1,23 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* This file is part of the Nette Framework.
|
||||
* This file is part of the "dibi" - smart database abstraction layer.
|
||||
*
|
||||
* Copyright (c) 2004, 2010 David Grudl (http://davidgrudl.com)
|
||||
* Copyright (c) 2005, 2010 David Grudl (http://davidgrudl.com)
|
||||
*
|
||||
* This source file is subject to the "Nette license", and/or
|
||||
* GPL license. For more information please see http://nette.org
|
||||
* This source file is subject to the "dibi license", and/or
|
||||
* GPL license. For more information please see http://dibiphp.com
|
||||
* @package dibi
|
||||
*/
|
||||
|
||||
// no namespace
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* DateTime with serialization and timestamp support for PHP 5.2.
|
||||
*
|
||||
* @author David Grudl
|
||||
* @package Nette
|
||||
*/
|
||||
class DateTime53 extends DateTime
|
||||
class DibiDateTime extends DateTime
|
||||
{
|
||||
|
||||
public function __sleep()
|
@@ -592,7 +592,7 @@ class DibiResult extends DibiObject implements IDataSource
|
||||
return NULL;
|
||||
|
||||
} elseif ($this->dateFormat === '') { // return DateTime object (default)
|
||||
return new DateTime53(is_numeric($value) ? date('Y-m-d H:i:s', $value) : $value);
|
||||
return new DibiDateTime(is_numeric($value) ? date('Y-m-d H:i:s', $value) : $value);
|
||||
|
||||
} elseif ($this->dateFormat === 'U') { // return timestamp
|
||||
return is_numeric($value) ? (int) $value : strtotime($value);
|
||||
@@ -601,7 +601,7 @@ class DibiResult extends DibiObject implements IDataSource
|
||||
return date($this->dateFormat, $value);
|
||||
|
||||
} else {
|
||||
$value = new DateTime53($value);
|
||||
$value = new DibiDateTime($value);
|
||||
return $value->format($this->dateFormat);
|
||||
}
|
||||
|
||||
|
@@ -46,7 +46,7 @@ class DibiRow implements ArrayAccess, IteratorAggregate, Countable
|
||||
if ((int) $time === 0) { // '', NULL, FALSE, '0000-00-00', ...
|
||||
return NULL;
|
||||
}
|
||||
$dt = new DateTime53(is_numeric($time) ? date('Y-m-d H:i:s', $time) : $time);
|
||||
$dt = new DibiDateTime(is_numeric($time) ? date('Y-m-d H:i:s', $time) : $time);
|
||||
return $format === NULL ? $dt : $dt->format($format);
|
||||
}
|
||||
|
||||
|
@@ -1,2 +0,0 @@
|
||||
Disallow: /drivers
|
||||
Disallow: /Nette
|
Reference in New Issue
Block a user