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
1
root
app
Rest
Search
Show Hidden Files
Edit File: /data/www/19068/fszoo_net/www/api/1/root/app/Rest/Search/Search.php
<?php /** * Copyright (c) Jan Pospisil (http://www.jan-pospisil.cz) */ namespace Rest\Search; use Nette\Database\Context; use Nette\Utils\Strings; use Nette\Utils\Validators; use RestServer\Exceptions\BadRequestException; use RestServer\Exceptions\MissingRequiredParameterException; use RestServer\IParametrs; use RestServer\IPresenter; use RestServer\Response; /** * Search q or all is required * @param ( * name = q, * type = string, * ) * @param ( * name = all, * type = bool, * ) * @author Jan Pospisil */ class Search extends \Nette\Object implements IPresenter { private $connection; public function __construct(Context $context){ $this->connection = $context; } public function run(IParametrs $parameters, Response $response) { $q = $parameters->get('q'); $all = $parameters->get('all'); $limit = $parameters->get('limit'); $truncate = $parameters->get('truncate'); $img_medium = $parameters->get('img_medium'); if(!$q AND !$all) throw new MissingRequiredParameterException('Parameter q or all is required.'); if($limit && !Validators::isNumericInt($limit)) throw new BadRequestException('Limit must be number.'); if($q) $result = $this->connection->table('search')->where('title LIKE ? OR description LIKE ? OR keywords LIKE ?', '%'.$q.'%', '%'.$q.'%', '%'.$q.'%')->order('priority DESC'); elseif($all) $result = $this->connection->table('search'); if($limit) $result->limit($limit); $data = array(); foreach($result as $row){ $xrow = array( 'title' => $row->title, 'description' => $truncate ? Strings::truncate($row->description, (int)$truncate) : $row->description, 'url' => $row->url, 'image' => $row->image, 'keywords' => $row->keywords, 'priority' => $row->priority, 'id' => $row->id ); if($img_medium){ $xrow['image140'] = $row->image140; } $data[] = $xrow; } $response->data = $data; } }
Crotin
Name
Size
Permissions
Modified
User/Group
Search.php
1941
0644
2016-02-18 20:19:01
Unknown/Unknown
Add.php
4275
0644
2016-02-22 19:01:20
Unknown/Unknown
NGANU
Rename
Hapus
Chmod
Chown
Touch
Zip
Unzip
Download
Crotin