_id stringlengths 2 7 | title stringlengths 3 151 | partition stringclasses 3
values | text stringlengths 83 13k | language stringclasses 1
value | meta_information dict |
|---|---|---|---|---|---|
q247300 | MediaController.retrieveMedia | validation | public function retrieveMedia($id, $includeChildren = false, CachePolicy $cachePolicy = null)
{
$parameters = [
'query' => ['includeChildren' => $includeChildren],
'body' => json_encode([], JSON_UNESCAPED_UNICODE),
'headers' => [],
];
$result ... | php | {
"resource": ""
} |
q247301 | MediaController.retrieveFileData | validation | public function retrieveFileData($id, $template = null, CachePolicy $cachePolicy = null)
{
$parameters = [
'query' => ['template' => $template],
'body' => json_encode([]),
'headers' => [],
];
$result = $this->get('v1/media/' . $id . '/asset', ... | php | {
"resource": ""
} |
q247302 | MediaController.listDeploymentSites | validation | public function listDeploymentSites($id, CachePolicy $cachePolicy = null)
{
$parameters = [
'query' => [],
'body' => json_encode([], JSON_UNESCAPED_UNICODE),
'headers' => [],
];
$result = $this->get('v1/media/' . $id . '/deployment/sites', $pa... | php | {
"resource": ""
} |
q247303 | MediaController.download | validation | public function download($id, $template = null, $templateType = 'image', CachePolicy $cachePolicy = null)
{
$parameters = [
'query' => ['template' => $template, 'templateType' => $templateType],
'body' => json_encode([], JSON_UNESCAPED_UNICODE),
'headers' => [],
... | php | {
"resource": ""
} |
q247304 | MediaController.listFolders | validation | public function listFolders($id, $depth = 0, CachePolicy $cachePolicy = null)
{
$parameters = [
'query' => ['depth' => $depth],
'body' => json_encode([], JSON_UNESCAPED_UNICODE),
'headers' => [],
];
$result = $this->get('v1/media/' . $id . '/f... | php | {
"resource": ""
} |
q247305 | MediaController.listMoodboards | validation | public function listMoodboards($id, CachePolicy $cachePolicy = null)
{
$parameters = [
'query' => [],
'body' => json_encode([], JSON_UNESCAPED_UNICODE),
'headers' => [],
];
$result = $this->get('v1/media/' . $id . '/moodboards', $parameters, $... | php | {
"resource": ""
} |
q247306 | MediaController.listSocialMediaFiles | validation | public function listSocialMediaFiles($id, CachePolicy $cachePolicy = null)
{
$parameters = [
'query' => [],
'body' => json_encode([], JSON_UNESCAPED_UNICODE),
'headers' => [],
];
$result = $this->get('v1/media/' . $id . '/socialmedia/files', $... | php | {
"resource": ""
} |
q247307 | MediaController.listSocialMedia | validation | public function listSocialMedia($id, CachePolicy $cachePolicy = null)
{
$parameters = [
'query' => [],
'body' => json_encode([], JSON_UNESCAPED_UNICODE),
'headers' => [],
];
$result = $this->get('v1/media/' . $id . '/socialmedia/sites', $param... | php | {
"resource": ""
} |
q247308 | MediaController.listUsages | validation | public function listUsages($id, CachePolicy $cachePolicy = null)
{
$parameters = [
'query' => [],
'body' => json_encode([], JSON_UNESCAPED_UNICODE),
'headers' => [],
];
$result = $this->get('v1/media/' . $id . '/usages', $parameters, $cachePol... | php | {
"resource": ""
} |
q247309 | MediaController.listVersions | validation | public function listVersions($id, CachePolicy $cachePolicy = null)
{
$parameters = [
'query' => [],
'body' => json_encode([], JSON_UNESCAPED_UNICODE),
'headers' => [],
];
$result = $this->get('v1/media/' . $id . '/versions', $parameters, $cach... | php | {
"resource": ""
} |
q247310 | MediaController.listComments | validation | public function listComments($mediaId, CachePolicy $cachePolicy = null)
{
$parameters = [
'query' => [],
'body' => json_encode([], JSON_UNESCAPED_UNICODE),
'headers' => [],
];
$result = $this->get('v1/media/' . $mediaId . '/comments', $paramet... | php | {
"resource": ""
} |
q247311 | MediaController.downloadArchive | validation | public function downloadArchive(array $ids, $template = null, CachePolicy $cachePolicy = null)
{
$parameters = [
'query' => ['ids' => $ids, 'template' => $template],
'body' => json_encode([]),
'headers' => [],
];
$result = $this->get('v1/media... | php | {
"resource": ""
} |
q247312 | MediaController.uploadFileChunked | validation | public function uploadFileChunked($fileData, $name, $chunk, $chunks, $fileId, $categoryId, $title = null)
{
$parameters = [
'query' => [
'name' => $name,
'chunk' => $chunk,
'chunks' => $chunks,
'fileId' => $fileId,
... | php | {
"resource": ""
} |
q247313 | MediaController.updateMedia | validation | public function updateMedia($id, Media $media)
{
if ($media instanceof MediaResponse) {
// Downcast to skip unnecessary params.
$media = new Media(json_decode(json_encode($media), true));
}
$parameters = [
'query' => [],
... | php | {
"resource": ""
} |
q247314 | MediaController.group | validation | public function group($id, array $children)
{
$parameters = [
'query' => [],
'body' => json_encode(['children' => $children], JSON_UNESCAPED_UNICODE),
'headers' => [],
];
$result = $this->post('v1/media/' . $id . '/group', $parameters);
... | php | {
"resource": ""
} |
q247315 | MediaController.restoreMedia | validation | public function restoreMedia($id)
{
$parameters = [
'query' => [],
'body' => json_encode([], JSON_UNESCAPED_UNICODE),
'headers' => [],
];
$result = $this->post('v1/media/' . $id . '/restore', $parameters);
$result = new MediaRespon... | php | {
"resource": ""
} |
q247316 | MediaController.setStatus | validation | public function setStatus($id, $status)
{
$parameters = [
'query' => [],
'body' => json_encode(['status' => $status], JSON_UNESCAPED_UNICODE),
'headers' => [],
];
$result = $this->post('v1/media/' . $id . '/status', $parameters);
... | php | {
"resource": ""
} |
q247317 | MediaController.uploadPreview | validation | public function uploadPreview($fileData, $id)
{
$parameters = [
'query' => [],
'multipart' => [
[
'name' => 'file',
'contents' => \GuzzleHttp\Psr7\stream_for($fileData),
'filename' => 'preview-file',
... | php | {
"resource": ""
} |
q247318 | MediaController.uploadNewVersionChunked | validation | public function uploadNewVersionChunked($fileData, $id, $revisionComment, $name, $chunk, $chunks, $fileId)
{
$parameters = [
'query' => [
'revisionComment' => $revisionComment,
'name' => $name,
'chunk' => $chunk,
'chunks' =>... | php | {
"resource": ""
} |
q247319 | MediaController.createComment | validation | public function createComment($mediaId, Comment $comment)
{
$parameters = [
'query' => [],
'body' => json_encode(['comment' => $comment], JSON_UNESCAPED_UNICODE),
'headers' => [],
];
$result = $this->post('v1/media/' . $mediaId . '/comments', ... | php | {
"resource": ""
} |
q247320 | MediaController.combineSlides | validation | public function combineSlides(array $structure)
{
$parameters = [
'query' => [],
'body' => json_encode(['structure' => $structure], JSON_UNESCAPED_UNICODE),
'headers' => [],
];
$result = $this->post('v1/media/slides/combine', $parameters);
... | php | {
"resource": ""
} |
q247321 | MediaController.updateProperties | validation | public function updateProperties($id, array $properties)
{
$parameters = [
'query' => [],
'body' => json_encode(['properties' => $properties], JSON_UNESCAPED_UNICODE),
'headers' => [],
];
$result = $this->put('v1/media/' . $id . '/properties',... | php | {
"resource": ""
} |
q247322 | MediaController.removeMedia | validation | public function removeMedia($id, $hardDelete = false)
{
$parameters = [
'query' => ['hardDelete' => $hardDelete],
'body' => json_encode([], JSON_UNESCAPED_UNICODE),
'headers' => [],
];
$result = $this->delete('v1/media/' . $id . '', $parameter... | php | {
"resource": ""
} |
q247323 | MediaController.removeComment | validation | public function removeComment($mediaId, $commentId)
{
$parameters = [
'query' => [],
'body' => json_encode([], JSON_UNESCAPED_UNICODE),
'headers' => [],
];
$result = $this->delete('v1/media/' . $mediaId . '/comments/' . $commentId . '', $param... | php | {
"resource": ""
} |
q247324 | MediaController.uploadFile | validation | public function uploadFile($pathname, $name, $categoryId, $progress = null, $chunkSize = 10485760)
{
$chunk = 0;
$chunksTotal = ceil(filesize($pathname) / $chunkSize);
$fileId = sha1(uniqid('upload', true));
$fp = fopen($pathname, 'rb');
if (false === ... | php | {
"resource": ""
} |
q247325 | MediaController.uploadNewVersion | validation | public function uploadNewVersion($id, $pathname, $revisionComment, $filename = null, $progress = null, $chunkSize = 10485760)
{
$chunk = 0;
$chunksTotal = ceil(filesize($pathname) / $chunkSize);
$fileId = sha1(uniqid('uploadVersion', true));
$filename = $filename ... | php | {
"resource": ""
} |
q247326 | MoodboardsController.retrieveMoodboard | validation | public function retrieveMoodboard($id, CachePolicy $cachePolicy = null)
{
$parameters = [
'query' => [],
'body' => json_encode([], JSON_UNESCAPED_UNICODE),
'headers' => [],
];
$result = $this->get('v1/moodboards/' . $id . '', $parameters, $cachePolicy);
... | php | {
"resource": ""
} |
q247327 | MoodboardsController.listTemplates | validation | public function listTemplates(CachePolicy $cachePolicy = null)
{
$parameters = [
'query' => [],
'body' => json_encode([], JSON_UNESCAPED_UNICODE),
'headers' => [],
];
$result = $this->get('v1/moodboards/templates', $parameters, $cachePolicy);
fore... | php | {
"resource": ""
} |
q247328 | MoodboardsController.retrieveTemplate | validation | public function retrieveTemplate($templateId, CachePolicy $cachePolicy = null)
{
$parameters = [
'query' => [],
'body' => json_encode([], JSON_UNESCAPED_UNICODE),
'headers' => [],
];
$result = $this->get('v1/moodboards/templates/' . $templateId . '', $par... | php | {
"resource": ""
} |
q247329 | MoodboardsController.createMoodboard | validation | public function createMoodboard(Moodboard $moodboard)
{
$parameters = [
'query' => [],
'body' => json_encode(['moodboard' => $moodboard], JSON_UNESCAPED_UNICODE),
'headers' => [],
];
$result = $this->post('v1/moodboards', $parameters);
$result = n... | php | {
"resource": ""
} |
q247330 | MoodboardsController.updateMoodboard | validation | public function updateMoodboard($id, Moodboard $moodboard)
{
$parameters = [
'query' => [],
'body' => json_encode(['moodboard' => $moodboard], JSON_UNESCAPED_UNICODE),
'headers' => [],
];
$result = $this->post('v1/moodboards/' . $id . '', $parameters);
... | php | {
"resource": ""
} |
q247331 | MoodboardsController.addMediaToMoodboard | validation | public function addMediaToMoodboard($moodboardId, array $mediaIds)
{
$parameters = [
'query' => [],
'body' => json_encode(['mediaIds' => $mediaIds], JSON_UNESCAPED_UNICODE),
'headers' => [],
];
$result = $this->post('v1/moodboards/' . $moodboardId . '/med... | php | {
"resource": ""
} |
q247332 | MoodboardsController.removeMoodboard | validation | public function removeMoodboard($id)
{
$parameters = [
'query' => [],
'body' => json_encode([], JSON_UNESCAPED_UNICODE),
'headers' => [],
];
$result = $this->delete('v1/moodboards/' . $id . '', $parameters);
$result = new MoodboardResponse($result... | php | {
"resource": ""
} |
q247333 | MoodboardsController.removeMediaFromMoodboard | validation | public function removeMediaFromMoodboard($moodboardId, $mediaId)
{
$parameters = [
'query' => [],
'body' => json_encode([], JSON_UNESCAPED_UNICODE),
'headers' => [],
];
$result = $this->delete('v1/moodboards/' . $moodboardId . '/media/' . $mediaId . '', $... | php | {
"resource": ""
} |
q247334 | StringHelper.section | validation | public function section($separator, $first = 0, $last = 0)
{
$sections = explode($separator, $this->string);
$total = count($sections);
$first = intval($first);
$last = intval($last);
if ($first > $total) {
return null;
}
if ($first > $last) {
... | php | {
"resource": ""
} |
q247335 | StringHelper.isUtf8 | validation | public function isUtf8()
{
$pattern = array();
$pattern[] = "[\xC2-\xDF][\x80-\xBF]"; // non-overlong 2-byte
$pattern[] = "\xE0[\xA0-\xBF][\x80-\xBF]"; // excluding overlongs
$pattern[] = "[\xE1-\xEC\xEE\xEF][\x80-\xBF]{2}"; // straight 3-byte
$pattern[] = "\xED[\x80-\x9F][\... | php | {
"resource": ""
} |
q247336 | Client.permAssign | validation | public function permAssign($permid, $permvalue, $permskip = false)
{
return $this->getParent()->clientPermAssign($this["client_database_id"], $permid, $permvalue, $permskip);
} | php | {
"resource": ""
} |
q247337 | Client.memberOf | validation | public function memberOf()
{
$groups = array($this->getParent()->channelGroupGetById($this["client_channel_group_id"]));
foreach (explode(",", $this["client_servergroups"]) as $sgid) {
$groups[] = $this->getParent()->serverGroupGetById($sgid);
}
return $groups;
} | php | {
"resource": ""
} |
q247338 | ControllerAbstract.get | validation | protected function get($endpoint, array $parameters = [], CachePolicy $cachePolicy = null, $fireAndForget = false)
{
return $this->call($endpoint, $parameters, self::METHOD_GET, $cachePolicy, $fireAndForget);
} | php | {
"resource": ""
} |
q247339 | ControllerAbstract.post | validation | protected function post($endpoint, array $parameters = [], $fireAndForget = false)
{
return $this->call($endpoint, $parameters, self::METHOD_POST, null, $fireAndForget);
} | php | {
"resource": ""
} |
q247340 | ControllerAbstract.put | validation | protected function put($endpoint, array $parameters = [], $fireAndForget = false)
{
return $this->call($endpoint, $parameters, self::METHOD_PUT, null, $fireAndForget);
} | php | {
"resource": ""
} |
q247341 | ControllerAbstract.delete | validation | protected function delete($endpoint, array $parameters = [], $fireAndForget = false)
{
return $this->call($endpoint, $parameters, self::METHOD_DELETE, null, $fireAndForget);
} | php | {
"resource": ""
} |
q247342 | PropertysetsController.listPropertySets | validation | public function listPropertySets(CachePolicy $cachePolicy = null)
{
$parameters = [
'query' => [],
'body' => json_encode([], JSON_UNESCAPED_UNICODE),
'headers' => [],
];
$result = $this->get('v1/propertysets', $parameters, $cachePolicy);
foreach (... | php | {
"resource": ""
} |
q247343 | PropertysetsController.listPropertyTypes | validation | public function listPropertyTypes($systemName = null, CachePolicy $cachePolicy = null)
{
$parameters = [
'query' => [],
'body' => json_encode([], JSON_UNESCAPED_UNICODE),
'headers' => [],
];
$result = $this->get('v1/propertysets/propertytypes', $parameter... | php | {
"resource": ""
} |
q247344 | ServerQuery.request | validation | public function request($cmd, $throw = true)
{
$query = StringHelper::factory($cmd)->section(TeamSpeak3::SEPARATOR_CELL);
if (strstr($cmd, "\r") || strstr($cmd, "\n")) {
throw new Ts3Exception("illegal characters in command '" . $query . "'");
} elseif (in_array($query, $this->b... | php | {
"resource": ""
} |
q247345 | ServerQuery.wait | validation | public function wait()
{
if ($this->getTransport()->getConfig("blocking")) {
throw new Ts3Exception("only available in non-blocking mode");
}
do {
$evt = $this->getTransport()->readLine();
var_dump($evt);
} while ($evt instanceof StringHelper &&
... | php | {
"resource": ""
} |
q247346 | ServerQuery.getHost | validation | public function getHost()
{
if ($this->host === null) {
$this->host = new Host($this);
}
return $this->host;
} | php | {
"resource": ""
} |
q247347 | Column.getGridClass | validation | private function getGridClass() {
$class = [];
foreach($this->grid as $grid){
if(!isset($grid['type']) || !isset($grid['size'])){
throw new InvalidConfigException(get_called_class() . ' must have type and size.');
}
if(!isset($grid['positiontype']))
... | php | {
"resource": ""
} |
q247348 | Channel.clientPermList | validation | public function clientPermList($cldbid, $permsid = false)
{
return $this->getParent()->channelClientPermList($this->getId(), $cldbid, $permsid);
} | php | {
"resource": ""
} |
q247349 | Channel.clientPermRemove | validation | public function clientPermRemove($cldbid, $permid)
{
return $this->getParent()->channelClientPermRemove($this->getId(), $cldbid, $permid);
} | php | {
"resource": ""
} |
q247350 | Channel.permAssign | validation | public function permAssign($permid, $permvalue)
{
return $this->getParent()->channelPermAssign($this->getId(), $permid, $permvalue);
} | php | {
"resource": ""
} |
q247351 | Channel.fileList | validation | public function fileList($cpw = "", $path = "/", $recursive = false)
{
return $this->getParent()->channelFileList($this->getId(), $cpw, $path, $recursive);
} | php | {
"resource": ""
} |
q247352 | Channel.fileDelete | validation | public function fileDelete($cpw = "", $name = "/")
{
return $this->getParent()->channelFileDelete($this->getId(), $cpw, $name);
} | php | {
"resource": ""
} |
q247353 | Channel.dirCreate | validation | public function dirCreate($cpw = "", $dirname = "/")
{
return $this->getParent()->channelDirCreate($this->getId(), $cpw, $dirname);
} | php | {
"resource": ""
} |
q247354 | Channel.sendPluginCmd | validation | public function sendPluginCmd($plugin, $data, $cpw = null, $subscribed = false)
{
if ($this->getId() != $this->getParent()->whoamiGet("client_channel_id")) {
$this->getParent()->clientMove($this->getParent()->whoamiGet("client_id"), $this->getId(), $cpw);
}
$this->execute(
... | php | {
"resource": ""
} |
q247355 | Host.version | validation | public function version($ident = null)
{
if ($this->version === null) {
$this->version = $this->request("version")->toList();
}
return ($ident && array_key_exists($ident, $this->version)) ? $this->version[$ident] : $this->version;
} | php | {
"resource": ""
} |
q247356 | Host.serverGetPortById | validation | public function serverGetPortById($sid)
{
if (!array_key_exists((string)$sid, $this->serverList())) {
throw new Ts3Exception("invalid serverID", 0x400);
}
return $this->serverList[intval((string)$sid)]["virtualserver_port"];
} | php | {
"resource": ""
} |
q247357 | Host.serverGetByName | validation | public function serverGetByName($name)
{
foreach ($this->serverList() as $server) {
if ($server["virtualserver_name"] == $name) {
return $server;
}
}
throw new Ts3Exception("invalid serverID", 0x400);
} | php | {
"resource": ""
} |
q247358 | Host.serverGetByUid | validation | public function serverGetByUid($uid)
{
foreach ($this->serverList() as $server) {
if ($server["virtualserver_unique_identifier"] == $uid) {
return $server;
}
}
throw new Ts3Exception("invalid serverID", 0x400);
} | php | {
"resource": ""
} |
q247359 | Host.serverCreate | validation | public function serverCreate(array $properties = array())
{
$this->serverListReset();
$detail = $this->execute("servercreate", $properties)->toList();
$server = new Server($this, array("virtualserver_id" => intval($detail["sid"])));
Signal::getInstance()->emit("notifyServercreated"... | php | {
"resource": ""
} |
q247360 | Host.serverDelete | validation | public function serverDelete($sid)
{
$this->serverListReset();
$this->execute("serverdelete", array("sid" => $sid));
Signal::getInstance()->emit("notifyServerdeleted", $this, $sid);
} | php | {
"resource": ""
} |
q247361 | Host.serverStart | validation | public function serverStart($sid)
{
if ($sid == $this->serverSelectedId()) {
$this->serverDeselect();
}
$this->execute("serverstart", array("sid" => $sid));
$this->serverListReset();
Signal::getInstance()->emit("notifyServerstarted", $this, $sid);
} | php | {
"resource": ""
} |
q247362 | Host.permissionGetIdByName | validation | public function permissionGetIdByName($name)
{
if (!array_key_exists((string)$name, $this->permissionList())) {
throw new Ts3Exception("invalid permission ID", 0xA02);
}
return $this->permissionList[(string)$name]["permid"];
} | php | {
"resource": ""
} |
q247363 | Host.permissionGetNameById | validation | public function permissionGetNameById($permid)
{
foreach ($this->permissionList() as $name => $perm) {
if ($perm["permid"] == $permid) {
return new Ts3Exception($name);
}
}
throw new Ts3Exception("invalid permission ID", 0xA02);
} | php | {
"resource": ""
} |
q247364 | Host.login | validation | public function login($username, $password)
{
$this->execute("login", array("client_login_name" => $username, "client_login_password" => $password));
$this->whoamiReset();
$crypt = new Crypt($username);
$this->setStorage("_login_user", $username);
$this->setStorage("_login_... | php | {
"resource": ""
} |
q247365 | Host.logout | validation | public function logout()
{
$this->request("logout");
$this->whoamiReset();
$this->delStorage("_login_user");
$this->delStorage("_login_pass");
Signal::getInstance()->emit("notifyLogout", $this);
} | php | {
"resource": ""
} |
q247366 | Group.setRoles | validation | public function setRoles(array $roles)
{
$this->roles = [];
foreach ($roles as $item) {
$this->addRole($item);
}
return $this;
} | php | {
"resource": ""
} |
q247367 | Group.addRole | validation | public function addRole($item)
{
if (!($item instanceof Role)) {
if (is_array($item)) {
try {
$item = new Role($item);
} catch (\Exception $e) {
trigger_error('Could not auto-instantiate Role. ' . $e->getMessage(), E_USER_WA... | php | {
"resource": ""
} |
q247368 | Moodboard.setExpireDate | validation | public function setExpireDate($expireDate)
{
if ($expireDate instanceof DateTime) {
$this->expireDate = $expireDate;
} else {
try {
$this->expireDate = new DateTime($expireDate);
} catch (\Exception $e) {
$this->expireDate = null;
... | php | {
"resource": ""
} |
q247369 | Html.getCorpusClass | validation | protected function getCorpusClass()
{
$extras = "";
if ($this->currObj instanceof Channel && $this->currObj->isSpacer()) {
switch ($this->currObj->spacerGetType()) {
case (string)TeamSpeak3::SPACER_SOLIDLINE:
$extras .= " solidline";
... | php | {
"resource": ""
} |
q247370 | Html.getCorpusTitle | validation | protected function getCorpusTitle()
{
if ($this->currObj instanceof Server) {
return "ID: " . $this->currObj->getId() . " | Clients: " . $this->currObj->clientCount(
) . "/" . $this->currObj["virtualserver_maxclients"] . " | Uptime: " . Convert::seconds(
$this->currOb... | php | {
"resource": ""
} |
q247371 | Html.getCorpusName | validation | protected function getCorpusName()
{
if ($this->currObj instanceof Channel && $this->currObj->isSpacer()) {
if ($this->currObj->spacerGetType() != TeamSpeak3::SPACER_CUSTOM) {
return "";
}
$string = $this->currObj["channel_name"]->section("]", 1, 99);
... | php | {
"resource": ""
} |
q247372 | Html.getSuffixIconServer | validation | protected function getSuffixIconServer()
{
$html = "";
if ($this->currObj["virtualserver_icon_id"]) {
if (!$this->currObj->iconIsLocal("virtualserver_icon_id") && $this->ftclient) {
if (!isset($this->cacheIcon[$this->currObj["virtualserver_icon_id"]])) {
... | php | {
"resource": ""
} |
q247373 | Html.getSuffixFlag | validation | protected function getSuffixFlag()
{
if (!$this->currObj instanceof Client) {
return "";
}
if ($this->flagpath && $this->currObj["client_country"]) {
return $this->getImage(
$this->currObj["client_country"]->toLower() . ".png",
$this->... | php | {
"resource": ""
} |
q247374 | Html.getImage | validation | protected function getImage($name, $text = "", $class = null, $iconpath = true, $flagpath = false)
{
$src = "";
if ($iconpath) {
$src = $this->iconpath;
}
if ($flagpath) {
$src = $this->flagpath;
}
return "<img src='" . $src . $name . "' tit... | php | {
"resource": ""
} |
q247375 | DeploymentFile.setMetadata | validation | public function setMetadata($metadata)
{
if (is_array($metadata)) {
$this->metadata = $metadata;
return $this;
}
$this->metadata = json_decode($metadata, true);
if (null === $this->metadata) {
$this->metadata = $metadata;
}
return... | php | {
"resource": ""
} |
q247376 | SearchController.search | validation | public function search(Search $search, $returnType = self::RETURN_OBJECTS, CachePolicy $cachePolicy = null)
{
$parameters = [
'query' => ['returnType' => $returnType],
'body' => json_encode(['search' => $search], JSON_UNESCAPED_UNICODE),
'headers' => [],
];
... | php | {
"resource": ""
} |
q247377 | SearchController.folderSearch | validation | public function folderSearch(FolderSearch $search)
{
$parameters = [
'query' => [],
'body' => json_encode(['search' => $search], JSON_UNESCAPED_UNICODE),
'headers' => [],
];
$result = $this->post('v1/search/folder', $parameters);
$result = new Sea... | php | {
"resource": ""
} |
q247378 | SearchController.searchtotal | validation | public function searchtotal(Search $search)
{
$parameters = [
'query' => [],
'body' => json_encode(['search' => $search], JSON_UNESCAPED_UNICODE),
'headers' => [],
];
$result = $this->post('v1/search/total', $parameters);
return $result;
} | php | {
"resource": ""
} |
q247379 | Uri.parseUri | validation | protected function parseUri($uriString = '')
{
$status = @preg_match("~^((//)([^/?#]*))([^?#]*)(\?([^#]*))?(#(.*))?$~", $uriString, $matches);
if ($status === false) {
throw new Ts3Exception("URI scheme-specific decomposition failed");
}
if (!$status) {
retu... | php | {
"resource": ""
} |
q247380 | Uri.check | validation | public static function check($uri)
{
try {
$uri = new self(strval($uri));
} catch (Ts3Exception $e) {
return false;
}
return $uri->valid();
} | php | {
"resource": ""
} |
q247381 | Uri.checkUser | validation | public function checkUser($username = null)
{
if ($username === null) {
$username = $this->user;
}
if (strlen($username) == 0) {
return true;
}
$pattern = "/^(" . $this->regex["alphanum"] . "|" . $this->regex["mark"] . "|" . $this->regex["escaped"] .... | php | {
"resource": ""
} |
q247382 | Uri.checkPass | validation | public function checkPass($password = null)
{
if ($password === null) {
$password = $this->pass;
}
if (strlen($password) == 0) {
return true;
}
$pattern = "/^(" . $this->regex["alphanum"] . "|" . $this->regex["mark"] . "|" . $this->regex["escaped"] .... | php | {
"resource": ""
} |
q247383 | Uri.checkPath | validation | public function checkPath($path = null)
{
if ($path === null) {
$path = $this->path;
}
if (strlen($path) == 0) {
return true;
}
$pattern = "/^" . $this->regex["path"] . "$/";
$status = @preg_match($pattern, $path);
if ($status === fa... | php | {
"resource": ""
} |
q247384 | Uri.checkQuery | validation | public function checkQuery($query = null)
{
if ($query === null) {
$query = $this->query;
}
if (strlen($query) == 0) {
return true;
}
$pattern = "/^" . $this->regex["uric"] . "*$/";
$status = @preg_match($pattern, $query);
if ($statu... | php | {
"resource": ""
} |
q247385 | Uri.hasQueryVar | validation | public function hasQueryVar($key)
{
if (!$this->hasQuery()) {
return false;
}
parse_str($this->query, $queryArray);
return array_key_exists($key, $queryArray) ? true : false;
} | php | {
"resource": ""
} |
q247386 | Uri.checkFragment | validation | public function checkFragment($fragment = null)
{
if ($fragment === null) {
$fragment = $this->fragment;
}
if (strlen($fragment) == 0) {
return true;
}
$pattern = "/^" . $this->regex["uric"] . "*$/";
$status = @preg_match($pattern, $fragment)... | php | {
"resource": ""
} |
q247387 | Response.setStatusCode | validation | public function setStatusCode(int $value = null)
{
if (is_null($value)) {
return $this;
}
$this->statusCode = $value;
return $this;
} | php | {
"resource": ""
} |
q247388 | Response.sendHeaders | validation | public function sendHeaders()
{
if (php_sapi_name() !== "cli" && headers_sent($file, $line)) {
throw new Exception("Try to send headers but headers already sent, output started at $file line $line.");
}
http_response_code($this->statusCode);
foreach ($this->headers as $... | php | {
"resource": ""
} |
q247389 | Response.setBody | validation | public function setBody($body)
{
if (is_string($body)) {
$this->body = $body;
} elseif (is_array($body)) {
$this->setJsonBody($body);
} elseif (is_callable($body)) {
ob_start();
$res1 = call_user_func($body);
$res2 = ob_get_contents... | php | {
"resource": ""
} |
q247390 | Response.sendJson | validation | public function sendJson($data, $statusCode = null)
{
return $this->setStatusCode($statusCode)
->setJsonBody($data)
->send();
} | php | {
"resource": ""
} |
q247391 | Response.setJsonBody | validation | public function setJsonBody($data)
{
$this->addHeader("Content-Type: application/json; charset=utf8");
$this->setBody(json_encode($data, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES));
return $this;
} | php | {
"resource": ""
} |
q247392 | Response.redirect | validation | public function redirect(string $url) : object
{
$this->addHeader("Location: " . $url);
$this->body = null;
return $this;
} | php | {
"resource": ""
} |
q247393 | ActiveForm.run | validation | public function run()
{
if (!empty($this->_fields)) {
throw new InvalidCallException('Each beginField() should have a matching endField() call.');
}
$id = $this->options['id'];
$options = Json::encode($this->getClientOptions());
$attributes = Json::encode($this->... | php | {
"resource": ""
} |
q247394 | PropertyResponse.setPropertyType | validation | public function setPropertyType($propertyType)
{
if ($propertyType instanceof PropertyType) {
$this->propertyType = $propertyType;
} elseif (is_array($propertyType)) {
$this->propertyType = new PropertyType($propertyType);
} else {
$this->propertyType = nu... | php | {
"resource": ""
} |
q247395 | PropertyResponse.setValue | validation | public function setValue($value)
{
$definition = $this->propertyType->getDefinition();
if (isset($definition['hierarchical']) && $definition['hierarchical']) {
$this->value = [];
foreach ($value as $v) {
foreach ($v['value'] as $itemValue) {
... | php | {
"resource": ""
} |
q247396 | PropertyResponse.convertValue | validation | protected function convertValue($value)
{
switch ($this->propertyType->getDataTypeId()) {
case PropertyType::DATATYPE_BOOLEAN:
return (bool) $value;
break;
case PropertyType::DATATYPE_DATETIME:
if ($value instanceof \DateTime) {
... | php | {
"resource": ""
} |
q247397 | ResponseUtility.redirect | validation | public function redirect(string $url) : object
{
return parent::redirect($this->di->get("url")->create($url));
} | php | {
"resource": ""
} |
q247398 | ResponseUtility.redirectSelf | validation | public function redirectSelf() : object
{
$url = $this->di->get("request")->getCurrentUrl();
return parent::redirect($this->di->get("url")->create($url));
} | php | {
"resource": ""
} |
q247399 | Breadcrumbs.renderItem | validation | protected function renderItem($link, $template)
{
if (isset($link['label'])) {
$label = $this->encodeLabels ? Html::encode($link['label']) : $link['label'];
} else {
throw new InvalidConfigException('The "label" element is required for each link.');
}
if($link... | php | {
"resource": ""
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.