/classes/Fuel/Core/Cache/Format/Serialize.php
PHP | 47 lines | 13 code | 3 blank | 31 comment | 0 complexity | 42080794d2df86f4073ad3cc403fd1b3 MD5 | raw file
- <?php
- /**
- * Part of the FuelPHP framework.
- *
- * @package Fuel\Core
- * @version 2.0.0
- * @license MIT License
- * @copyright 2010 - 2012 Fuel Development Team
- */
- namespace Fuel\Core\Cache\Format;
- /**
- * Formats Cache content using PHP's serialize function
- *
- * @package Fuel\Core
- *
- * @since 1.0.0
- */
- class Serialize implements Formatable
- {
- /**
- * Encodes using serialize()
- *
- * @param mixed $contents
- * @return string
- *
- * @since 1.0.0
- */
- public function encode($contents)
- {
- return serialize($contents);
- }
- /**
- * Decodes using unserialize()
- *
- * @param string $encoded
- * @return mixed
- *
- * @since 1.0.0
- */
- public function decode($encoded)
- {
- return unserialize($encoded);
- }
- }