_id stringlengths 2 7 | title stringlengths 3 151 | partition stringclasses 3
values | text stringlengths 83 13k | language stringclasses 1
value | meta_information dict |
|---|---|---|---|---|---|
q264600 | JsonDecodeFile.parse | test | protected static function parse($json, $assoc = false)
{
$falgs = JsonParser::DETECT_KEY_CONFLICTS;
if ($assoc) {
$falgs |= JsonParser::PARSE_TO_ASSOC;
}
$parser = new JsonParser();
return $parser->parse($json, $falgs);
} | php | {
"resource": ""
} |
q264601 | JsonDecodeFile.call | test | public static function call($path, $assoc = false)
{
return self::parse(BomUtil::removeBom(self::readFile($path)), $assoc);
} | php | {
"resource": ""
} |
q264602 | AbstractNavigationRenderer.normalizeId | test | protected function normalizeId(string $value): string
{
if (strstr($value, '[')) {
if ('[]' == substr($value, -2)) {
$value = substr($value, 0, strlen($value) - 2);
}
$value = trim($value, ']');
$value = str_replace('][', '-', $value);
... | php | {
"resource": ""
} |
q264603 | AbstractNavigationRenderer.cleanAttributes | test | protected function cleanAttributes(array $input, array $valid): array
{
foreach ($input as $key => $value) {
if (preg_match('/^data-(.+)/', $key) || in_array($key, $valid)) {
continue;
}
unset($input[$key]);
}
return $input;
} | php | {
"resource": ""
} |
q264604 | Label.setValue | test | public function setValue($value)
{
if ($this->element) {
$this->element->SetLabel($value);
}
$this->value = $value;
} | php | {
"resource": ""
} |
q264605 | Collection.add | test | public function add(ElementInterface $element)
{
$id = $element->id;
if ($id === null) $id = $this->generateId();
$element->id = $id;
$this->checkId($id);
$this->objects[] = $element;
if (count($this->objects) === 1) {
array_unshift($this->objects, 'p... | php | {
"resource": ""
} |
q264606 | Collection.getTopLevelWindow | test | public function getTopLevelWindow()
{
foreach ($this->objects as $object) {
if ($object instanceof Frame
or $object instanceof Dialog) {
return $object;
}
}
} | php | {
"resource": ""
} |
q264607 | Collection.remove | test | public function remove($element)
{
$trueId = $this->getTrueId($element);
$this->objects[$trueId]->destroy();
unset($this->objects[$trueId]);
unset($this->ids[$trueId]);
} | php | {
"resource": ""
} |
q264608 | Collection.getElementById | test | public function getElementById($id)
{
$id = $this->getTrueId($id);
if ($id === false) {
// Throw something
return;
}
return $this->objects[$id];
} | php | {
"resource": ""
} |
q264609 | BaseConfigurationModel.loadState | test | public function loadState($statePath)
{
$filename = Yii::getAlias($statePath . $this->stateFilename() . '.php');
if (is_readable($filename) === true) {
$this->loadAttributesFromState(
include($filename)
);
return true;
} else {
... | php | {
"resource": ""
} |
q264610 | BaseConfigurationModel.saveState | test | public function saveState($statePath)
{
$filename = Yii::getAlias($statePath . $this->stateFilename() . '.php');
$writer = new ApplicationConfigWriter([
'filename' => $filename,
]);
$writer->configuration = $this->getAttributesForStateSaving();
$result = $writer-... | php | {
"resource": ""
} |
q264611 | Column.setDataType | test | public function setDataType($type)
{
$types = array('integer', 'string', 'string');
$shorthand = array('int', 'varchar', 'text');
$index = array_search($type, $shorthand);
$this->type = $index === false ? $type : $types[$index];
return $this;
} | php | {
"resource": ""
} |
q264612 | Connection.onChannelCreated | test | function onChannelCreated($command)
{
$channelId = $command->getResult();
$channel = $this->server->request('channelinfo cid='.$channelId)->toList();
$channel['cid'] = $channelId;
new Channel($channel, $this->getChannelPermissionList($channel));
} | php | {
"resource": ""
} |
q264613 | ExtensionDataHelper.getLocalizedVersionedDataField | test | public static function getLocalizedVersionedDataField($data, $type, $field)
{
$string = '';
$langId = Yii::$app->language;
if (false === empty($data['package']['versions'][self::$currentVersion]['extra'][$type][$field . '_' . $langId])) {
$string = $data['package']['versions'][se... | php | {
"resource": ""
} |
q264614 | ExtensionDataHelper.getLocalizedDataField | test | public static function getLocalizedDataField($data, $type, $field)
{
$string = '';
$langId = Yii::$app->language;
if (false === empty($data['extra'][$type][$field . '_' . $langId])) {
$string = $data['extra'][$type][$field . '_' . $langId];
} elseif (false === empty($data... | php | {
"resource": ""
} |
q264615 | ExtensionDataHelper.getOtherPackageVersionedData | test | public static function getOtherPackageVersionedData($data, $key, $asArray = true)
{
$out = [];
if (false === empty($data['package']['versions'][self::$currentVersion][$key])) {
$out = $data['package']['versions'][self::$currentVersion][$key];
}
if (true === $asArray) {
... | php | {
"resource": ""
} |
q264616 | ExtensionDataHelper.getOtherPackageData | test | public static function getOtherPackageData($data, $key, $asArray = false)
{
$out = null;
if (false === empty($data[$key])) {
$out = $data[$key];
}
if (true === $asArray) {
$out = is_array($out) ? $out : [$out];
} else {
$out = is_array($out... | php | {
"resource": ""
} |
q264617 | ExtensionDataHelper.humanizeReadme | test | public static function humanizeReadme($data)
{
$readme = '';
$data = Json::decode($data);
if (false === empty($data['content'])) {
$content = base64_decode(str_replace('\n', '', $data['content']));
$parser = new GithubMarkdown();
$readme = $parser->parse($... | php | {
"resource": ""
} |
q264618 | ExtensionDataHelper.prepareMigrationTask | test | public static function prepareMigrationTask(
array $ext,
ReportingChain $chain,
$way = ExtensionsManager::MIGRATE_TYPE_UP,
$group
) {
if ($ext['composer_type'] == Extension::TYPE_DOTPLANT) {
$extData = ComposerInstalledSet::get()->getInstalled($ext['composer_name... | php | {
"resource": ""
} |
q264619 | ExtensionDataHelper.buildTask | test | public static function buildTask($command, $groupName)
{
$groupConfig = [
'email_notification' => 0,
'allow_parallel_run' => 0,
'group_notifications' => 0,
'run_last_command_only' => 0,
];
if (null === $group = DeferredGroup::findOne(['name' =>... | php | {
"resource": ""
} |
q264620 | Router.match | test | public function match(array $server = [], array $post)
{
$requestMethod = $server['REQUEST_METHOD'];
$requestUri = $server['REQUEST_URI'];
$restMethod = $this->getRestfullMethod($post);
// check if REST request is made
if (null === $restMethod && !in_array($requestMethod, a... | php | {
"resource": ""
} |
q264621 | Router.parseRegexRoute | test | protected function parseRegexRoute($requestUri, $resource)
{
$route = preg_replace_callback(self::REGVAL, function ($matches) {
$patterns = $this->patterns;
$matches[0] = str_replace(['{', '}'], '', $matches[0]);
if (in_array($matches[0], array_keys($patterns))) {
... | php | {
"resource": ""
} |
q264622 | PropertiesValidator.checkStrictness | test | protected function checkStrictness(ContainerResult $container, $object): void
{
$properties = $this->getProperties();
foreach ($object as $property => $value) {
if (array_key_exists($property, $properties) === false) {
$container->addResult(
$this->get... | php | {
"resource": ""
} |
q264623 | AbstractAdapter.getProfiler | test | public function getProfiler()
{
return \ManiaLivePlugins\Standard\TeamSpeak\TeamSpeak3\Helper\Profiler::get(spl_object_hash($this));
} | php | {
"resource": ""
} |
q264624 | AbstractAdapter.initTransport | test | protected function initTransport($options, $transport = '\ManiaLivePlugins\Standard\TeamSpeak\TeamSpeak3\Transport\TCP')
{
if(!is_array($options))
{
throw new Exception("transport parameters must provided in an array");
}
$this->transport = new $transport($options);
} | php | {
"resource": ""
} |
q264625 | BaseActionsInfoTrait.getBlameableAttributes | test | protected function getBlameableAttributes()
{
return [
ActiveRecord::EVENT_BEFORE_INSERT => [$this->createdByAttribute, $this->updatedByAttribute],
ActiveRecord::EVENT_BEFORE_UPDATE => $this->updatedByAttribute,
];
} | php | {
"resource": ""
} |
q264626 | BaseActionsInfoTrait.getTimestampAttributes | test | protected function getTimestampAttributes()
{
return [
ActiveRecord::EVENT_BEFORE_INSERT => [$this->createdAtAttribute, $this->updatedAtAttribute],
ActiveRecord::EVENT_BEFORE_UPDATE => $this->updatedAtAttribute,
];
} | php | {
"resource": ""
} |
q264627 | BaseActionsInfoTrait.evaluateAttributesInternal | test | public function evaluateAttributesInternal($event)
{
if (empty($event->data['attributes']) === false) {
$methodName = $event->data['methodName'];
$value = $this->$methodName($event);
foreach ((array) $event->data['attributes'] as $attribute) {
if (is_strin... | php | {
"resource": ""
} |
q264628 | BaseActionsInfoTrait.BaseActionsInfoTraitInit | test | public function BaseActionsInfoTraitInit()
{
/** @var ActiveRecord|self $this */
foreach ($this->blameableAttributes as $eventName => $attributes) {
$this->on(
$eventName,
[$this, 'evaluateAttributesInternal'],
[
'attrib... | php | {
"resource": ""
} |
q264629 | CoreAuthHandler.before_request | test | public function before_request( &$url, &$headers, &$data )
{
// generate a date string
$date = new \DateTime('NOW', new \DateTimeZone("GMT"));
$headers['Date'] = $date->format("D, d M Y H:i:s \G\M\T");
// build up the data to be signed
$request_data = $headers['Date']."\n".$url."\n";
if( !empty... | php | {
"resource": ""
} |
q264630 | CoreAuthHandler.after_request | test | public function after_request( \Requests_Response &$return )
{
$headers = $return->headers;
$url = $return->url;
$data = $return->body;
$signature = $headers['x-signature'];
if( $this->debug )
{
echo "\n\nResponse Data:\n";
var_dump($return);
}
// Check if signature header exists, ... | php | {
"resource": ""
} |
q264631 | UDP.read | test | public function read($length = 4096)
{
$this->connect();
$this->waitForReadyRead();
$data = @fread($this->stream, $length);
\ManiaLivePlugins\Standard\TeamSpeak\TeamSpeak3\Helper\Signal::getInstance()->emit(strtolower($this->getAdapterType()) . "DataRead", $data);
if($data === FALSE)
... | php | {
"resource": ""
} |
q264632 | UDP.send | test | public function send($data)
{
$this->connect();
@stream_socket_sendto($this->stream, $data);
\ManiaLivePlugins\Standard\TeamSpeak\TeamSpeak3\Helper\Signal::getInstance()->emit(strtolower($this->getAdapterType()) . "DataSend", $data);
} | php | {
"resource": ""
} |
q264633 | MysqlController.actionRestore | test | public function actionRestore($fileName = null)
{
try {
$this->stdout(\Yii::t('skeeks/dbDumper', "The installation process is running the database")."\n");
\Yii::$app->dbDumper->restore($fileName);
$this->stdout(\Yii::t('skeeks/dbDumper', "Dump successfully installed")."\... | php | {
"resource": ""
} |
q264634 | MysqlController.actionDump | test | public function actionDump()
{
try {
$result = \Yii::$app->dbDumper->dump();
$this->stdout(\Yii::t('skeeks/dbDumper', "Dump the database was created successfully").": {$result}\n",
Console::FG_GREEN);
$removed = \Yii::$app->dbDumper->clear();
i... | php | {
"resource": ""
} |
q264635 | Menubar.initMenu | test | function initMenu($icon, $pluginId = null)
{
$id = explode('\\', $pluginId);
$this->menu[$pluginId] = array('name' => end($id), 'icon' => $icon, 'buttons' => array());
if($this->loaded)
$this->refreshMenubar();
} | php | {
"resource": ""
} |
q264636 | Menubar.addButton | test | function addButton($name, $callback, $admin = false, $pluginId = null)
{
if(!isset($this->menu[$pluginId]))
$this->initMenu(Icons128x128_1::DefaultIcon, $pluginId);
$this->menu[$pluginId]['buttons'][] = array('name' => $name, 'callback' => $callback, 'admin' => $admin);
if($this->loaded)
$this->refre... | php | {
"resource": ""
} |
q264637 | Install.fire | test | public function fire()
{
$handle = popen(PHP_BINDIR.'/pecl install wxwidgets 2>&1', 'r');
while ( ! feof($handle)) {
$this->output->write(fread($handle, 2048));
}
} | php | {
"resource": ""
} |
q264638 | Table.populateColumnsWithLongestValue | test | public function populateColumnsWithLongestValue()
{
$query = DB::table($this->name);
foreach ($this->columns as $column) {
if ($column->isNumeric()) {
$query->addSelect(DB::raw('MAX(`' . $column->name . '`) as `' . $column->name . '`'));
}
if ($col... | php | {
"resource": ""
} |
q264639 | Table.populateNumericColumnsWithLongestValue | test | public function populateNumericColumnsWithLongestValue()
{
$query = DB::table($this->name);
foreach ($this->columns as $column) {
if ($column->isNumeric()) {
$query->addSelect(DB::raw('MIN(`' . $column->name . '`) as `' . $column->name . '`'));
}
}
... | php | {
"resource": ""
} |
q264640 | JsonTransformer.transform | test | public function transform($json)
{
if (!is_string($json)) {
throw new \InvalidArgumentException('$json variable is not a string.');
}
$assocArrayJson = json_decode($json, true);
return $this->checkDecodedJson($assocArrayJson);
} | php | {
"resource": ""
} |
q264641 | DoctrineORMServiceProvider.register | test | public function register(Application $app)
{
$app['doctrine_orm.configuration'] = $app->share(function ($app) {
$configuration = new Configuration();
$mCache = isset($app['doctrine_orm.metadata_cache']) ? $app['doctrine_orm.metadata_cache'] : new Cache();
$qCache = isset... | php | {
"resource": ""
} |
q264642 | PageFetcherRequest.setFile | test | public function setFile(string $name, FilePathInterface $filePath): void
{
$this->rawContent = '';
$this->files[$name] = $filePath;
} | php | {
"resource": ""
} |
q264643 | PageFetcherRequest.setPostField | test | public function setPostField(string $name, string $value): void
{
$this->rawContent = '';
$this->postFields[$name] = $value;
} | php | {
"resource": ""
} |
q264644 | PageFetcherRequest.setRawContent | test | public function setRawContent(string $rawContent): void
{
$this->postFields = [];
$this->files = [];
$this->rawContent = $rawContent;
} | php | {
"resource": ""
} |
q264645 | ClassResolver.resolve | test | public function resolve($abstract, $parameters = array())
{
$concrete = $this->getConcrete($abstract);
// We're ready to instantiate an instance of the concrete type registered for
// the binding. This will instantiate the types, as well as resolve any of
// its "nested" dependencie... | php | {
"resource": ""
} |
q264646 | ClassResolver.bind | test | public function bind($abstract, $concrete, $protect = false)
{
if ($protect) {
$concrete = $this->container->protect($concrete);
}
$this->container[$abstract] = $concrete;
} | php | {
"resource": ""
} |
q264647 | ClassResolver.getConcrete | test | protected function getConcrete($abstract)
{
// If we don't have a registered resolver or concrete for the type, we'll just
// assume each type is a concrete name and will attempt to resolve it as is
// since the container should be able to resolve concretes automatically.
if (!is_sca... | php | {
"resource": ""
} |
q264648 | ClassResolver.dispatchEvent | test | protected function dispatchEvent($name, Event $event)
{
if ($this->dispatcher) {
$this->dispatcher->dispatch($name, $event);
}
} | php | {
"resource": ""
} |
q264649 | Server.channelSpacerGetType | test | public function channelSpacerGetType($cid)
{
$channel = $this->channelGetById($cid);
if(!$this->channelIsSpacer($channel))
{
throw new \ManiaLivePlugins\Standard\TeamSpeak\TeamSpeak3\Adapter\ServerQuery\Exception("invalid channel flags", 0x307);
}
switch($channel["channel_name"]->... | php | {
"resource": ""
} |
q264650 | Server.channelSpacerGetAlign | test | public function channelSpacerGetAlign($cid)
{
$channel = $this->channelGetById($cid);
if(!$this->channelIsSpacer($channel) || !preg_match("/\[(.*)spacer.*\]/", $channel, $matches) || !isset($matches[1]))
{
throw new \ManiaLivePlugins\Standard\TeamSpeak\TeamSpeak3\Adapter\ServerQuery\Exception... | php | {
"resource": ""
} |
q264651 | Server.channelPermAssign | test | public function channelPermAssign($cid, $permid, $permvalue)
{
$permident = (is_numeric($permid)) ? "permid" : "permsid";
$this->execute("channeladdperm", array("cid" => $cid, $permident => $permid, "permvalue" => $permvalue));
} | php | {
"resource": ""
} |
q264652 | Server.channelPermRemove | test | public function channelPermRemove($cid, $permid)
{
$permident = (is_numeric($permid)) ? "permid" : "permsid";
$this->execute("channeldelperm", array("cid" => $cid, $permident => $permid));
} | php | {
"resource": ""
} |
q264653 | Server.channelClientPermAssign | test | public function channelClientPermAssign($cid, $cldbid, $permid, $permvalue)
{
$permident = (is_numeric($permid)) ? "permid" : "permsid";
$this->execute("channelclientaddperm", array("cid" => $cid, "cldbid" => $cldbid, $permident => $permid, "permvalue" => $permvalue));
} | php | {
"resource": ""
} |
q264654 | Server.channelClientPermRemove | test | public function channelClientPermRemove($cid, $cldbid, $permid)
{
$permident = (is_numeric($permid)) ? "permid" : "permsid";
$this->execute("channelclientdelperm", array("cid" => $cid, "cldbid" => $cldbid, $permident => $permid));
} | php | {
"resource": ""
} |
q264655 | Server.channelFileList | test | public function channelFileList($cid, $cpw = "", $path = "/", $recursive = FALSE)
{
$files = $this->execute("ftgetfilelist", array("cid" => $cid, "cpw" => $cpw, "path" => $path))->toArray();
$count = count($files);
for($i = 0; $i < $count; $i++)
{
$files[$i]["cid"] = $files[0]["cid"];
... | php | {
"resource": ""
} |
q264656 | Server.clientGetById | test | public function clientGetById($clid)
{
if(!array_key_exists((string) $clid, $this->clientList()))
{
throw new \ManiaLivePlugins\Standard\TeamSpeak\TeamSpeak3\Adapter\ServerQuery\Exception("invalid clientID", 0x200);
}
return $this->clientList[intval((string) $clid)];
} | php | {
"resource": ""
} |
q264657 | Server.clientGetByUid | test | public function clientGetByUid($uid)
{
foreach($this->clientList() as $client)
{
if($client["client_unique_identifier"] == $uid) return $client;
}
throw new \ManiaLivePlugins\Standard\TeamSpeak\TeamSpeak3\Adapter\ServerQuery\Exception("invalid clientID", 0x200);
} | php | {
"resource": ""
} |
q264658 | Server.clientMove | test | public function clientMove($clid, $cid, $cpw = null)
{
$this->clientListReset();
$this->execute("clientmove", array("clid" => $clid, "cid" => $cid, "cpw" => $cpw));
if($clid == $this->whoamiGet("client_id"))
{
$this->getParent()->whoamiSet("client_channel_id", $cid);
}
} | php | {
"resource": ""
} |
q264659 | Server.clientKick | test | public function clientKick($clid, $reasonid = \ManiaLivePlugins\Standard\TeamSpeak\TeamSpeak3\TeamSpeak3::KICK_CHANNEL, $reasonmsg = null)
{
$this->clientListReset();
$this->execute("clientkick", array("clid" => $clid, "reasonid" => $reasonid, "reasonmsg" => $reasonmsg));
} | php | {
"resource": ""
} |
q264660 | Server.clientPermRemove | test | public function clientPermRemove($cldbid, $permid)
{
$permident = (is_numeric($permid)) ? "permid" : "permsid";
$this->execute("clientdelperm", array("cldbid" => $cldbid, $permident => $permid));
} | php | {
"resource": ""
} |
q264661 | Server.serverGroupGetById | test | public function serverGroupGetById($sgid)
{
if(!array_key_exists((string) $sgid, $this->serverGroupList()))
{
throw new \ManiaLivePlugins\Standard\TeamSpeak\TeamSpeak3\Adapter\ServerQuery\Exception("invalid groupID", 0xA00);
}
return $this->sgroupList[intval((string) $sgid)];
} | php | {
"resource": ""
} |
q264662 | Server.serverGroupGetByName | test | public function serverGroupGetByName($name, $type = \ManiaLivePlugins\Standard\TeamSpeak\TeamSpeak3\TeamSpeak3::GROUP_DBTYPE_REGULAR)
{
foreach($this->serverGroupList() as $group)
{
if($group["name"] == $name && $group["type"] == $type) return $group;
}
throw new \ManiaLivePlugins\Standa... | php | {
"resource": ""
} |
q264663 | Server.serverGroupPermAssign | test | public function serverGroupPermAssign($sgid, $permid, $permvalue, $permnegated = FALSE, $permskip = FALSE)
{
$permident = (is_numeric($permid)) ? "permid" : "permsid";
$this->execute("servergroupaddperm", array("sgid" => $sgid, $permident => $permid, "permvalue" => $permvalue, "permnegated" => $permnegat... | php | {
"resource": ""
} |
q264664 | Server.serverGroupGetProfiles | test | public function serverGroupGetProfiles()
{
$profiles = array();
foreach($this->serverGroupList() as $sgid => $sgroup)
{
if($sgroup["type"] != \ManiaLivePlugins\Standard\TeamSpeak\TeamSpeak3\TeamSpeak3::GROUP_DBTYPE_REGULAR) continue;
$profiles[$sgid] = array(
"b_permission_m... | php | {
"resource": ""
} |
q264665 | Server.channelGroupGetById | test | public function channelGroupGetById($cgid)
{
if(!array_key_exists((string) $cgid, $this->channelGroupList()))
{
throw new \ManiaLivePlugins\Standard\TeamSpeak\TeamSpeak3\Adapter\ServerQuery\Exception("invalid groupID", 0xA00);
}
return $this->cgroupList[intval((string) $cgid)];
} | php | {
"resource": ""
} |
q264666 | Server.channelGroupGetByName | test | public function channelGroupGetByName($name, $type = \ManiaLivePlugins\Standard\TeamSpeak\TeamSpeak3\TeamSpeak3::GROUP_DBTYPE_REGULAR)
{
foreach($this->channelGroupList() as $group)
{
if($group["name"] == $name && $group["type"] == $type) return $group;
}
throw new \ManiaLivePlugins\Stan... | php | {
"resource": ""
} |
q264667 | Server.channelGroupPermAssign | test | public function channelGroupPermAssign($cgid, $permid, $permvalue)
{
$permident = (is_numeric($permid)) ? "permid" : "permsid";
$this->execute("channelgroupaddperm", array("cgid" => $cgid, $permident => $permid, "permvalue" => $permvalue));
} | php | {
"resource": ""
} |
q264668 | Server.permReset | test | public function permReset()
{
$token = $this->request("permreset")->toList();
\ManiaLivePlugins\Standard\TeamSpeak\TeamSpeak3\Helper\Signal::getInstance()->emit("notifyTokencreated", $this, $token["token"]);
return $token["token"];
} | php | {
"resource": ""
} |
q264669 | Server.iconUpload | test | public function iconUpload($data)
{
$crc = crc32($data);
$size = strlen($data);
$upload = $this->transferInitUpload(rand(0x0000, 0xFFFF), 0, "/icon_" . $crc, $size);
$transfer = \ManiaLivePlugins\Standard\TeamSpeak\TeamSpeak3\TeamSpeak3::factory("filetransfer://" . $upload["host"] . ":" . $uplo... | php | {
"resource": ""
} |
q264670 | Server.snapshotCreate | test | public function snapshotCreate($mode = \ManiaLivePlugins\Standard\TeamSpeak\TeamSpeak3\TeamSpeak3::SNAPSHOT_STRING)
{
$snapshot = $this->request("serversnapshotcreate")->toString(FALSE);
switch($mode)
{
case \ManiaLivePlugins\Standard\TeamSpeak\TeamSpeak3\TeamSpeak3::SNAPSHOT_BASE64:
... | php | {
"resource": ""
} |
q264671 | Server.logView | test | public function logView($limitcount = 30, $comparator = null, $timestamp = null)
{
return $this->execute("logview", array("limitcount" => $limitcount, "comparator" => $comparator, "timestamp" => $timestamp))->toArray();
} | php | {
"resource": ""
} |
q264672 | Server.logAdd | test | public function logAdd($logmsg, $loglevel = \ManiaLivePlugins\Standard\TeamSpeak\TeamSpeak3\TeamSpeak3::LOGLEVEL_INFO)
{
$this->execute("logadd", array("logmsg" => $logmsg, "loglevel" => $loglevel));
} | php | {
"resource": ""
} |
q264673 | Server.sortClientList | test | protected static function sortClientList(Client $a, Client $b)
{
if(get_class($a) != get_class($b))
{
return 0;
/* workaround for PHP bug #50688 */
throw new \ManiaLivePlugins\Standard\TeamSpeak\TeamSpeak3\Adapter\ServerQuery\Exception("invalid parameter", 0x602);
}
if(!$... | php | {
"resource": ""
} |
q264674 | Server.sortGroupList | test | protected static function sortGroupList(AbstractNode $a, AbstractNode $b)
{
if(get_class($a) != get_class($b))
{
return 0;
/* workaround for PHP bug #50688 */
throw new \ManiaLivePlugins\Standard\TeamSpeak\TeamSpeak3\Adapter\ServerQuery\Exception("invalid parameter", 0x602);
}
... | php | {
"resource": ""
} |
q264675 | Server.sortFileList | test | protected static function sortFileList(array $a, array $b)
{
if(!array_key_exists("src", $a) || !array_key_exists("src", $b))
{
return 0;
throw new \ManiaLivePlugins\Standard\TeamSpeak\TeamSpeak3\Adapter\ServerQuery\Exception("invalid parameter", 0x602);
}
return strcmp(strtolow... | php | {
"resource": ""
} |
q264676 | Servergroup.copy | test | public function copy($name = null, $tsgid = 0, $type = \ManiaLivePlugins\Standard\TeamSpeak\TeamSpeak3\TeamSpeak3::GROUP_DBTYPE_REGULAR)
{
return $this->getParent()->serverGroupCopy($this->getId(), $name, $tsgid, $type);
} | php | {
"resource": ""
} |
q264677 | AbstractNode.iconGetName | test | public function iconGetName($key)
{
$iconid = ($this[$key] < 0) ? (pow(2, 32))-($this[$key]*-1) : $this[$key];
return new \ManiaLivePlugins\Standard\TeamSpeak\TeamSpeak3\Helper\String("/icon_" . $iconid);
} | php | {
"resource": ""
} |
q264678 | AbstractNode.getClass | test | public function getClass($prefix = "ts3_")
{
if($this instanceof Channel && $this->isSpacer())
{
return $prefix . "spacer";
}
elseif($this instanceof Client && $this["client_type"])
{
return $prefix . "query";
}
return $prefix . \ManiaLivePlugins\Standard\TeamSpeak\... | php | {
"resource": ""
} |
q264679 | AbstractNode.getViewer | test | public function getViewer(ManiaLivePlugins\Standard\TeamSpeak\TeamSpeak3\Viewer\ViewerInterface $viewer)
{
$html = $viewer->fetchObject($this);
$iterator = new RecursiveIteratorIterator($this, RecursiveIteratorIterator::SELF_FIRST);
foreach($iterator as $node)
{
$siblings = array();
... | php | {
"resource": ""
} |
q264680 | AbstractNode.filterList | test | protected function filterList(array $nodes = array(), array $rules = array())
{
if(!empty($rules))
{
foreach($nodes as $node)
{
if(!$node instanceof AbstractNode) continue;
$props = $node->getInfo(FALSE);
$props = array_intersect_key($props, $rules);
$mat... | php | {
"resource": ""
} |
q264681 | HydratorFactory.writeFile | test | private function writeFile(string $filename, string $content)
{
$directory = \dirname($filename);
if (!\is_writable($directory)) {
throw new \RuntimeException(\sprintf('Cache directory "%s" is not writable.', $directory));
}
$tmpFile = \tempnam($directory, \basename($fil... | php | {
"resource": ""
} |
q264682 | HydratorFactory.getHydratorClass | test | public function getHydratorClass() : string
{
$originalClassName = $this->configuration->getHydratedClassName();
$realClassName = $this->generateClassName($originalClassName);
if (!class_exists($realClassName)) {
$directory = $directory = $this->configuration->getGeneratedClass... | php | {
"resource": ""
} |
q264683 | TCP.connect | test | public function connect()
{
if($this->stream !== null) return;
$host = strval($this->config["host"]);
$port = strval($this->config["port"]);
$address = "tcp://" . $host . ":" . $port;
$timeout = intval($this->config["timeout"]);
$this->stream = @stream_socket_client($address, $err... | php | {
"resource": ""
} |
q264684 | TCP.disconnect | test | public function disconnect()
{
if($this->stream === null) return;
fclose($this->stream);
$this->stream = null;
\ManiaLivePlugins\Standard\TeamSpeak\TeamSpeak3\Helper\Signal::getInstance()->emit(strtolower($this->getAdapterType()) . "Disconnected");
} | php | {
"resource": ""
} |
q264685 | TCP.readLine | test | public function readLine($token = "\n", $useCR = false)
{
$this->connect();
$line = \ManiaLivePlugins\Standard\TeamSpeak\TeamSpeak3\Helper\String::factory("");
while(!$line->endsWith($token) && !($useCR && $line->endsWith("\r"))) // FUUUUUUU carriage return
{
$this->waitForReadyRead();... | php | {
"resource": ""
} |
q264686 | CrudOptionsFallbackAbstractFactory.canCreate | test | public function canCreate(ContainerInterface $container, $requestedName)
{
$fqcn = $this->getFQCN($requestedName);
if ($fqcn === false) {
return false;
}
return \class_exists($fqcn);
} | php | {
"resource": ""
} |
q264687 | RoleController.store | test | public function store(CreateRoleRequest $request)
{
$input = $request->all();
$role = $this->roleRepository->create([
'name' => $input['name'],
]);
foreach ($input['permissions'] as $permission) {
$role->permissions()->attach($permission);
}
... | php | {
"resource": ""
} |
q264688 | RoleController.update | test | public function update($id, UpdateRoleRequest $request)
{
$role = $this->roleRepository->findWithoutFail($id);
if (empty($role)) {
\Flash::error(trans('l5starter::messages.404_not_found'));
return redirect(route('admin.roles.index'));
}
$input = $request->a... | php | {
"resource": ""
} |
q264689 | RoleController.destroy | test | public function destroy($id)
{
$role = $this->roleRepository->findWithoutFail($id);
if (empty($role)) {
\Flash::error(trans('l5starter::messages.404_not_found'));
return redirect(route('admin.roles.index'));
}
$this->roleRepository->delete($id);
\F... | php | {
"resource": ""
} |
q264690 | Client.get | test | public function get($resource, $headers = array())
{
return $this->getGuzzle()->request(
'GET',
$this->getUrl().$resource,
['headers' => array_merge($this->getHeaders(), $headers)]
);
} | php | {
"resource": ""
} |
q264691 | Html.getCorpusClass | test | protected function getCorpusClass()
{
$extras = "";
if($this->currObj instanceof \ManiaLivePlugins\Standard\TeamSpeak\TeamSpeak3\Node\Channel && $this->currObj->isSpacer())
{
switch($this->currObj->spacerGetType())
{
case (string) \ManiaLivePlugins\Standard\TeamSpeak\TeamSpeak... | php | {
"resource": ""
} |
q264692 | Html.getCorpusIcon | test | protected function getCorpusIcon()
{
if($this->currObj instanceof \ManiaLivePlugins\Standard\TeamSpeak\TeamSpeak3\Node\Channel && $this->currObj->isSpacer()) return;
return $this->getImage($this->currObj->getIcon() . ".png");
} | php | {
"resource": ""
} |
q264693 | Html.getCorpusName | test | protected function getCorpusName()
{
if($this->currObj instanceof \ManiaLivePlugins\Standard\TeamSpeak\TeamSpeak3\Node\Channel && $this->currObj->isSpacer())
{
if($this->currObj->spacerGetType() != \ManiaLivePlugins\Standard\TeamSpeak\TeamSpeak3\TeamSpeak3::SPACER_CUSTOM) return;
$string = ... | php | {
"resource": ""
} |
q264694 | Html.getSuffixFlag | test | protected function getSuffixFlag()
{
if(!$this->currObj instanceof \ManiaLivePlugins\Standard\TeamSpeak\TeamSpeak3\Node\Client) return;
if($this->flagpath && $this->currObj["client_country"])
{
return $this->getImage($this->currObj["client_country"]->toLower() . ".png", $this->currObj["client... | php | {
"resource": ""
} |
q264695 | FileTransfer.init | test | protected function init($ftkey)
{
if(strlen($ftkey) != 32)
{
throw new FileTransfer\Exception("invalid file transfer key format");
}
$this->getProfiler()->start();
$this->getTransport()->send($ftkey);
\ManiaLivePlugins\Standard\TeamSpeak\TeamSpeak3\Helper\Signal::getInstance(... | php | {
"resource": ""
} |
q264696 | FileTransfer.upload | test | public function upload($ftkey, $seek, $data)
{
$this->init($ftkey);
$size = strlen($data);
$seek = intval($seek);
$pack = 4096;
\ManiaLivePlugins\Standard\TeamSpeak\TeamSpeak3\Helper\Signal::getInstance()->emit("filetransferUploadStarted", $ftkey, $seek, $size);
for(;$seek < $size... | php | {
"resource": ""
} |
q264697 | FileTransfer.download | test | public function download($ftkey, $size, $passthru = FALSE)
{
$this->init($ftkey);
if($passthru)
{
return $this->passthru($size);
}
$buff = new \ManiaLivePlugins\Standard\TeamSpeak\TeamSpeak3\Helper\String("");
$size = intval($size);
$pack = 4096;
\ManiaLivePlugins... | php | {
"resource": ""
} |
q264698 | Application.getSessionContext | test | public function getSessionContext()
{
if (!$this->_sessionContext) {
$this->_sessionContext = new SessionContext();
$this->_sessionContext->retrieveSessionObjects();
}
return $this->_sessionContext;
} | php | {
"resource": ""
} |
q264699 | Application.getTypeManager | test | public function getTypeManager()
{
if (!$this->_typeManager) {
$this->_typeManager = new TypeManager();
/* @var $localeInfoService localeInfoService */
$localeInfoService = Openbizx::getService(LOCALEINFO_SERVICE);
$localeInfo = $localeInfoService->getLocaleI... | php | {
"resource": ""
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.