changing paste read output for API refactoring

This commit is contained in:
El RIDO
2015-10-18 11:08:28 +02:00
parent b92b38cee8
commit f21567133c
7 changed files with 74 additions and 36 deletions

View File

@@ -88,6 +88,23 @@ class helper
return $example;
}
/**
* get example paste
*
* @return array
*/
public static function getPasteAsJson($meta = array())
{
$example = self::getPaste();
if (count($meta))
$example['meta'] = $meta;
$example['comments'] = array();
$example['comment_count'] = 0;
$example['comment_offset'] = 0;
$example['@context'] = 'js/paste.jsonld';
return json_encode($example);
}
/**
* get example paste ID
*