forked from joomla/joomla-platform
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement the JsonSerializable interface in JRegistry while maintaini…
…ng compatability with PHP 5.3. This allows us to pass JRegistry objects to json_encode.
- Loading branch information
1 parent
67248cb
commit 269dc02
Showing
5 changed files
with
135 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<?php | ||
/** | ||
* @package Joomla.Compat | ||
* | ||
* @copyright Copyright (C) 2005 - 2012 Open Source Matters, Inc. All rights reserved. | ||
* @license GNU General Public License version 2 or later; see LICENSE | ||
*/ | ||
|
||
defined('JPATH_PLATFORM') or die; | ||
|
||
/** | ||
* JsonSerializable interface. This file should only be loaded on PHP < 5.4 | ||
* It allows us to implement it in classes without requiring PHP 5.4 | ||
* | ||
* @package Joomla.Platform | ||
* @since 12.2 | ||
* @link http://www.php.net/manual/en/jsonserializable.jsonserialize.php | ||
*/ | ||
interface JsonSerializable | ||
{ | ||
/** | ||
* Return data which should be serialized by json_encode(). | ||
* | ||
* @return mixed | ||
* | ||
* @since 12.2 | ||
*/ | ||
public function jsonSerialize(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters