1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-07 15:16:30 +02:00

Renamed date class and included BC fix.

This commit is contained in:
Cameron
2018-05-11 08:39:01 -07:00
parent 8584c207c5
commit 129ac9436d
2 changed files with 23 additions and 14 deletions

View File

@@ -16,7 +16,7 @@ if (!defined('e107_INIT')) { exit; }
e107::includeLan(e_LANGUAGEDIR.e_LANGUAGE."/lan_date.php"); e107::includeLan(e_LANGUAGEDIR.e_LANGUAGE."/lan_date.php");
class convert class e_date
{ {
function __construct() function __construct()
@@ -81,8 +81,7 @@ class convert
/** /**
* Return an array of language terms representing months * Return an array of language terms representing months
* @param $type string : month, month-short, day, day-short, day-shortest * @param $type string : month, month-short, day, day-short, day-shortest
* @return array * @return array|bool
* TODO Cache!
*/ */
public function terms($type='month') public function terms($type='month')
{ {
@@ -642,8 +641,6 @@ class convert
} }
/** /**
* This work of Lionel SAURON (http://sauron.lionel.free.fr:80) is licensed under the * This work of Lionel SAURON (http://sauron.lionel.free.fr:80) is licensed under the
* Creative Commons Attribution-Noncommercial-Share Alike 2.0 France License. * Creative Commons Attribution-Noncommercial-Share Alike 2.0 France License.
@@ -659,7 +656,7 @@ class convert
* @public * @public
* *
* @param string $str date string to parse (e.g. returned from strftime()). * @param string $str date string to parse (e.g. returned from strftime()).
* @param string $sFormat strftime format used to create the date * @param $format
* @return array|bool Returns an array with the <code>$str</code> parsed, or <code>false</code> on error. * @return array|bool Returns an array with the <code>$str</code> parsed, or <code>false</code> on error.
*/ */
public function strptime($str, $format) public function strptime($str, $format)
@@ -919,4 +916,15 @@ class convert
} }
?>
/**
* BC Fix convert
*/
class convert extends e_date
{
}

View File

@@ -160,7 +160,8 @@ class e107
protected static $_known_handlers = array( protected static $_known_handlers = array(
'UserHandler' => '{e_HANDLER}user_handler.php', 'UserHandler' => '{e_HANDLER}user_handler.php',
'comment' => '{e_HANDLER}comment_class.php', 'comment' => '{e_HANDLER}comment_class.php',
'convert' => '{e_HANDLER}date_handler.php', 'e_date' => '{e_HANDLER}date_handler.php',
'convert' => '{e_HANDLER}date_handler.php', // BC Fix.
'db' => '{e_HANDLER}mysql_class.php', 'db' => '{e_HANDLER}mysql_class.php',
'e107Email' => '{e_HANDLER}mail.php', 'e107Email' => '{e_HANDLER}mail.php',
'e107_event' => '{e_HANDLER}event_class.php', 'e107_event' => '{e_HANDLER}event_class.php',
@@ -1588,7 +1589,7 @@ class e107
*/ */
public static function getDateConvert() public static function getDateConvert()
{ {
return self::getSingleton('convert', true); return self::getSingleton('e_date', true);
} }
/** /**
@@ -1598,7 +1599,7 @@ class e107
*/ */
public static function getDate() public static function getDate()
{ {
return self::getSingleton('convert', true); return self::getSingleton('e_date', true);
} }