Updated Development (markdown)

rugk 2016-07-20 14:38:19 +02:00
parent 3add630b87
commit 30599d1b14

@ -51,28 +51,30 @@ Note that it can take an hour or longer to run the several thousand tests.
If you want to create your own data models, you might want to know how the arrays, that you have to store, look like:
public function create($pasteid, $paste)
{
$pasteid = substr(hash('md5', $paste['data']), 0, 16);
$paste['data'] // text
$paste['meta']['postdate'] // int UNIX timestamp
$paste['meta']['expire_date'] // int UNIX timestamp
$paste['meta']['opendiscussion'] // true (if false it is unset)
$paste['meta']['burnafterreading'] // true (if false it is unset; if true, then opendiscussion is unset)
$paste['meta']['formatter'] // string
$paste['meta']['attachment'] // text
$paste['meta']['attachmentname'] // text
}
public function createComment($pasteid, $parentid, $commentid, $comment)
{
$pasteid // the id of the paste this comment belongs to
$parentid // the id of the parent of this comment, may be the paste id itself
$commentid = substr(hash('md5', $paste['data']), 0, 16);
$comment['data'] // text
$comment['meta']['nickname'] // text or null (if anonymous)
$comment['meta']['vizhash'] // text or null (if anonymous)
$comment['meta']['postdate'] // int UNIX timestamp
}
```php
public function create($pasteid, $paste)
{
$pasteid = substr(hash('md5', $paste['data']), 0, 16);
$paste['data'] // text
$paste['meta']['postdate'] // int UNIX timestamp
$paste['meta']['expire_date'] // int UNIX timestamp
$paste['meta']['opendiscussion'] // true (if false it is unset)
$paste['meta']['burnafterreading'] // true (if false it is unset; if true, then opendiscussion is unset)
$paste['meta']['formatter'] // string
$paste['meta']['attachment'] // text
$paste['meta']['attachmentname'] // text
}
public function createComment($pasteid, $parentid, $commentid, $comment)
{
$pasteid // the id of the paste this comment belongs to
$parentid // the id of the parent of this comment, may be the paste id itself
$commentid = substr(hash('md5', $paste['data']), 0, 16);
$comment['data'] // text
$comment['meta']['nickname'] // text or null (if anonymous)
$comment['meta']['vizhash'] // text or null (if anonymous)
$comment['meta']['postdate'] // int UNIX timestamp
}
```