Files
luos/gulliver/thirdparty/restler/yamlformat/yamlformat.php
Erik Amaru Ortiz 9b1867a410 FEATURE: First commit for ProcessMaker Rest Support
What is Functional

- Restler thirdparty library added
- Restler integration with gulliver added
- Rest requests are dispatched by sysGeneric
- Restler autodiscover for classes that implements Restler iAuthenticate interface added

What Missing

- ProcessMaker Api implemented yet
- some rest api class are in workflow/engine/services/rest/*.php
2012-08-10 16:54:12 -04:00

47 lines
1.0 KiB
PHP

<?php
/**
* YAML Format for Restler Framework
* @category Framework
* @package restler
* @subpackage format
* @author R.Arul Kumaran <arul@luracast.com>
* @copyright 2010 Luracast
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
* @link http://luracast.com/products/restler/
*/
class YamlFormat implements iFormat
{
const MIME ='text/plain';
const EXTENSION = 'yaml';
public function getMIMEMap()
{
return array(YamlFormat::EXTENSION=>YamlFormat::MIME);
}
public function getMIME(){
return YamlFormat::MIME;
}
public function getExtension(){
return YamlFormat::EXTENSION;
}
public function setMIME($mime){
//do nothing
}
public function setExtension($extension){
//do nothing
}
public function encode($data, $human_readable=false){
require_once 'sfyaml.php';
return sfYaml::dump(object_to_array($data));
}
public function decode($data){
require_once 'sfyaml.php';
return sfYaml::load($data);
}
public function __toString(){
return $this->getExtension();
}
}