repository_name stringlengths 5 67 | func_path_in_repository stringlengths 4 234 | func_name stringlengths 0 314 | whole_func_string stringlengths 52 3.87M | language stringclasses 6
values | func_code_string stringlengths 52 3.87M | func_code_tokens listlengths 15 672k | func_documentation_string stringlengths 1 47.2k | func_documentation_tokens listlengths 1 3.92k | split_name stringclasses 1
value | func_code_url stringlengths 85 339 |
|---|---|---|---|---|---|---|---|---|---|---|
planetteamspeak/ts3phpframework | libraries/TeamSpeak3/Helper/Char.php | TeamSpeak3_Helper_Char.fromHex | public static function fromHex($hex)
{
if(strlen($hex) != 2)
{
throw new TeamSpeak3_Helper_Exception("given parameter '" . $hex . "' is not a valid hexadecimal number");
}
return new self(chr(hexdec($hex)));
} | php | public static function fromHex($hex)
{
if(strlen($hex) != 2)
{
throw new TeamSpeak3_Helper_Exception("given parameter '" . $hex . "' is not a valid hexadecimal number");
}
return new self(chr(hexdec($hex)));
} | [
"public",
"static",
"function",
"fromHex",
"(",
"$",
"hex",
")",
"{",
"if",
"(",
"strlen",
"(",
"$",
"hex",
")",
"!=",
"2",
")",
"{",
"throw",
"new",
"TeamSpeak3_Helper_Exception",
"(",
"\"given parameter '\"",
".",
"$",
"hex",
".",
"\"' is not a valid hexad... | Returns the TeamSpeak3_Helper_Char based on a given hex value.
@param string $hex
@throws TeamSpeak3_Helper_Exception
@return TeamSpeak3_Helper_Char | [
"Returns",
"the",
"TeamSpeak3_Helper_Char",
"based",
"on",
"a",
"given",
"hex",
"value",
"."
] | train | https://github.com/planetteamspeak/ts3phpframework/blob/82ed6edc261547099c916a59f624caf5daa68035/libraries/TeamSpeak3/Helper/Char.php#L227-L235 |
planetteamspeak/ts3phpframework | libraries/TeamSpeak3/Transport/TCP.php | TeamSpeak3_Transport_TCP.connect | public function connect()
{
if($this->stream !== null) return;
$host = strval($this->config["host"]);
$port = strval($this->config["port"]);
$timeout = intval($this->config["timeout"]);
$blocking = intval($this->config["blocking"]);
if(empty($this->config["ssh"]))
{
$address = "tcp://" . (strstr($host, ":") !== FALSE ? "[" . $host . "]" : $host) . ":" . $port;
$options = empty($this->config["tls"]) ? array() : array("ssl" => array("allow_self_signed" => TRUE, "verify_peer" => FALSE, "verify_peer_name" => FALSE));
$this->stream = @stream_socket_client($address, $errno, $errstr, $this->config["timeout"], STREAM_CLIENT_CONNECT, stream_context_create($options));
if($this->stream === FALSE)
{
throw new TeamSpeak3_Transport_Exception(TeamSpeak3_Helper_String::factory($errstr)->toUtf8()->toString(), $errno);
}
if(!empty($this->config["tls"]))
{
stream_socket_enable_crypto($this->stream, TRUE, STREAM_CRYPTO_METHOD_SSLv23_CLIENT);
}
}
else
{
$this->session = @ssh2_connect($host, $port);
if($this->session === FALSE)
{
throw new TeamSpeak3_Transport_Exception("failed to establish secure shell connection to server '" . $this->config["host"] . ":" . $this->config["port"] . "'");
}
if(!@ssh2_auth_password($this->session, $this->config["username"], $this->config["password"]))
{
throw new TeamSpeak3_Adapter_ServerQuery_Exception("invalid loginname or password", 0x208);
}
$this->stream = @ssh2_shell($this->session, "raw");
if($this->stream === FALSE)
{
throw new TeamSpeak3_Transport_Exception("failed to open a secure shell on server '" . $this->config["host"] . ":" . $this->config["port"] . "'");
}
}
@stream_set_timeout($this->stream, $timeout);
@stream_set_blocking($this->stream, $blocking ? 1 : 0);
} | php | public function connect()
{
if($this->stream !== null) return;
$host = strval($this->config["host"]);
$port = strval($this->config["port"]);
$timeout = intval($this->config["timeout"]);
$blocking = intval($this->config["blocking"]);
if(empty($this->config["ssh"]))
{
$address = "tcp://" . (strstr($host, ":") !== FALSE ? "[" . $host . "]" : $host) . ":" . $port;
$options = empty($this->config["tls"]) ? array() : array("ssl" => array("allow_self_signed" => TRUE, "verify_peer" => FALSE, "verify_peer_name" => FALSE));
$this->stream = @stream_socket_client($address, $errno, $errstr, $this->config["timeout"], STREAM_CLIENT_CONNECT, stream_context_create($options));
if($this->stream === FALSE)
{
throw new TeamSpeak3_Transport_Exception(TeamSpeak3_Helper_String::factory($errstr)->toUtf8()->toString(), $errno);
}
if(!empty($this->config["tls"]))
{
stream_socket_enable_crypto($this->stream, TRUE, STREAM_CRYPTO_METHOD_SSLv23_CLIENT);
}
}
else
{
$this->session = @ssh2_connect($host, $port);
if($this->session === FALSE)
{
throw new TeamSpeak3_Transport_Exception("failed to establish secure shell connection to server '" . $this->config["host"] . ":" . $this->config["port"] . "'");
}
if(!@ssh2_auth_password($this->session, $this->config["username"], $this->config["password"]))
{
throw new TeamSpeak3_Adapter_ServerQuery_Exception("invalid loginname or password", 0x208);
}
$this->stream = @ssh2_shell($this->session, "raw");
if($this->stream === FALSE)
{
throw new TeamSpeak3_Transport_Exception("failed to open a secure shell on server '" . $this->config["host"] . ":" . $this->config["port"] . "'");
}
}
@stream_set_timeout($this->stream, $timeout);
@stream_set_blocking($this->stream, $blocking ? 1 : 0);
} | [
"public",
"function",
"connect",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"stream",
"!==",
"null",
")",
"return",
";",
"$",
"host",
"=",
"strval",
"(",
"$",
"this",
"->",
"config",
"[",
"\"host\"",
"]",
")",
";",
"$",
"port",
"=",
"strval",
"... | Connects to a remote server.
@throws TeamSpeak3_Transport_Exception
@return void | [
"Connects",
"to",
"a",
"remote",
"server",
"."
] | train | https://github.com/planetteamspeak/ts3phpframework/blob/82ed6edc261547099c916a59f624caf5daa68035/libraries/TeamSpeak3/Transport/TCP.php#L37-L87 |
planetteamspeak/ts3phpframework | libraries/TeamSpeak3/Transport/TCP.php | TeamSpeak3_Transport_TCP.disconnect | public function disconnect()
{
if($this->stream === null) return;
$this->stream = null;
if(is_resource($this->session))
{
@ssh2_disconnect($this->session);
}
TeamSpeak3_Helper_Signal::getInstance()->emit(strtolower($this->getAdapterType()) . "Disconnected");
} | php | public function disconnect()
{
if($this->stream === null) return;
$this->stream = null;
if(is_resource($this->session))
{
@ssh2_disconnect($this->session);
}
TeamSpeak3_Helper_Signal::getInstance()->emit(strtolower($this->getAdapterType()) . "Disconnected");
} | [
"public",
"function",
"disconnect",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"stream",
"===",
"null",
")",
"return",
";",
"$",
"this",
"->",
"stream",
"=",
"null",
";",
"if",
"(",
"is_resource",
"(",
"$",
"this",
"->",
"session",
")",
")",
"{",... | Disconnects from a remote server.
@return void | [
"Disconnects",
"from",
"a",
"remote",
"server",
"."
] | train | https://github.com/planetteamspeak/ts3phpframework/blob/82ed6edc261547099c916a59f624caf5daa68035/libraries/TeamSpeak3/Transport/TCP.php#L94-L106 |
planetteamspeak/ts3phpframework | libraries/TeamSpeak3/Transport/TCP.php | TeamSpeak3_Transport_TCP.readLine | public function readLine($token = "\n")
{
$this->connect();
$line = TeamSpeak3_Helper_String::factory("");
while(!$line->endsWith($token))
{
$this->waitForReadyRead();
$data = @fgets($this->stream, 4096);
TeamSpeak3_Helper_Signal::getInstance()->emit(strtolower($this->getAdapterType()) . "DataRead", $data);
if($data === FALSE)
{
if($line->count())
{
$line->append($token);
}
else
{
throw new TeamSpeak3_Transport_Exception("connection to server '" . $this->config["host"] . ":" . $this->config["port"] . "' lost");
}
}
else
{
$line->append($data);
}
}
return $line->trim();
} | php | public function readLine($token = "\n")
{
$this->connect();
$line = TeamSpeak3_Helper_String::factory("");
while(!$line->endsWith($token))
{
$this->waitForReadyRead();
$data = @fgets($this->stream, 4096);
TeamSpeak3_Helper_Signal::getInstance()->emit(strtolower($this->getAdapterType()) . "DataRead", $data);
if($data === FALSE)
{
if($line->count())
{
$line->append($token);
}
else
{
throw new TeamSpeak3_Transport_Exception("connection to server '" . $this->config["host"] . ":" . $this->config["port"] . "' lost");
}
}
else
{
$line->append($data);
}
}
return $line->trim();
} | [
"public",
"function",
"readLine",
"(",
"$",
"token",
"=",
"\"\\n\"",
")",
"{",
"$",
"this",
"->",
"connect",
"(",
")",
";",
"$",
"line",
"=",
"TeamSpeak3_Helper_String",
"::",
"factory",
"(",
"\"\"",
")",
";",
"while",
"(",
"!",
"$",
"line",
"->",
"e... | Reads a single line of data from the stream.
@param string $token
@throws TeamSpeak3_Transport_Exception
@return TeamSpeak3_Helper_String | [
"Reads",
"a",
"single",
"line",
"of",
"data",
"from",
"the",
"stream",
"."
] | train | https://github.com/planetteamspeak/ts3phpframework/blob/82ed6edc261547099c916a59f624caf5daa68035/libraries/TeamSpeak3/Transport/TCP.php#L139-L171 |
planetteamspeak/ts3phpframework | libraries/TeamSpeak3/Transport/TCP.php | TeamSpeak3_Transport_TCP.send | public function send($data)
{
$this->connect();
@fwrite($this->stream, $data);
TeamSpeak3_Helper_Signal::getInstance()->emit(strtolower($this->getAdapterType()) . "DataSend", $data);
} | php | public function send($data)
{
$this->connect();
@fwrite($this->stream, $data);
TeamSpeak3_Helper_Signal::getInstance()->emit(strtolower($this->getAdapterType()) . "DataSend", $data);
} | [
"public",
"function",
"send",
"(",
"$",
"data",
")",
"{",
"$",
"this",
"->",
"connect",
"(",
")",
";",
"@",
"fwrite",
"(",
"$",
"this",
"->",
"stream",
",",
"$",
"data",
")",
";",
"TeamSpeak3_Helper_Signal",
"::",
"getInstance",
"(",
")",
"->",
"emit... | Writes data to the stream.
@param string $data
@return void | [
"Writes",
"data",
"to",
"the",
"stream",
"."
] | train | https://github.com/planetteamspeak/ts3phpframework/blob/82ed6edc261547099c916a59f624caf5daa68035/libraries/TeamSpeak3/Transport/TCP.php#L179-L186 |
planetteamspeak/ts3phpframework | libraries/TeamSpeak3/Transport/TCP.php | TeamSpeak3_Transport_TCP.sendLine | public function sendLine($data, $separator = "\n")
{
$size = strlen($data);
$pack = 4096;
for($seek = 0 ;$seek < $size;)
{
$rest = $size-$seek;
$pack = $rest < $pack ? $rest : $pack;
$buff = substr($data, $seek, $pack);
$seek = $seek+$pack;
if($seek >= $size) $buff .= $separator;
$this->send($buff);
}
} | php | public function sendLine($data, $separator = "\n")
{
$size = strlen($data);
$pack = 4096;
for($seek = 0 ;$seek < $size;)
{
$rest = $size-$seek;
$pack = $rest < $pack ? $rest : $pack;
$buff = substr($data, $seek, $pack);
$seek = $seek+$pack;
if($seek >= $size) $buff .= $separator;
$this->send($buff);
}
} | [
"public",
"function",
"sendLine",
"(",
"$",
"data",
",",
"$",
"separator",
"=",
"\"\\n\"",
")",
"{",
"$",
"size",
"=",
"strlen",
"(",
"$",
"data",
")",
";",
"$",
"pack",
"=",
"4096",
";",
"for",
"(",
"$",
"seek",
"=",
"0",
";",
"$",
"seek",
"<"... | Writes a line of data to the stream.
@param string $data
@param string $separator
@return void | [
"Writes",
"a",
"line",
"of",
"data",
"to",
"the",
"stream",
"."
] | train | https://github.com/planetteamspeak/ts3phpframework/blob/82ed6edc261547099c916a59f624caf5daa68035/libraries/TeamSpeak3/Transport/TCP.php#L195-L211 |
planetteamspeak/ts3phpframework | libraries/TeamSpeak3/Helper/Profiler/Timer.php | TeamSpeak3_Helper_Profiler_Timer.stop | public function stop()
{
if(!$this->isRunning()) return;
$this->data["runtime"] += microtime(TRUE) - $this->started;
$this->data["realmem"] += memory_get_usage(TRUE) - $this->data["realmem_start"];
$this->data["emalloc"] += memory_get_usage() - $this->data["emalloc_start"];
$this->started = 0;
$this->running = FALSE;
} | php | public function stop()
{
if(!$this->isRunning()) return;
$this->data["runtime"] += microtime(TRUE) - $this->started;
$this->data["realmem"] += memory_get_usage(TRUE) - $this->data["realmem_start"];
$this->data["emalloc"] += memory_get_usage() - $this->data["emalloc_start"];
$this->started = 0;
$this->running = FALSE;
} | [
"public",
"function",
"stop",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"isRunning",
"(",
")",
")",
"return",
";",
"$",
"this",
"->",
"data",
"[",
"\"runtime\"",
"]",
"+=",
"microtime",
"(",
"TRUE",
")",
"-",
"$",
"this",
"->",
"started",
... | Stops the timer.
@return void | [
"Stops",
"the",
"timer",
"."
] | train | https://github.com/planetteamspeak/ts3phpframework/blob/82ed6edc261547099c916a59f624caf5daa68035/libraries/TeamSpeak3/Helper/Profiler/Timer.php#L97-L107 |
planetteamspeak/ts3phpframework | libraries/TeamSpeak3/Helper/Profiler/Timer.php | TeamSpeak3_Helper_Profiler_Timer.getMemUsage | public function getMemUsage($realmem = FALSE)
{
if($this->isRunning())
{
$this->stop();
$this->start();
}
return ($realmem !== FALSE) ? $this->data["realmem"] : $this->data["emalloc"];
} | php | public function getMemUsage($realmem = FALSE)
{
if($this->isRunning())
{
$this->stop();
$this->start();
}
return ($realmem !== FALSE) ? $this->data["realmem"] : $this->data["emalloc"];
} | [
"public",
"function",
"getMemUsage",
"(",
"$",
"realmem",
"=",
"FALSE",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"isRunning",
"(",
")",
")",
"{",
"$",
"this",
"->",
"stop",
"(",
")",
";",
"$",
"this",
"->",
"start",
"(",
")",
";",
"}",
"return",
... | Returns the amount of memory allocated to PHP in bytes.
@param boolean $realmem
@return integer | [
"Returns",
"the",
"amount",
"of",
"memory",
"allocated",
"to",
"PHP",
"in",
"bytes",
"."
] | train | https://github.com/planetteamspeak/ts3phpframework/blob/82ed6edc261547099c916a59f624caf5daa68035/libraries/TeamSpeak3/Helper/Profiler/Timer.php#L131-L140 |
planetteamspeak/ts3phpframework | libraries/TeamSpeak3/Adapter/FileTransfer.php | TeamSpeak3_Adapter_FileTransfer.syn | public function syn()
{
$this->initTransport($this->options);
$this->transport->setAdapter($this);
TeamSpeak3_Helper_Profiler::init(spl_object_hash($this));
TeamSpeak3_Helper_Signal::getInstance()->emit("filetransferConnected", $this);
} | php | public function syn()
{
$this->initTransport($this->options);
$this->transport->setAdapter($this);
TeamSpeak3_Helper_Profiler::init(spl_object_hash($this));
TeamSpeak3_Helper_Signal::getInstance()->emit("filetransferConnected", $this);
} | [
"public",
"function",
"syn",
"(",
")",
"{",
"$",
"this",
"->",
"initTransport",
"(",
"$",
"this",
"->",
"options",
")",
";",
"$",
"this",
"->",
"transport",
"->",
"setAdapter",
"(",
"$",
"this",
")",
";",
"TeamSpeak3_Helper_Profiler",
"::",
"init",
"(",
... | Connects the TeamSpeak3_Transport_Abstract object and performs initial actions on the remote
server.
@throws TeamSpeak3_Adapter_Exception
@return void | [
"Connects",
"the",
"TeamSpeak3_Transport_Abstract",
"object",
"and",
"performs",
"initial",
"actions",
"on",
"the",
"remote",
"server",
"."
] | train | https://github.com/planetteamspeak/ts3phpframework/blob/82ed6edc261547099c916a59f624caf5daa68035/libraries/TeamSpeak3/Adapter/FileTransfer.php#L38-L46 |
planetteamspeak/ts3phpframework | libraries/TeamSpeak3/Adapter/FileTransfer.php | TeamSpeak3_Adapter_FileTransfer.init | protected function init($ftkey)
{
if(strlen($ftkey) != 32 && strlen($ftkey) != 16)
{
throw new TeamSpeak3_Adapter_FileTransfer_Exception("invalid file transfer key format");
}
$this->getProfiler()->start();
$this->getTransport()->send($ftkey);
TeamSpeak3_Helper_Signal::getInstance()->emit("filetransferHandshake", $this);
} | php | protected function init($ftkey)
{
if(strlen($ftkey) != 32 && strlen($ftkey) != 16)
{
throw new TeamSpeak3_Adapter_FileTransfer_Exception("invalid file transfer key format");
}
$this->getProfiler()->start();
$this->getTransport()->send($ftkey);
TeamSpeak3_Helper_Signal::getInstance()->emit("filetransferHandshake", $this);
} | [
"protected",
"function",
"init",
"(",
"$",
"ftkey",
")",
"{",
"if",
"(",
"strlen",
"(",
"$",
"ftkey",
")",
"!=",
"32",
"&&",
"strlen",
"(",
"$",
"ftkey",
")",
"!=",
"16",
")",
"{",
"throw",
"new",
"TeamSpeak3_Adapter_FileTransfer_Exception",
"(",
"\"inva... | Sends a valid file transfer key to the server to initialize the file transfer.
@param string $ftkey
@throws TeamSpeak3_Adapter_FileTransfer_Exception
@return void | [
"Sends",
"a",
"valid",
"file",
"transfer",
"key",
"to",
"the",
"server",
"to",
"initialize",
"the",
"file",
"transfer",
"."
] | train | https://github.com/planetteamspeak/ts3phpframework/blob/82ed6edc261547099c916a59f624caf5daa68035/libraries/TeamSpeak3/Adapter/FileTransfer.php#L68-L79 |
planetteamspeak/ts3phpframework | libraries/TeamSpeak3/Adapter/FileTransfer.php | TeamSpeak3_Adapter_FileTransfer.upload | public function upload($ftkey, $seek, $data)
{
$this->init($ftkey);
$size = strlen($data);
$seek = intval($seek);
$pack = 4096;
TeamSpeak3_Helper_Signal::getInstance()->emit("filetransferUploadStarted", $ftkey, $seek, $size);
for(;$seek < $size;)
{
$rest = $size-$seek;
$pack = $rest < $pack ? $rest : $pack;
$buff = substr($data, $seek, $pack);
$seek = $seek+$pack;
$this->getTransport()->send($buff);
TeamSpeak3_Helper_Signal::getInstance()->emit("filetransferUploadProgress", $ftkey, $seek, $size);
}
$this->getProfiler()->stop();
TeamSpeak3_Helper_Signal::getInstance()->emit("filetransferUploadFinished", $ftkey, $seek, $size);
if($seek < $size)
{
throw new TeamSpeak3_Adapter_FileTransfer_Exception("incomplete file upload (" . $seek . " of " . $size . " bytes)");
}
} | php | public function upload($ftkey, $seek, $data)
{
$this->init($ftkey);
$size = strlen($data);
$seek = intval($seek);
$pack = 4096;
TeamSpeak3_Helper_Signal::getInstance()->emit("filetransferUploadStarted", $ftkey, $seek, $size);
for(;$seek < $size;)
{
$rest = $size-$seek;
$pack = $rest < $pack ? $rest : $pack;
$buff = substr($data, $seek, $pack);
$seek = $seek+$pack;
$this->getTransport()->send($buff);
TeamSpeak3_Helper_Signal::getInstance()->emit("filetransferUploadProgress", $ftkey, $seek, $size);
}
$this->getProfiler()->stop();
TeamSpeak3_Helper_Signal::getInstance()->emit("filetransferUploadFinished", $ftkey, $seek, $size);
if($seek < $size)
{
throw new TeamSpeak3_Adapter_FileTransfer_Exception("incomplete file upload (" . $seek . " of " . $size . " bytes)");
}
} | [
"public",
"function",
"upload",
"(",
"$",
"ftkey",
",",
"$",
"seek",
",",
"$",
"data",
")",
"{",
"$",
"this",
"->",
"init",
"(",
"$",
"ftkey",
")",
";",
"$",
"size",
"=",
"strlen",
"(",
"$",
"data",
")",
";",
"$",
"seek",
"=",
"intval",
"(",
... | Sends the content of a file to the server.
@param string $ftkey
@param integer $seek
@param string $data
@throws TeamSpeak3_Adapter_FileTransfer_Exception
@return void | [
"Sends",
"the",
"content",
"of",
"a",
"file",
"to",
"the",
"server",
"."
] | train | https://github.com/planetteamspeak/ts3phpframework/blob/82ed6edc261547099c916a59f624caf5daa68035/libraries/TeamSpeak3/Adapter/FileTransfer.php#L90-L120 |
planetteamspeak/ts3phpframework | libraries/TeamSpeak3/Adapter/FileTransfer.php | TeamSpeak3_Adapter_FileTransfer.download | public function download($ftkey, $size, $passthru = FALSE)
{
$this->init($ftkey);
if($passthru)
{
return $this->passthru($size);
}
$buff = new TeamSpeak3_Helper_String("");
$size = intval($size);
$pack = 4096;
TeamSpeak3_Helper_Signal::getInstance()->emit("filetransferDownloadStarted", $ftkey, count($buff), $size);
for($seek = 0;$seek < $size;)
{
$rest = $size-$seek;
$pack = $rest < $pack ? $rest : $pack;
$data = $this->getTransport()->read($rest < $pack ? $rest : $pack);
$seek = $seek+$pack;
$buff->append($data);
TeamSpeak3_Helper_Signal::getInstance()->emit("filetransferDownloadProgress", $ftkey, count($buff), $size);
}
$this->getProfiler()->stop();
TeamSpeak3_Helper_Signal::getInstance()->emit("filetransferDownloadFinished", $ftkey, count($buff), $size);
if(strlen($buff) != $size)
{
throw new TeamSpeak3_Adapter_FileTransfer_Exception("incomplete file download (" . count($buff) . " of " . $size . " bytes)");
}
return $buff;
} | php | public function download($ftkey, $size, $passthru = FALSE)
{
$this->init($ftkey);
if($passthru)
{
return $this->passthru($size);
}
$buff = new TeamSpeak3_Helper_String("");
$size = intval($size);
$pack = 4096;
TeamSpeak3_Helper_Signal::getInstance()->emit("filetransferDownloadStarted", $ftkey, count($buff), $size);
for($seek = 0;$seek < $size;)
{
$rest = $size-$seek;
$pack = $rest < $pack ? $rest : $pack;
$data = $this->getTransport()->read($rest < $pack ? $rest : $pack);
$seek = $seek+$pack;
$buff->append($data);
TeamSpeak3_Helper_Signal::getInstance()->emit("filetransferDownloadProgress", $ftkey, count($buff), $size);
}
$this->getProfiler()->stop();
TeamSpeak3_Helper_Signal::getInstance()->emit("filetransferDownloadFinished", $ftkey, count($buff), $size);
if(strlen($buff) != $size)
{
throw new TeamSpeak3_Adapter_FileTransfer_Exception("incomplete file download (" . count($buff) . " of " . $size . " bytes)");
}
return $buff;
} | [
"public",
"function",
"download",
"(",
"$",
"ftkey",
",",
"$",
"size",
",",
"$",
"passthru",
"=",
"FALSE",
")",
"{",
"$",
"this",
"->",
"init",
"(",
"$",
"ftkey",
")",
";",
"if",
"(",
"$",
"passthru",
")",
"{",
"return",
"$",
"this",
"->",
"passt... | Returns the content of a downloaded file as a TeamSpeak3_Helper_String object.
@param string $ftkey
@param integer $size
@param boolean $passthru
@throws TeamSpeak3_Adapter_FileTransfer_Exception
@return TeamSpeak3_Helper_String | [
"Returns",
"the",
"content",
"of",
"a",
"downloaded",
"file",
"as",
"a",
"TeamSpeak3_Helper_String",
"object",
"."
] | train | https://github.com/planetteamspeak/ts3phpframework/blob/82ed6edc261547099c916a59f624caf5daa68035/libraries/TeamSpeak3/Adapter/FileTransfer.php#L131-L168 |
planetteamspeak/ts3phpframework | libraries/TeamSpeak3/Adapter/FileTransfer.php | TeamSpeak3_Adapter_FileTransfer.passthru | protected function passthru($size)
{
$buff_size = fpassthru($this->getTransport()->getStream());
if($buff_size != $size)
{
throw new TeamSpeak3_Adapter_FileTransfer_Exception("incomplete file download (" . intval($buff_size) . " of " . $size . " bytes)");
}
} | php | protected function passthru($size)
{
$buff_size = fpassthru($this->getTransport()->getStream());
if($buff_size != $size)
{
throw new TeamSpeak3_Adapter_FileTransfer_Exception("incomplete file download (" . intval($buff_size) . " of " . $size . " bytes)");
}
} | [
"protected",
"function",
"passthru",
"(",
"$",
"size",
")",
"{",
"$",
"buff_size",
"=",
"fpassthru",
"(",
"$",
"this",
"->",
"getTransport",
"(",
")",
"->",
"getStream",
"(",
")",
")",
";",
"if",
"(",
"$",
"buff_size",
"!=",
"$",
"size",
")",
"{",
... | Outputs all remaining data on a TeamSpeak 3 file transfer stream using PHP's fpassthru()
function.
@param integer $size
@throws TeamSpeak3_Adapter_FileTransfer_Exception
@return void | [
"Outputs",
"all",
"remaining",
"data",
"on",
"a",
"TeamSpeak",
"3",
"file",
"transfer",
"stream",
"using",
"PHP",
"s",
"fpassthru",
"()",
"function",
"."
] | train | https://github.com/planetteamspeak/ts3phpframework/blob/82ed6edc261547099c916a59f624caf5daa68035/libraries/TeamSpeak3/Adapter/FileTransfer.php#L178-L186 |
planetteamspeak/ts3phpframework | libraries/TeamSpeak3/Adapter/Abstract.php | TeamSpeak3_Adapter_Abstract.initTransport | protected function initTransport($options, $transport = "TeamSpeak3_Transport_TCP")
{
if(!is_array($options))
{
throw new TeamSpeak3_Adapter_Exception("transport parameters must provided in an array");
}
$this->transport = new $transport($options);
} | php | protected function initTransport($options, $transport = "TeamSpeak3_Transport_TCP")
{
if(!is_array($options))
{
throw new TeamSpeak3_Adapter_Exception("transport parameters must provided in an array");
}
$this->transport = new $transport($options);
} | [
"protected",
"function",
"initTransport",
"(",
"$",
"options",
",",
"$",
"transport",
"=",
"\"TeamSpeak3_Transport_TCP\"",
")",
"{",
"if",
"(",
"!",
"is_array",
"(",
"$",
"options",
")",
")",
"{",
"throw",
"new",
"TeamSpeak3_Adapter_Exception",
"(",
"\"transport... | Loads the transport object object used for the connection adapter and passes a given set
of options.
@param array $options
@param string $transport
@throws TeamSpeak3_Adapter_Exception
@return void | [
"Loads",
"the",
"transport",
"object",
"object",
"used",
"for",
"the",
"connection",
"adapter",
"and",
"passes",
"a",
"given",
"set",
"of",
"options",
"."
] | train | https://github.com/planetteamspeak/ts3phpframework/blob/82ed6edc261547099c916a59f624caf5daa68035/libraries/TeamSpeak3/Adapter/Abstract.php#L126-L134 |
planetteamspeak/ts3phpframework | libraries/TeamSpeak3/Viewer/Json.php | TeamSpeak3_Viewer_Json.fetchObject | public function fetchObject(TeamSpeak3_Node_Abstract $node, array $siblings = array())
{
$this->currObj = $node;
$this->currSib = $siblings;
$obj = new stdClass();
$obj->ident = $this->getId();
$obj->parent = $this->getParent();
$obj->children = $node->count();
$obj->level = $this->getLevel();
$obj->first = (bool) ($obj->level != $this->lastLvl);
$obj->last = (bool) array_pop($siblings);
$obj->siblings = array_map("boolval", $siblings);
$obj->class = $this->getType();
$obj->name = $this->getName();
$obj->image = $this->getImage();
$obj->props = $this->getProps();
$this->data[] = $obj;
$this->lastLvl = $obj->level;
} | php | public function fetchObject(TeamSpeak3_Node_Abstract $node, array $siblings = array())
{
$this->currObj = $node;
$this->currSib = $siblings;
$obj = new stdClass();
$obj->ident = $this->getId();
$obj->parent = $this->getParent();
$obj->children = $node->count();
$obj->level = $this->getLevel();
$obj->first = (bool) ($obj->level != $this->lastLvl);
$obj->last = (bool) array_pop($siblings);
$obj->siblings = array_map("boolval", $siblings);
$obj->class = $this->getType();
$obj->name = $this->getName();
$obj->image = $this->getImage();
$obj->props = $this->getProps();
$this->data[] = $obj;
$this->lastLvl = $obj->level;
} | [
"public",
"function",
"fetchObject",
"(",
"TeamSpeak3_Node_Abstract",
"$",
"node",
",",
"array",
"$",
"siblings",
"=",
"array",
"(",
")",
")",
"{",
"$",
"this",
"->",
"currObj",
"=",
"$",
"node",
";",
"$",
"this",
"->",
"currSib",
"=",
"$",
"siblings",
... | Assembles an stdClass object for the current element.
@param TeamSpeak3_Node_Abstract $node
@param array $siblings
@return void | [
"Assembles",
"an",
"stdClass",
"object",
"for",
"the",
"current",
"element",
"."
] | train | https://github.com/planetteamspeak/ts3phpframework/blob/82ed6edc261547099c916a59f624caf5daa68035/libraries/TeamSpeak3/Viewer/Json.php#L79-L100 |
planetteamspeak/ts3phpframework | libraries/TeamSpeak3/Viewer/Json.php | TeamSpeak3_Viewer_Json.getId | protected function getId()
{
if($this->currObj instanceof TeamSpeak3_Node_Server)
{
return "ts3_s" . $this->currObj->virtualserver_id;
}
elseif($this->currObj instanceof TeamSpeak3_Node_Channel)
{
return "ts3_c" . $this->currObj->cid;
}
elseif($this->currObj instanceof TeamSpeak3_Node_Client)
{
return "ts3_u" . $this->currObj->clid;
}
return FALSE;
} | php | protected function getId()
{
if($this->currObj instanceof TeamSpeak3_Node_Server)
{
return "ts3_s" . $this->currObj->virtualserver_id;
}
elseif($this->currObj instanceof TeamSpeak3_Node_Channel)
{
return "ts3_c" . $this->currObj->cid;
}
elseif($this->currObj instanceof TeamSpeak3_Node_Client)
{
return "ts3_u" . $this->currObj->clid;
}
return FALSE;
} | [
"protected",
"function",
"getId",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"currObj",
"instanceof",
"TeamSpeak3_Node_Server",
")",
"{",
"return",
"\"ts3_s\"",
".",
"$",
"this",
"->",
"currObj",
"->",
"virtualserver_id",
";",
"}",
"elseif",
"(",
"$",
"t... | Returns the ID of the current element.
@return mixed | [
"Returns",
"the",
"ID",
"of",
"the",
"current",
"element",
"."
] | train | https://github.com/planetteamspeak/ts3phpframework/blob/82ed6edc261547099c916a59f624caf5daa68035/libraries/TeamSpeak3/Viewer/Json.php#L107-L123 |
planetteamspeak/ts3phpframework | libraries/TeamSpeak3/Viewer/Json.php | TeamSpeak3_Viewer_Json.getParent | protected function getParent()
{
if($this->currObj instanceof TeamSpeak3_Node_Channel)
{
return $this->currObj->pid ? "ts3_c" . $this->currObj->pid : "ts3_s" . $this->currObj->getParent()->getId();
}
elseif($this->currObj instanceof TeamSpeak3_Node_Client)
{
return $this->currObj->cid ? "ts3_c" . $this->currObj->cid : "ts3_s" . $this->currObj->getParent()->getId();
}
return "ts3";
} | php | protected function getParent()
{
if($this->currObj instanceof TeamSpeak3_Node_Channel)
{
return $this->currObj->pid ? "ts3_c" . $this->currObj->pid : "ts3_s" . $this->currObj->getParent()->getId();
}
elseif($this->currObj instanceof TeamSpeak3_Node_Client)
{
return $this->currObj->cid ? "ts3_c" . $this->currObj->cid : "ts3_s" . $this->currObj->getParent()->getId();
}
return "ts3";
} | [
"protected",
"function",
"getParent",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"currObj",
"instanceof",
"TeamSpeak3_Node_Channel",
")",
"{",
"return",
"$",
"this",
"->",
"currObj",
"->",
"pid",
"?",
"\"ts3_c\"",
".",
"$",
"this",
"->",
"currObj",
"->",... | Returns the parent ID of the current element.
@return mixed | [
"Returns",
"the",
"parent",
"ID",
"of",
"the",
"current",
"element",
"."
] | train | https://github.com/planetteamspeak/ts3phpframework/blob/82ed6edc261547099c916a59f624caf5daa68035/libraries/TeamSpeak3/Viewer/Json.php#L130-L142 |
planetteamspeak/ts3phpframework | libraries/TeamSpeak3/Viewer/Json.php | TeamSpeak3_Viewer_Json.getLevel | protected function getLevel()
{
if($this->currObj instanceof TeamSpeak3_Node_Channel)
{
return $this->currObj->getLevel()+2;
}
elseif($this->currObj instanceof TeamSpeak3_Node_Client)
{
return $this->currObj->channelGetById($this->currObj->cid)->getLevel()+3;
}
return 1;
} | php | protected function getLevel()
{
if($this->currObj instanceof TeamSpeak3_Node_Channel)
{
return $this->currObj->getLevel()+2;
}
elseif($this->currObj instanceof TeamSpeak3_Node_Client)
{
return $this->currObj->channelGetById($this->currObj->cid)->getLevel()+3;
}
return 1;
} | [
"protected",
"function",
"getLevel",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"currObj",
"instanceof",
"TeamSpeak3_Node_Channel",
")",
"{",
"return",
"$",
"this",
"->",
"currObj",
"->",
"getLevel",
"(",
")",
"+",
"2",
";",
"}",
"elseif",
"(",
"$",
... | Returns the level of the current element.
@return integer | [
"Returns",
"the",
"level",
"of",
"the",
"current",
"element",
"."
] | train | https://github.com/planetteamspeak/ts3phpframework/blob/82ed6edc261547099c916a59f624caf5daa68035/libraries/TeamSpeak3/Viewer/Json.php#L149-L161 |
planetteamspeak/ts3phpframework | libraries/TeamSpeak3/Viewer/Json.php | TeamSpeak3_Viewer_Json.getType | protected function getType()
{
if($this->currObj instanceof TeamSpeak3_Node_Server)
{
return "server";
}
elseif($this->currObj instanceof TeamSpeak3_Node_Channel)
{
return "channel";
}
elseif($this->currObj instanceof TeamSpeak3_Node_Client)
{
return "client";
}
elseif($this->currObj instanceof TeamSpeak3_Node_Servergroup || $this->currObj instanceof TeamSpeak3_Node_Channelgroup)
{
return "group";
}
return "host";
} | php | protected function getType()
{
if($this->currObj instanceof TeamSpeak3_Node_Server)
{
return "server";
}
elseif($this->currObj instanceof TeamSpeak3_Node_Channel)
{
return "channel";
}
elseif($this->currObj instanceof TeamSpeak3_Node_Client)
{
return "client";
}
elseif($this->currObj instanceof TeamSpeak3_Node_Servergroup || $this->currObj instanceof TeamSpeak3_Node_Channelgroup)
{
return "group";
}
return "host";
} | [
"protected",
"function",
"getType",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"currObj",
"instanceof",
"TeamSpeak3_Node_Server",
")",
"{",
"return",
"\"server\"",
";",
"}",
"elseif",
"(",
"$",
"this",
"->",
"currObj",
"instanceof",
"TeamSpeak3_Node_Channel",
... | Returns a single type identifier for the current element.
@return string | [
"Returns",
"a",
"single",
"type",
"identifier",
"for",
"the",
"current",
"element",
"."
] | train | https://github.com/planetteamspeak/ts3phpframework/blob/82ed6edc261547099c916a59f624caf5daa68035/libraries/TeamSpeak3/Viewer/Json.php#L168-L188 |
planetteamspeak/ts3phpframework | libraries/TeamSpeak3/Viewer/Json.php | TeamSpeak3_Viewer_Json.getProps | protected function getProps()
{
$props = new stdClass();
if($this->currObj instanceof TeamSpeak3_Node_Host)
{
$this->id = 0;
$this->icon = 0;
$props->version = $this->currObj->version("version")->toString();
$props->platform = $this->currObj->version("platform")->toString();
$props->users = $this->currObj->virtualservers_total_clients_online;
$props->slots = $this->currObj->virtualservers_total_maxclients;
$props->flags = 0;
}
elseif($this->currObj instanceof TeamSpeak3_Node_Server)
{
$props->id = $this->currObj->getId();
$props->icon = $this->currObj->virtualserver_icon_id < 0 ? pow(2, 32)-($this->currObj->virtualserver_icon_id*-1) : $this->currObj->virtualserver_icon_id;
$props->welcmsg = strlen($this->currObj->virtualserver_welcomemessage) ? trim($this->currObj->virtualserver_welcomemessage) : null;
$props->hostmsg = strlen($this->currObj->virtualserver_hostmessage) ? trim($this->currObj->virtualserver_hostmessage) : null;
$props->version = TeamSpeak3_Helper_Convert::versionShort($this->currObj->virtualserver_version)->toString();
$props->platform = $this->currObj->virtualserver_platform->toString();
$props->country = null;
$props->users = $this->currObj->clientCount();
$props->slots = $this->currObj->virtualserver_maxclients;
$props->flags = 0;
$props->flags += $this->currObj->virtualserver_status == "online" ? 1 : 0;
$props->flags += $this->currObj->virtualserver_flag_password ? 2 : 0;
$props->flags += $this->currObj->virtualserver_autostart ? 4 : 0;
$props->flags += $this->currObj->virtualserver_weblist_enabled ? 8 : 0;
$props->flags += $this->currObj->virtualserver_ask_for_privilegekey ? 16 : 0;
}
elseif($this->currObj instanceof TeamSpeak3_Node_Channel)
{
$props->id = $this->currObj->getId();
$props->icon = $this->currObj->isSpacer() ? 0 : $this->currObj->channel_icon_id < 0 ? pow(2, 32)-($this->currObj->channel_icon_id*-1) : $this->currObj->channel_icon_id;
$props->path = trim($this->currObj->getPathway());
$props->topic = strlen($this->currObj->channel_topic) ? trim($this->currObj->channel_topic) : null;
$props->codec = $this->currObj->channel_codec;
$props->users = $this->currObj->total_clients == -1 ? 0 : $this->currObj->total_clients;
$props->slots = $this->currObj->channel_maxclients == -1 ? $this->currObj->getParent()->virtualserver_maxclients : $this->currObj->channel_maxclients;
$props->famusers = $this->currObj->total_clients_family == -1 ? 0 : $this->currObj->total_clients_family;
$props->famslots = $this->currObj->channel_maxfamilyclients == -1 ? $this->currObj->getParent()->virtualserver_maxclients : $this->currObj->channel_maxfamilyclients;
$props->spacer = $this->getSpacerType();
$props->flags = 0;
$props->flags += $this->currObj->channel_flag_default ? 1 : 0;
$props->flags += $this->currObj->channel_flag_password ? 2 : 0;
$props->flags += $this->currObj->channel_flag_permanent ? 4 : 0;
$props->flags += $this->currObj->channel_flag_semi_permanent ? 8 : 0;
$props->flags += ($props->codec == 3 || $props->codec == 5) ? 16 : 0;
$props->flags += $this->currObj->channel_needed_talk_power != 0 ? 32 : 0;
$props->flags += $this->currObj->total_clients != -1 ? 64 : 0;
$props->flags += $this->currObj->isSpacer() ? 128 : 0;
}
elseif($this->currObj instanceof TeamSpeak3_Node_Client)
{
$props->id = $this->currObj->getId();
$props->icon = $this->currObj->client_icon_id < 0 ? pow(2, 32)-($this->currObj->client_icon_id*-1) : $this->currObj->client_icon_id;
$props->version = TeamSpeak3_Helper_Convert::versionShort($this->currObj->client_version)->toString();
$props->platform = $this->currObj->client_platform->toString();
$props->country = strlen($this->currObj->client_country) ? trim($this->currObj->client_country) : null;
$props->awaymesg = strlen($this->currObj->client_away_message) ? trim($this->currObj->client_away_message) : null;
$props->memberof = array();
$props->badges = $this->currObj->getBadges();
$props->flags = 0;
foreach($this->currObj->memberOf() as $num => $group)
{
$props->memberof[$num] = new stdClass();
$props->memberof[$num]->name = trim($group->name);
$props->memberof[$num]->icon = $group->iconid < 0 ? pow(2, 32)-($group->iconid*-1) : $group->iconid;
$props->memberof[$num]->order = $group->sortid;
$props->memberof[$num]->flags = 0;
$props->memberof[$num]->flags += $group->namemode;
$props->memberof[$num]->flags += $group->type == 2 ? 4 : 0;
$props->memberof[$num]->flags += $group->type == 0 ? 8 : 0;
$props->memberof[$num]->flags += $group->savedb ? 16 : 0;
$props->memberof[$num]->flags += $group instanceof TeamSpeak3_Node_Servergroup ? 32 : 0;
}
$props->flags += $this->currObj->client_away ? 1 : 0;
$props->flags += $this->currObj->client_is_recording ? 2 : 0;
$props->flags += $this->currObj->client_is_channel_commander ? 4 : 0;
$props->flags += $this->currObj->client_is_priority_speaker ? 8 : 0;
$props->flags += $this->currObj->client_is_talker ? 16 : 0;
$props->flags += $this->currObj->channelGetById($this->currObj->cid)->channel_needed_talk_power > $this->currObj->client_talk_power && !$this->currObj->client_is_talker ? 32 : 0;
$props->flags += $this->currObj->client_input_muted || !$this->currObj->client_input_hardware ? 64 : 0;
$props->flags += $this->currObj->client_output_muted || !$this->currObj->client_output_hardware ? 128 : 0;
}
elseif($this->currObj instanceof TeamSpeak3_Node_Servergroup || $this->currObj instanceof TeamSpeak3_Node_Channelgroup)
{
$props->id = $this->currObj->getId();
$props->icon = $this->currObj->iconid < 0 ? pow(2, 32)-($this->currObj->iconid*-1) : $this->currObj->iconid;
$props->order = $this->currObj->sortid;
$props->n_map = $this->currObj->n_member_addp;
$props->n_mrp = $this->currObj->n_member_removep;
$props->flags = 0;
$props->flags += $this->currObj->namemode;
$props->flags += $this->currObj->type == 2 ? 4 : 0;
$props->flags += $this->currObj->type == 0 ? 8 : 0;
$props->flags += $this->currObj->savedb ? 16 : 0;
$props->flags += $this->currObj instanceof TeamSpeak3_Node_Servergroup ? 32 : 0;
}
return $props;
} | php | protected function getProps()
{
$props = new stdClass();
if($this->currObj instanceof TeamSpeak3_Node_Host)
{
$this->id = 0;
$this->icon = 0;
$props->version = $this->currObj->version("version")->toString();
$props->platform = $this->currObj->version("platform")->toString();
$props->users = $this->currObj->virtualservers_total_clients_online;
$props->slots = $this->currObj->virtualservers_total_maxclients;
$props->flags = 0;
}
elseif($this->currObj instanceof TeamSpeak3_Node_Server)
{
$props->id = $this->currObj->getId();
$props->icon = $this->currObj->virtualserver_icon_id < 0 ? pow(2, 32)-($this->currObj->virtualserver_icon_id*-1) : $this->currObj->virtualserver_icon_id;
$props->welcmsg = strlen($this->currObj->virtualserver_welcomemessage) ? trim($this->currObj->virtualserver_welcomemessage) : null;
$props->hostmsg = strlen($this->currObj->virtualserver_hostmessage) ? trim($this->currObj->virtualserver_hostmessage) : null;
$props->version = TeamSpeak3_Helper_Convert::versionShort($this->currObj->virtualserver_version)->toString();
$props->platform = $this->currObj->virtualserver_platform->toString();
$props->country = null;
$props->users = $this->currObj->clientCount();
$props->slots = $this->currObj->virtualserver_maxclients;
$props->flags = 0;
$props->flags += $this->currObj->virtualserver_status == "online" ? 1 : 0;
$props->flags += $this->currObj->virtualserver_flag_password ? 2 : 0;
$props->flags += $this->currObj->virtualserver_autostart ? 4 : 0;
$props->flags += $this->currObj->virtualserver_weblist_enabled ? 8 : 0;
$props->flags += $this->currObj->virtualserver_ask_for_privilegekey ? 16 : 0;
}
elseif($this->currObj instanceof TeamSpeak3_Node_Channel)
{
$props->id = $this->currObj->getId();
$props->icon = $this->currObj->isSpacer() ? 0 : $this->currObj->channel_icon_id < 0 ? pow(2, 32)-($this->currObj->channel_icon_id*-1) : $this->currObj->channel_icon_id;
$props->path = trim($this->currObj->getPathway());
$props->topic = strlen($this->currObj->channel_topic) ? trim($this->currObj->channel_topic) : null;
$props->codec = $this->currObj->channel_codec;
$props->users = $this->currObj->total_clients == -1 ? 0 : $this->currObj->total_clients;
$props->slots = $this->currObj->channel_maxclients == -1 ? $this->currObj->getParent()->virtualserver_maxclients : $this->currObj->channel_maxclients;
$props->famusers = $this->currObj->total_clients_family == -1 ? 0 : $this->currObj->total_clients_family;
$props->famslots = $this->currObj->channel_maxfamilyclients == -1 ? $this->currObj->getParent()->virtualserver_maxclients : $this->currObj->channel_maxfamilyclients;
$props->spacer = $this->getSpacerType();
$props->flags = 0;
$props->flags += $this->currObj->channel_flag_default ? 1 : 0;
$props->flags += $this->currObj->channel_flag_password ? 2 : 0;
$props->flags += $this->currObj->channel_flag_permanent ? 4 : 0;
$props->flags += $this->currObj->channel_flag_semi_permanent ? 8 : 0;
$props->flags += ($props->codec == 3 || $props->codec == 5) ? 16 : 0;
$props->flags += $this->currObj->channel_needed_talk_power != 0 ? 32 : 0;
$props->flags += $this->currObj->total_clients != -1 ? 64 : 0;
$props->flags += $this->currObj->isSpacer() ? 128 : 0;
}
elseif($this->currObj instanceof TeamSpeak3_Node_Client)
{
$props->id = $this->currObj->getId();
$props->icon = $this->currObj->client_icon_id < 0 ? pow(2, 32)-($this->currObj->client_icon_id*-1) : $this->currObj->client_icon_id;
$props->version = TeamSpeak3_Helper_Convert::versionShort($this->currObj->client_version)->toString();
$props->platform = $this->currObj->client_platform->toString();
$props->country = strlen($this->currObj->client_country) ? trim($this->currObj->client_country) : null;
$props->awaymesg = strlen($this->currObj->client_away_message) ? trim($this->currObj->client_away_message) : null;
$props->memberof = array();
$props->badges = $this->currObj->getBadges();
$props->flags = 0;
foreach($this->currObj->memberOf() as $num => $group)
{
$props->memberof[$num] = new stdClass();
$props->memberof[$num]->name = trim($group->name);
$props->memberof[$num]->icon = $group->iconid < 0 ? pow(2, 32)-($group->iconid*-1) : $group->iconid;
$props->memberof[$num]->order = $group->sortid;
$props->memberof[$num]->flags = 0;
$props->memberof[$num]->flags += $group->namemode;
$props->memberof[$num]->flags += $group->type == 2 ? 4 : 0;
$props->memberof[$num]->flags += $group->type == 0 ? 8 : 0;
$props->memberof[$num]->flags += $group->savedb ? 16 : 0;
$props->memberof[$num]->flags += $group instanceof TeamSpeak3_Node_Servergroup ? 32 : 0;
}
$props->flags += $this->currObj->client_away ? 1 : 0;
$props->flags += $this->currObj->client_is_recording ? 2 : 0;
$props->flags += $this->currObj->client_is_channel_commander ? 4 : 0;
$props->flags += $this->currObj->client_is_priority_speaker ? 8 : 0;
$props->flags += $this->currObj->client_is_talker ? 16 : 0;
$props->flags += $this->currObj->channelGetById($this->currObj->cid)->channel_needed_talk_power > $this->currObj->client_talk_power && !$this->currObj->client_is_talker ? 32 : 0;
$props->flags += $this->currObj->client_input_muted || !$this->currObj->client_input_hardware ? 64 : 0;
$props->flags += $this->currObj->client_output_muted || !$this->currObj->client_output_hardware ? 128 : 0;
}
elseif($this->currObj instanceof TeamSpeak3_Node_Servergroup || $this->currObj instanceof TeamSpeak3_Node_Channelgroup)
{
$props->id = $this->currObj->getId();
$props->icon = $this->currObj->iconid < 0 ? pow(2, 32)-($this->currObj->iconid*-1) : $this->currObj->iconid;
$props->order = $this->currObj->sortid;
$props->n_map = $this->currObj->n_member_addp;
$props->n_mrp = $this->currObj->n_member_removep;
$props->flags = 0;
$props->flags += $this->currObj->namemode;
$props->flags += $this->currObj->type == 2 ? 4 : 0;
$props->flags += $this->currObj->type == 0 ? 8 : 0;
$props->flags += $this->currObj->savedb ? 16 : 0;
$props->flags += $this->currObj instanceof TeamSpeak3_Node_Servergroup ? 32 : 0;
}
return $props;
} | [
"protected",
"function",
"getProps",
"(",
")",
"{",
"$",
"props",
"=",
"new",
"stdClass",
"(",
")",
";",
"if",
"(",
"$",
"this",
"->",
"currObj",
"instanceof",
"TeamSpeak3_Node_Host",
")",
"{",
"$",
"this",
"->",
"id",
"=",
"0",
";",
"$",
"this",
"->... | Returns the parent ID of the current element.
@return stdClass | [
"Returns",
"the",
"parent",
"ID",
"of",
"the",
"current",
"element",
"."
] | train | https://github.com/planetteamspeak/ts3phpframework/blob/82ed6edc261547099c916a59f624caf5daa68035/libraries/TeamSpeak3/Viewer/Json.php#L353-L463 |
planetteamspeak/ts3phpframework | libraries/TeamSpeak3/Node/Servergroup.php | TeamSpeak3_Node_Servergroup.copy | public function copy($name = null, $tsgid = 0, $type = TeamSpeak3::GROUP_DBTYPE_REGULAR)
{
return $this->getParent()->serverGroupCopy($this->getId(), $name, $tsgid, $type);
} | php | public function copy($name = null, $tsgid = 0, $type = TeamSpeak3::GROUP_DBTYPE_REGULAR)
{
return $this->getParent()->serverGroupCopy($this->getId(), $name, $tsgid, $type);
} | [
"public",
"function",
"copy",
"(",
"$",
"name",
"=",
"null",
",",
"$",
"tsgid",
"=",
"0",
",",
"$",
"type",
"=",
"TeamSpeak3",
"::",
"GROUP_DBTYPE_REGULAR",
")",
"{",
"return",
"$",
"this",
"->",
"getParent",
"(",
")",
"->",
"serverGroupCopy",
"(",
"$"... | Creates a copy of the server group and returns the new groups ID.
@param string $name
@param integer $tsgid
@param integer $type
@return integer | [
"Creates",
"a",
"copy",
"of",
"the",
"server",
"group",
"and",
"returns",
"the",
"new",
"groups",
"ID",
"."
] | train | https://github.com/planetteamspeak/ts3phpframework/blob/82ed6edc261547099c916a59f624caf5daa68035/libraries/TeamSpeak3/Node/Servergroup.php#L84-L87 |
planetteamspeak/ts3phpframework | libraries/TeamSpeak3/Node/Servergroup.php | TeamSpeak3_Node_Servergroup.privilegeKeyCreate | public function privilegeKeyCreate($description = null, $customset = null)
{
return $this->getParent()->privilegeKeyCreate(TeamSpeak3::TOKEN_SERVERGROUP, $this->getId(), 0, $description, $customset);
} | php | public function privilegeKeyCreate($description = null, $customset = null)
{
return $this->getParent()->privilegeKeyCreate(TeamSpeak3::TOKEN_SERVERGROUP, $this->getId(), 0, $description, $customset);
} | [
"public",
"function",
"privilegeKeyCreate",
"(",
"$",
"description",
"=",
"null",
",",
"$",
"customset",
"=",
"null",
")",
"{",
"return",
"$",
"this",
"->",
"getParent",
"(",
")",
"->",
"privilegeKeyCreate",
"(",
"TeamSpeak3",
"::",
"TOKEN_SERVERGROUP",
",",
... | Creates a new privilege key (token) for the server group and returns the key.
@param string $description
@param string $customset
@return TeamSpeak3_Helper_String | [
"Creates",
"a",
"new",
"privilege",
"key",
"(",
"token",
")",
"for",
"the",
"server",
"group",
"and",
"returns",
"the",
"key",
"."
] | train | https://github.com/planetteamspeak/ts3phpframework/blob/82ed6edc261547099c916a59f624caf5daa68035/libraries/TeamSpeak3/Node/Servergroup.php#L197-L200 |
planetteamspeak/ts3phpframework | libraries/TeamSpeak3/TeamSpeak3.php | TeamSpeak3.loadClass | protected static function loadClass($class)
{
if(class_exists($class, FALSE) || interface_exists($class, FALSE))
{
return;
}
if(preg_match("/[^a-z0-9\\/\\\\_.-]/i", $class))
{
throw new LogicException("illegal characters in classname '" . $class . "'");
}
$file = self::getFilePath($class) . ".php";
if(!file_exists($file) || !is_readable($file))
{
throw new LogicException("file '" . $file . "' does not exist or is not readable");
}
if(class_exists($class, FALSE) || interface_exists($class, FALSE))
{
throw new LogicException("class '" . $class . "' does not exist");
}
return include_once($file);
} | php | protected static function loadClass($class)
{
if(class_exists($class, FALSE) || interface_exists($class, FALSE))
{
return;
}
if(preg_match("/[^a-z0-9\\/\\\\_.-]/i", $class))
{
throw new LogicException("illegal characters in classname '" . $class . "'");
}
$file = self::getFilePath($class) . ".php";
if(!file_exists($file) || !is_readable($file))
{
throw new LogicException("file '" . $file . "' does not exist or is not readable");
}
if(class_exists($class, FALSE) || interface_exists($class, FALSE))
{
throw new LogicException("class '" . $class . "' does not exist");
}
return include_once($file);
} | [
"protected",
"static",
"function",
"loadClass",
"(",
"$",
"class",
")",
"{",
"if",
"(",
"class_exists",
"(",
"$",
"class",
",",
"FALSE",
")",
"||",
"interface_exists",
"(",
"$",
"class",
",",
"FALSE",
")",
")",
"{",
"return",
";",
"}",
"if",
"(",
"pr... | Loads a class from a PHP file. The filename must be formatted as "$class.php".
include() is not prefixed with the @ operator because if the file is loaded and
contains a parse error, execution will halt silently and this is difficult to debug.
@param string $class
@throws LogicException
@return boolean | [
"Loads",
"a",
"class",
"from",
"a",
"PHP",
"file",
".",
"The",
"filename",
"must",
"be",
"formatted",
"as",
"$class",
".",
"php",
"."
] | train | https://github.com/planetteamspeak/ts3phpframework/blob/82ed6edc261547099c916a59f624caf5daa68035/libraries/TeamSpeak3/TeamSpeak3.php#L439-L464 |
planetteamspeak/ts3phpframework | libraries/TeamSpeak3/TeamSpeak3.php | TeamSpeak3.getFilePath | protected static function getFilePath($name)
{
$path = str_replace("_", DIRECTORY_SEPARATOR, $name);
$path = str_replace(__CLASS__, dirname(__FILE__), $path);
return $path;
} | php | protected static function getFilePath($name)
{
$path = str_replace("_", DIRECTORY_SEPARATOR, $name);
$path = str_replace(__CLASS__, dirname(__FILE__), $path);
return $path;
} | [
"protected",
"static",
"function",
"getFilePath",
"(",
"$",
"name",
")",
"{",
"$",
"path",
"=",
"str_replace",
"(",
"\"_\"",
",",
"DIRECTORY_SEPARATOR",
",",
"$",
"name",
")",
";",
"$",
"path",
"=",
"str_replace",
"(",
"__CLASS__",
",",
"dirname",
"(",
"... | Generates a possible file path for $name.
@param string $name
@return string | [
"Generates",
"a",
"possible",
"file",
"path",
"for",
"$name",
"."
] | train | https://github.com/planetteamspeak/ts3phpframework/blob/82ed6edc261547099c916a59f624caf5daa68035/libraries/TeamSpeak3/TeamSpeak3.php#L472-L478 |
planetteamspeak/ts3phpframework | libraries/TeamSpeak3/TeamSpeak3.php | TeamSpeak3.getAdapterName | protected static function getAdapterName($name, $namespace = "TeamSpeak3_Adapter_")
{
$path = self::getFilePath($namespace);
$scan = scandir($path);
foreach($scan as $node)
{
$file = TeamSpeak3_Helper_String::factory($node)->toLower();
if($file->startsWith($name) && $file->endsWith(".php"))
{
return $namespace . str_replace(".php", "", $node);
}
}
throw new TeamSpeak3_Adapter_Exception("adapter '" . $name . "' does not exist");
} | php | protected static function getAdapterName($name, $namespace = "TeamSpeak3_Adapter_")
{
$path = self::getFilePath($namespace);
$scan = scandir($path);
foreach($scan as $node)
{
$file = TeamSpeak3_Helper_String::factory($node)->toLower();
if($file->startsWith($name) && $file->endsWith(".php"))
{
return $namespace . str_replace(".php", "", $node);
}
}
throw new TeamSpeak3_Adapter_Exception("adapter '" . $name . "' does not exist");
} | [
"protected",
"static",
"function",
"getAdapterName",
"(",
"$",
"name",
",",
"$",
"namespace",
"=",
"\"TeamSpeak3_Adapter_\"",
")",
"{",
"$",
"path",
"=",
"self",
"::",
"getFilePath",
"(",
"$",
"namespace",
")",
";",
"$",
"scan",
"=",
"scandir",
"(",
"$",
... | Returns the name of an adapter class by $name.
@param string $name
@param string $namespace
@throws TeamSpeak3_Adapter_Exception
@return string | [
"Returns",
"the",
"name",
"of",
"an",
"adapter",
"class",
"by",
"$name",
"."
] | train | https://github.com/planetteamspeak/ts3phpframework/blob/82ed6edc261547099c916a59f624caf5daa68035/libraries/TeamSpeak3/TeamSpeak3.php#L488-L504 |
planetteamspeak/ts3phpframework | libraries/TeamSpeak3/TeamSpeak3.php | TeamSpeak3.autoload | public static function autoload($class)
{
if(substr($class, 0, strlen(__CLASS__)) != __CLASS__) return;
try
{
self::loadClass($class);
return TRUE;
}
catch(Exception $e)
{
return FALSE;
}
} | php | public static function autoload($class)
{
if(substr($class, 0, strlen(__CLASS__)) != __CLASS__) return;
try
{
self::loadClass($class);
return TRUE;
}
catch(Exception $e)
{
return FALSE;
}
} | [
"public",
"static",
"function",
"autoload",
"(",
"$",
"class",
")",
"{",
"if",
"(",
"substr",
"(",
"$",
"class",
",",
"0",
",",
"strlen",
"(",
"__CLASS__",
")",
")",
"!=",
"__CLASS__",
")",
"return",
";",
"try",
"{",
"self",
"::",
"loadClass",
"(",
... | spl_autoload() suitable implementation for supporting class autoloading.
@param string $class
@return boolean | [
"spl_autoload",
"()",
"suitable",
"implementation",
"for",
"supporting",
"class",
"autoloading",
"."
] | train | https://github.com/planetteamspeak/ts3phpframework/blob/82ed6edc261547099c916a59f624caf5daa68035/libraries/TeamSpeak3/TeamSpeak3.php#L512-L526 |
planetteamspeak/ts3phpframework | libraries/TeamSpeak3/TeamSpeak3.php | TeamSpeak3.init | public static function init()
{
if(version_compare(phpversion(), "5.2.1") == -1)
{
throw new LogicException("this particular software cannot be used with the installed version of PHP");
}
if(!function_exists("stream_socket_client"))
{
throw new LogicException("network functions are not available in this PHP installation");
}
if(!function_exists("spl_autoload_register"))
{
throw new LogicException("autoload functions are not available in this PHP installation");
}
if(!class_exists("TeamSpeak3_Helper_Profiler"))
{
spl_autoload_register(array(__CLASS__, "autoload"));
}
TeamSpeak3_Helper_Profiler::start();
} | php | public static function init()
{
if(version_compare(phpversion(), "5.2.1") == -1)
{
throw new LogicException("this particular software cannot be used with the installed version of PHP");
}
if(!function_exists("stream_socket_client"))
{
throw new LogicException("network functions are not available in this PHP installation");
}
if(!function_exists("spl_autoload_register"))
{
throw new LogicException("autoload functions are not available in this PHP installation");
}
if(!class_exists("TeamSpeak3_Helper_Profiler"))
{
spl_autoload_register(array(__CLASS__, "autoload"));
}
TeamSpeak3_Helper_Profiler::start();
} | [
"public",
"static",
"function",
"init",
"(",
")",
"{",
"if",
"(",
"version_compare",
"(",
"phpversion",
"(",
")",
",",
"\"5.2.1\"",
")",
"==",
"-",
"1",
")",
"{",
"throw",
"new",
"LogicException",
"(",
"\"this particular software cannot be used with the installed ... | Checks for required PHP features, enables autoloading and starts a default profiler.
@throws LogicException
@return void | [
"Checks",
"for",
"required",
"PHP",
"features",
"enables",
"autoloading",
"and",
"starts",
"a",
"default",
"profiler",
"."
] | train | https://github.com/planetteamspeak/ts3phpframework/blob/82ed6edc261547099c916a59f624caf5daa68035/libraries/TeamSpeak3/TeamSpeak3.php#L534-L557 |
planetteamspeak/ts3phpframework | libraries/TeamSpeak3/Node/Channel.php | TeamSpeak3_Node_Channel.subChannelList | public function subChannelList(array $filter = array())
{
$channels = array();
foreach($this->getParent()->channelList() as $channel)
{
if($channel["pid"] == $this->getId())
{
$channels[$channel->getId()] = $channel;
}
}
return $this->filterList($channels, $filter);
} | php | public function subChannelList(array $filter = array())
{
$channels = array();
foreach($this->getParent()->channelList() as $channel)
{
if($channel["pid"] == $this->getId())
{
$channels[$channel->getId()] = $channel;
}
}
return $this->filterList($channels, $filter);
} | [
"public",
"function",
"subChannelList",
"(",
"array",
"$",
"filter",
"=",
"array",
"(",
")",
")",
"{",
"$",
"channels",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"getParent",
"(",
")",
"->",
"channelList",
"(",
")",
"as",
"$",
... | Returns an array filled with TeamSpeak3_Node_Channel objects.
@param array $filter
@return array|TeamSpeak3_Node_Channel[] | [
"Returns",
"an",
"array",
"filled",
"with",
"TeamSpeak3_Node_Channel",
"objects",
"."
] | train | https://github.com/planetteamspeak/ts3phpframework/blob/82ed6edc261547099c916a59f624caf5daa68035/libraries/TeamSpeak3/Node/Channel.php#L59-L72 |
planetteamspeak/ts3phpframework | libraries/TeamSpeak3/Node/Channel.php | TeamSpeak3_Node_Channel.subChannelGetById | public function subChannelGetById($cid)
{
if(!array_key_exists((int) $cid, $this->subChannelList()))
{
throw new TeamSpeak3_Adapter_ServerQuery_Exception("invalid channelID", 0x300);
}
return $this->channelList[(int) $cid];
} | php | public function subChannelGetById($cid)
{
if(!array_key_exists((int) $cid, $this->subChannelList()))
{
throw new TeamSpeak3_Adapter_ServerQuery_Exception("invalid channelID", 0x300);
}
return $this->channelList[(int) $cid];
} | [
"public",
"function",
"subChannelGetById",
"(",
"$",
"cid",
")",
"{",
"if",
"(",
"!",
"array_key_exists",
"(",
"(",
"int",
")",
"$",
"cid",
",",
"$",
"this",
"->",
"subChannelList",
"(",
")",
")",
")",
"{",
"throw",
"new",
"TeamSpeak3_Adapter_ServerQuery_E... | Returns the TeamSpeak3_Node_Channel object matching the given ID.
@param integer $cid
@throws TeamSpeak3_Adapter_ServerQuery_Exception
@return TeamSpeak3_Node_Channel | [
"Returns",
"the",
"TeamSpeak3_Node_Channel",
"object",
"matching",
"the",
"given",
"ID",
"."
] | train | https://github.com/planetteamspeak/ts3phpframework/blob/82ed6edc261547099c916a59f624caf5daa68035/libraries/TeamSpeak3/Node/Channel.php#L81-L89 |
planetteamspeak/ts3phpframework | libraries/TeamSpeak3/Node/Channel.php | TeamSpeak3_Node_Channel.subChannelGetByName | public function subChannelGetByName($name)
{
foreach($this->subChannelList() as $channel)
{
if($channel["channel_name"] == $name) return $channel;
}
throw new TeamSpeak3_Adapter_ServerQuery_Exception("invalid channelID", 0x300);
} | php | public function subChannelGetByName($name)
{
foreach($this->subChannelList() as $channel)
{
if($channel["channel_name"] == $name) return $channel;
}
throw new TeamSpeak3_Adapter_ServerQuery_Exception("invalid channelID", 0x300);
} | [
"public",
"function",
"subChannelGetByName",
"(",
"$",
"name",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"subChannelList",
"(",
")",
"as",
"$",
"channel",
")",
"{",
"if",
"(",
"$",
"channel",
"[",
"\"channel_name\"",
"]",
"==",
"$",
"name",
")",
"re... | Returns the TeamSpeak3_Node_Channel object matching the given name.
@param integer $name
@throws TeamSpeak3_Adapter_ServerQuery_Exception
@return TeamSpeak3_Node_Channel | [
"Returns",
"the",
"TeamSpeak3_Node_Channel",
"object",
"matching",
"the",
"given",
"name",
"."
] | train | https://github.com/planetteamspeak/ts3phpframework/blob/82ed6edc261547099c916a59f624caf5daa68035/libraries/TeamSpeak3/Node/Channel.php#L98-L106 |
planetteamspeak/ts3phpframework | libraries/TeamSpeak3/Node/Channel.php | TeamSpeak3_Node_Channel.clientList | public function clientList(array $filter = array())
{
$clients = array();
foreach($this->getParent()->clientList() as $client)
{
if($client["cid"] == $this->getId())
{
$clients[$client->getId()] = $client;
}
}
return $this->filterList($clients, $filter);
} | php | public function clientList(array $filter = array())
{
$clients = array();
foreach($this->getParent()->clientList() as $client)
{
if($client["cid"] == $this->getId())
{
$clients[$client->getId()] = $client;
}
}
return $this->filterList($clients, $filter);
} | [
"public",
"function",
"clientList",
"(",
"array",
"$",
"filter",
"=",
"array",
"(",
")",
")",
"{",
"$",
"clients",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"getParent",
"(",
")",
"->",
"clientList",
"(",
")",
"as",
"$",
"clie... | Returns an array filled with TeamSpeak3_Node_Client objects.
@param array $filter
@return array | TeamSpeak3_Node_Client[] | [
"Returns",
"an",
"array",
"filled",
"with",
"TeamSpeak3_Node_Client",
"objects",
"."
] | train | https://github.com/planetteamspeak/ts3phpframework/blob/82ed6edc261547099c916a59f624caf5daa68035/libraries/TeamSpeak3/Node/Channel.php#L114-L127 |
planetteamspeak/ts3phpframework | libraries/TeamSpeak3/Node/Channel.php | TeamSpeak3_Node_Channel.clientGetById | public function clientGetById($clid)
{
if(!array_key_exists($clid, $this->clientList()))
{
throw new TeamSpeak3_Adapter_ServerQuery_Exception("invalid clientID", 0x200);
}
return $this->clientList[intval($clid)];
} | php | public function clientGetById($clid)
{
if(!array_key_exists($clid, $this->clientList()))
{
throw new TeamSpeak3_Adapter_ServerQuery_Exception("invalid clientID", 0x200);
}
return $this->clientList[intval($clid)];
} | [
"public",
"function",
"clientGetById",
"(",
"$",
"clid",
")",
"{",
"if",
"(",
"!",
"array_key_exists",
"(",
"$",
"clid",
",",
"$",
"this",
"->",
"clientList",
"(",
")",
")",
")",
"{",
"throw",
"new",
"TeamSpeak3_Adapter_ServerQuery_Exception",
"(",
"\"invali... | Returns the TeamSpeak3_Node_Client object matching the given ID.
@param integer $clid
@throws TeamSpeak3_Adapter_ServerQuery_Exception
@return TeamSpeak3_Node_Client | [
"Returns",
"the",
"TeamSpeak3_Node_Client",
"object",
"matching",
"the",
"given",
"ID",
"."
] | train | https://github.com/planetteamspeak/ts3phpframework/blob/82ed6edc261547099c916a59f624caf5daa68035/libraries/TeamSpeak3/Node/Channel.php#L136-L144 |
planetteamspeak/ts3phpframework | libraries/TeamSpeak3/Node/Channel.php | TeamSpeak3_Node_Channel.clientPermList | public function clientPermList($cldbid, $permsid = FALSE)
{
return $this->getParent()->channelClientPermList($this->getId(), $cldbid, $permsid);
} | php | public function clientPermList($cldbid, $permsid = FALSE)
{
return $this->getParent()->channelClientPermList($this->getId(), $cldbid, $permsid);
} | [
"public",
"function",
"clientPermList",
"(",
"$",
"cldbid",
",",
"$",
"permsid",
"=",
"FALSE",
")",
"{",
"return",
"$",
"this",
"->",
"getParent",
"(",
")",
"->",
"channelClientPermList",
"(",
"$",
"this",
"->",
"getId",
"(",
")",
",",
"$",
"cldbid",
"... | Returns a list of permissions defined for a client in the channel.
@param integer $cldbid
@param boolean $permsid
@return array | [
"Returns",
"a",
"list",
"of",
"permissions",
"defined",
"for",
"a",
"client",
"in",
"the",
"channel",
"."
] | train | https://github.com/planetteamspeak/ts3phpframework/blob/82ed6edc261547099c916a59f624caf5daa68035/libraries/TeamSpeak3/Node/Channel.php#L170-L173 |
planetteamspeak/ts3phpframework | libraries/TeamSpeak3/Node/Channel.php | TeamSpeak3_Node_Channel.clientPermAssign | public function clientPermAssign($cldbid, $permid, $permvalue)
{
$this->getParent()->channelClientPermAssign($this->getId(), $cldbid, $permid, $permvalue);
} | php | public function clientPermAssign($cldbid, $permid, $permvalue)
{
$this->getParent()->channelClientPermAssign($this->getId(), $cldbid, $permid, $permvalue);
} | [
"public",
"function",
"clientPermAssign",
"(",
"$",
"cldbid",
",",
"$",
"permid",
",",
"$",
"permvalue",
")",
"{",
"$",
"this",
"->",
"getParent",
"(",
")",
"->",
"channelClientPermAssign",
"(",
"$",
"this",
"->",
"getId",
"(",
")",
",",
"$",
"cldbid",
... | Adds a set of specified permissions to a client in a specific channel. Multiple permissions can be added by
providing the two parameters of each permission.
@param integer $cldbid
@param integer $permid
@param integer $permvalue
@return void | [
"Adds",
"a",
"set",
"of",
"specified",
"permissions",
"to",
"a",
"client",
"in",
"a",
"specific",
"channel",
".",
"Multiple",
"permissions",
"can",
"be",
"added",
"by",
"providing",
"the",
"two",
"parameters",
"of",
"each",
"permission",
"."
] | train | https://github.com/planetteamspeak/ts3phpframework/blob/82ed6edc261547099c916a59f624caf5daa68035/libraries/TeamSpeak3/Node/Channel.php#L184-L187 |
planetteamspeak/ts3phpframework | libraries/TeamSpeak3/Node/Channel.php | TeamSpeak3_Node_Channel.fileInfo | public function fileInfo($cpw = "", $name = "/")
{
return $this->getParent()->channelFileInfo($this->getId(), $cpw, $name);
} | php | public function fileInfo($cpw = "", $name = "/")
{
return $this->getParent()->channelFileInfo($this->getId(), $cpw, $name);
} | [
"public",
"function",
"fileInfo",
"(",
"$",
"cpw",
"=",
"\"\"",
",",
"$",
"name",
"=",
"\"/\"",
")",
"{",
"return",
"$",
"this",
"->",
"getParent",
"(",
")",
"->",
"channelFileInfo",
"(",
"$",
"this",
"->",
"getId",
"(",
")",
",",
"$",
"cpw",
",",
... | Returns detailed information about the specified file stored in the channels file repository.
@param string $cpw
@param string $name
@return array | [
"Returns",
"detailed",
"information",
"about",
"the",
"specified",
"file",
"stored",
"in",
"the",
"channels",
"file",
"repository",
"."
] | train | https://github.com/planetteamspeak/ts3phpframework/blob/82ed6edc261547099c916a59f624caf5daa68035/libraries/TeamSpeak3/Node/Channel.php#L296-L299 |
planetteamspeak/ts3phpframework | libraries/TeamSpeak3/Node/Channel.php | TeamSpeak3_Node_Channel.move | public function move($pid, $order = null)
{
$this->getParent()->channelMove($this->getId(), $pid, $order);
} | php | public function move($pid, $order = null)
{
$this->getParent()->channelMove($this->getId(), $pid, $order);
} | [
"public",
"function",
"move",
"(",
"$",
"pid",
",",
"$",
"order",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"getParent",
"(",
")",
"->",
"channelMove",
"(",
"$",
"this",
"->",
"getId",
"(",
")",
",",
"$",
"pid",
",",
"$",
"order",
")",
";",
"}"... | Moves the channel to the parent channel specified with $pid.
@param integer $pid
@param integer $order
@return void | [
"Moves",
"the",
"channel",
"to",
"the",
"parent",
"channel",
"specified",
"with",
"$pid",
"."
] | train | https://github.com/planetteamspeak/ts3phpframework/blob/82ed6edc261547099c916a59f624caf5daa68035/libraries/TeamSpeak3/Node/Channel.php#L455-L458 |
planetteamspeak/ts3phpframework | libraries/TeamSpeak3/Adapter/ServerQuery/Reply.php | TeamSpeak3_Adapter_ServerQuery_Reply.toLines | public function toLines()
{
if(!count($this->rpl)) return array();
$list = $this->toString(0)->split(TeamSpeak3::SEPARATOR_LIST);
if(!func_num_args())
{
for($i = 0; $i < count($list); $i++) $list[$i]->unescape();
}
return $list;
} | php | public function toLines()
{
if(!count($this->rpl)) return array();
$list = $this->toString(0)->split(TeamSpeak3::SEPARATOR_LIST);
if(!func_num_args())
{
for($i = 0; $i < count($list); $i++) $list[$i]->unescape();
}
return $list;
} | [
"public",
"function",
"toLines",
"(",
")",
"{",
"if",
"(",
"!",
"count",
"(",
"$",
"this",
"->",
"rpl",
")",
")",
"return",
"array",
"(",
")",
";",
"$",
"list",
"=",
"$",
"this",
"->",
"toString",
"(",
"0",
")",
"->",
"split",
"(",
"TeamSpeak3",
... | Returns the reply as a standard PHP array where each element represents one item.
@return array | [
"Returns",
"the",
"reply",
"as",
"a",
"standard",
"PHP",
"array",
"where",
"each",
"element",
"represents",
"one",
"item",
"."
] | train | https://github.com/planetteamspeak/ts3phpframework/blob/82ed6edc261547099c916a59f624caf5daa68035/libraries/TeamSpeak3/Adapter/ServerQuery/Reply.php#L107-L119 |
planetteamspeak/ts3phpframework | libraries/TeamSpeak3/Adapter/ServerQuery/Reply.php | TeamSpeak3_Adapter_ServerQuery_Reply.toTable | public function toTable()
{
$table = array();
foreach($this->toLines(0) as $cells)
{
$pairs = $cells->split(TeamSpeak3::SEPARATOR_CELL);
if(!func_num_args())
{
for($i = 0; $i < count($pairs); $i++) $pairs[$i]->unescape();
}
$table[] = $pairs;
}
return $table;
} | php | public function toTable()
{
$table = array();
foreach($this->toLines(0) as $cells)
{
$pairs = $cells->split(TeamSpeak3::SEPARATOR_CELL);
if(!func_num_args())
{
for($i = 0; $i < count($pairs); $i++) $pairs[$i]->unescape();
}
$table[] = $pairs;
}
return $table;
} | [
"public",
"function",
"toTable",
"(",
")",
"{",
"$",
"table",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"toLines",
"(",
"0",
")",
"as",
"$",
"cells",
")",
"{",
"$",
"pairs",
"=",
"$",
"cells",
"->",
"split",
"(",
"TeamSpeak3... | Returns the reply as a standard PHP array where each element represents one item in table format.
@return array | [
"Returns",
"the",
"reply",
"as",
"a",
"standard",
"PHP",
"array",
"where",
"each",
"element",
"represents",
"one",
"item",
"in",
"table",
"format",
"."
] | train | https://github.com/planetteamspeak/ts3phpframework/blob/82ed6edc261547099c916a59f624caf5daa68035/libraries/TeamSpeak3/Adapter/ServerQuery/Reply.php#L126-L143 |
planetteamspeak/ts3phpframework | libraries/TeamSpeak3/Adapter/ServerQuery/Reply.php | TeamSpeak3_Adapter_ServerQuery_Reply.toObjectArray | public function toObjectArray()
{
$array = (func_num_args() > 1) ? $this->toArray(1) : $this->toArray();
for($i = 0; $i < count($array); $i++)
{
$array[$i] = (object) $array[$i];
}
return $array;
} | php | public function toObjectArray()
{
$array = (func_num_args() > 1) ? $this->toArray(1) : $this->toArray();
for($i = 0; $i < count($array); $i++)
{
$array[$i] = (object) $array[$i];
}
return $array;
} | [
"public",
"function",
"toObjectArray",
"(",
")",
"{",
"$",
"array",
"=",
"(",
"func_num_args",
"(",
")",
">",
"1",
")",
"?",
"$",
"this",
"->",
"toArray",
"(",
"1",
")",
":",
"$",
"this",
"->",
"toArray",
"(",
")",
";",
"for",
"(",
"$",
"i",
"=... | Returns an array containing stdClass objects.
@return ArrayObject | [
"Returns",
"an",
"array",
"containing",
"stdClass",
"objects",
"."
] | train | https://github.com/planetteamspeak/ts3phpframework/blob/82ed6edc261547099c916a59f624caf5daa68035/libraries/TeamSpeak3/Adapter/ServerQuery/Reply.php#L229-L239 |
planetteamspeak/ts3phpframework | libraries/TeamSpeak3/Adapter/ServerQuery/Reply.php | TeamSpeak3_Adapter_ServerQuery_Reply.getErrorProperty | public function getErrorProperty($ident, $default = null)
{
return (array_key_exists($ident, $this->err)) ? $this->err[$ident] : $default;
} | php | public function getErrorProperty($ident, $default = null)
{
return (array_key_exists($ident, $this->err)) ? $this->err[$ident] : $default;
} | [
"public",
"function",
"getErrorProperty",
"(",
"$",
"ident",
",",
"$",
"default",
"=",
"null",
")",
"{",
"return",
"(",
"array_key_exists",
"(",
"$",
"ident",
",",
"$",
"this",
"->",
"err",
")",
")",
"?",
"$",
"this",
"->",
"err",
"[",
"$",
"ident",
... | Returns the value for a specified error property.
@param string $ident
@param mixed $default
@return mixed | [
"Returns",
"the",
"value",
"for",
"a",
"specified",
"error",
"property",
"."
] | train | https://github.com/planetteamspeak/ts3phpframework/blob/82ed6edc261547099c916a59f624caf5daa68035/libraries/TeamSpeak3/Adapter/ServerQuery/Reply.php#L268-L271 |
planetteamspeak/ts3phpframework | libraries/TeamSpeak3/Adapter/ServerQuery/Reply.php | TeamSpeak3_Adapter_ServerQuery_Reply.fetchReply | protected function fetchReply($rpl)
{
foreach($rpl as $key => $val)
{
if($val->startsWith(TeamSpeak3::TS3_MOTD_PREFIX) || $val->startsWith(TeamSpeak3::TEA_MOTD_PREFIX) || (defined("CUSTOM_MOTD_PREFIX") && $val->startsWith(CUSTOM_MOTD_PREFIX)))
{
unset($rpl[$key]);
}
elseif($val->startsWith(TeamSpeak3::EVENT))
{
$this->evt[] = new TeamSpeak3_Adapter_ServerQuery_Event($rpl[$key], $this->con);
unset($rpl[$key]);
}
}
$this->rpl = new TeamSpeak3_Helper_String(implode(TeamSpeak3::SEPARATOR_LIST, $rpl));
} | php | protected function fetchReply($rpl)
{
foreach($rpl as $key => $val)
{
if($val->startsWith(TeamSpeak3::TS3_MOTD_PREFIX) || $val->startsWith(TeamSpeak3::TEA_MOTD_PREFIX) || (defined("CUSTOM_MOTD_PREFIX") && $val->startsWith(CUSTOM_MOTD_PREFIX)))
{
unset($rpl[$key]);
}
elseif($val->startsWith(TeamSpeak3::EVENT))
{
$this->evt[] = new TeamSpeak3_Adapter_ServerQuery_Event($rpl[$key], $this->con);
unset($rpl[$key]);
}
}
$this->rpl = new TeamSpeak3_Helper_String(implode(TeamSpeak3::SEPARATOR_LIST, $rpl));
} | [
"protected",
"function",
"fetchReply",
"(",
"$",
"rpl",
")",
"{",
"foreach",
"(",
"$",
"rpl",
"as",
"$",
"key",
"=>",
"$",
"val",
")",
"{",
"if",
"(",
"$",
"val",
"->",
"startsWith",
"(",
"TeamSpeak3",
"::",
"TS3_MOTD_PREFIX",
")",
"||",
"$",
"val",
... | Parses a ServerQuery reply and creates a TeamSpeak3_Helper_String object.
@param string $rpl
@return void | [
"Parses",
"a",
"ServerQuery",
"reply",
"and",
"creates",
"a",
"TeamSpeak3_Helper_String",
"object",
"."
] | train | https://github.com/planetteamspeak/ts3phpframework/blob/82ed6edc261547099c916a59f624caf5daa68035/libraries/TeamSpeak3/Adapter/ServerQuery/Reply.php#L326-L342 |
planetteamspeak/ts3phpframework | libraries/TeamSpeak3/Helper/Convert.php | TeamSpeak3_Helper_Convert.seconds | public static function seconds($seconds, $is_ms = FALSE, $format = "%dD %02d:%02d:%02d")
{
if($is_ms) $seconds = $seconds/1000;
return sprintf($format, $seconds/60/60/24, ($seconds/60/60)%24, ($seconds/60)%60, $seconds%60);
} | php | public static function seconds($seconds, $is_ms = FALSE, $format = "%dD %02d:%02d:%02d")
{
if($is_ms) $seconds = $seconds/1000;
return sprintf($format, $seconds/60/60/24, ($seconds/60/60)%24, ($seconds/60)%60, $seconds%60);
} | [
"public",
"static",
"function",
"seconds",
"(",
"$",
"seconds",
",",
"$",
"is_ms",
"=",
"FALSE",
",",
"$",
"format",
"=",
"\"%dD %02d:%02d:%02d\"",
")",
"{",
"if",
"(",
"$",
"is_ms",
")",
"$",
"seconds",
"=",
"$",
"seconds",
"/",
"1000",
";",
"return",... | Converts seconds/milliseconds to a human readable value.
Note: Assumes non-negative integer, but no validation
@todo: Handle negative integer $seconds, or invalidate
@param integer $seconds
@param boolean $is_ms
@param string $format
@return string | [
"Converts",
"seconds",
"/",
"milliseconds",
"to",
"a",
"human",
"readable",
"value",
"."
] | train | https://github.com/planetteamspeak/ts3phpframework/blob/82ed6edc261547099c916a59f624caf5daa68035/libraries/TeamSpeak3/Helper/Convert.php#L70-L75 |
planetteamspeak/ts3phpframework | libraries/TeamSpeak3/Helper/Convert.php | TeamSpeak3_Helper_Convert.codec | public static function codec($codec)
{
if($codec == TeamSpeak3::CODEC_SPEEX_NARROWBAND)
return "Speex Narrowband";
if($codec == TeamSpeak3::CODEC_SPEEX_WIDEBAND)
return "Speex Wideband";
if($codec == TeamSpeak3::CODEC_SPEEX_ULTRAWIDEBAND)
return "Speex Ultra-Wideband";
if($codec == TeamSpeak3::CODEC_CELT_MONO)
return "CELT Mono";
if($codec == TeamSpeak3::CODEC_OPUS_VOICE)
return "Opus Voice";
if($codec == TeamSpeak3::CODEC_OPUS_MUSIC)
return "Opus Music";
return "Unknown";
} | php | public static function codec($codec)
{
if($codec == TeamSpeak3::CODEC_SPEEX_NARROWBAND)
return "Speex Narrowband";
if($codec == TeamSpeak3::CODEC_SPEEX_WIDEBAND)
return "Speex Wideband";
if($codec == TeamSpeak3::CODEC_SPEEX_ULTRAWIDEBAND)
return "Speex Ultra-Wideband";
if($codec == TeamSpeak3::CODEC_CELT_MONO)
return "CELT Mono";
if($codec == TeamSpeak3::CODEC_OPUS_VOICE)
return "Opus Voice";
if($codec == TeamSpeak3::CODEC_OPUS_MUSIC)
return "Opus Music";
return "Unknown";
} | [
"public",
"static",
"function",
"codec",
"(",
"$",
"codec",
")",
"{",
"if",
"(",
"$",
"codec",
"==",
"TeamSpeak3",
"::",
"CODEC_SPEEX_NARROWBAND",
")",
"return",
"\"Speex Narrowband\"",
";",
"if",
"(",
"$",
"codec",
"==",
"TeamSpeak3",
"::",
"CODEC_SPEEX_WIDEB... | Converts a given codec ID to a human readable name.
@param integer $codec
@return string | [
"Converts",
"a",
"given",
"codec",
"ID",
"to",
"a",
"human",
"readable",
"name",
"."
] | train | https://github.com/planetteamspeak/ts3phpframework/blob/82ed6edc261547099c916a59f624caf5daa68035/libraries/TeamSpeak3/Helper/Convert.php#L83-L99 |
planetteamspeak/ts3phpframework | libraries/TeamSpeak3/Helper/Convert.php | TeamSpeak3_Helper_Convert.groupType | public static function groupType($type)
{
if($type == TeamSpeak3::GROUP_DBTYPE_TEMPLATE)
return "Template";
if($type == TeamSpeak3::GROUP_DBTYPE_REGULAR)
return "Regular";
if($type == TeamSpeak3::GROUP_DBTYPE_SERVERQUERY)
return "ServerQuery";
return "Unknown";
} | php | public static function groupType($type)
{
if($type == TeamSpeak3::GROUP_DBTYPE_TEMPLATE)
return "Template";
if($type == TeamSpeak3::GROUP_DBTYPE_REGULAR)
return "Regular";
if($type == TeamSpeak3::GROUP_DBTYPE_SERVERQUERY)
return "ServerQuery";
return "Unknown";
} | [
"public",
"static",
"function",
"groupType",
"(",
"$",
"type",
")",
"{",
"if",
"(",
"$",
"type",
"==",
"TeamSpeak3",
"::",
"GROUP_DBTYPE_TEMPLATE",
")",
"return",
"\"Template\"",
";",
"if",
"(",
"$",
"type",
"==",
"TeamSpeak3",
"::",
"GROUP_DBTYPE_REGULAR",
... | Converts a given group type ID to a human readable name.
@param integer $type
@return string | [
"Converts",
"a",
"given",
"group",
"type",
"ID",
"to",
"a",
"human",
"readable",
"name",
"."
] | train | https://github.com/planetteamspeak/ts3phpframework/blob/82ed6edc261547099c916a59f624caf5daa68035/libraries/TeamSpeak3/Helper/Convert.php#L107-L117 |
planetteamspeak/ts3phpframework | libraries/TeamSpeak3/Helper/Convert.php | TeamSpeak3_Helper_Convert.permissionCategory | public static function permissionCategory($pcat)
{
if($pcat == TeamSpeak3::PERM_CAT_GLOBAL)
return "Global";
if($pcat == TeamSpeak3::PERM_CAT_GLOBAL_INFORMATION)
return "Global / Information";
if($pcat == TeamSpeak3::PERM_CAT_GLOBAL_SERVER_MGMT)
return "Global / Virtual Server Management";
if($pcat == TeamSpeak3::PERM_CAT_GLOBAL_ADM_ACTIONS)
return "Global / Administration";
if($pcat == TeamSpeak3::PERM_CAT_GLOBAL_SETTINGS)
return "Global / Settings";
if($pcat == TeamSpeak3::PERM_CAT_SERVER)
return "Virtual Server";
if($pcat == TeamSpeak3::PERM_CAT_SERVER_INFORMATION)
return "Virtual Server / Information";
if($pcat == TeamSpeak3::PERM_CAT_SERVER_ADM_ACTIONS)
return "Virtual Server / Administration";
if($pcat == TeamSpeak3::PERM_CAT_SERVER_SETTINGS)
return "Virtual Server / Settings";
if($pcat == TeamSpeak3::PERM_CAT_CHANNEL)
return "Channel";
if($pcat == TeamSpeak3::PERM_CAT_CHANNEL_INFORMATION)
return "Channel / Information";
if($pcat == TeamSpeak3::PERM_CAT_CHANNEL_CREATE)
return "Channel / Create";
if($pcat == TeamSpeak3::PERM_CAT_CHANNEL_MODIFY)
return "Channel / Modify";
if($pcat == TeamSpeak3::PERM_CAT_CHANNEL_DELETE)
return "Channel / Delete";
if($pcat == TeamSpeak3::PERM_CAT_CHANNEL_ACCESS)
return "Channel / Access";
if($pcat == TeamSpeak3::PERM_CAT_GROUP)
return "Group";
if($pcat == TeamSpeak3::PERM_CAT_GROUP_INFORMATION)
return "Group / Information";
if($pcat == TeamSpeak3::PERM_CAT_GROUP_CREATE)
return "Group / Create";
if($pcat == TeamSpeak3::PERM_CAT_GROUP_MODIFY)
return "Group / Modify";
if($pcat == TeamSpeak3::PERM_CAT_GROUP_DELETE)
return "Group / Delete";
if($pcat == TeamSpeak3::PERM_CAT_CLIENT)
return "Client";
if($pcat == TeamSpeak3::PERM_CAT_CLIENT_INFORMATION)
return "Client / Information";
if($pcat == TeamSpeak3::PERM_CAT_CLIENT_ADM_ACTIONS)
return "Client / Admin";
if($pcat == TeamSpeak3::PERM_CAT_CLIENT_BASICS)
return "Client / Basics";
if($pcat == TeamSpeak3::PERM_CAT_CLIENT_MODIFY)
return "Client / Modify";
if($pcat == TeamSpeak3::PERM_CAT_FILETRANSFER)
return "File Transfer";
if($pcat == TeamSpeak3::PERM_CAT_NEEDED_MODIFY_POWER)
return "Grant";
return "Unknown";
} | php | public static function permissionCategory($pcat)
{
if($pcat == TeamSpeak3::PERM_CAT_GLOBAL)
return "Global";
if($pcat == TeamSpeak3::PERM_CAT_GLOBAL_INFORMATION)
return "Global / Information";
if($pcat == TeamSpeak3::PERM_CAT_GLOBAL_SERVER_MGMT)
return "Global / Virtual Server Management";
if($pcat == TeamSpeak3::PERM_CAT_GLOBAL_ADM_ACTIONS)
return "Global / Administration";
if($pcat == TeamSpeak3::PERM_CAT_GLOBAL_SETTINGS)
return "Global / Settings";
if($pcat == TeamSpeak3::PERM_CAT_SERVER)
return "Virtual Server";
if($pcat == TeamSpeak3::PERM_CAT_SERVER_INFORMATION)
return "Virtual Server / Information";
if($pcat == TeamSpeak3::PERM_CAT_SERVER_ADM_ACTIONS)
return "Virtual Server / Administration";
if($pcat == TeamSpeak3::PERM_CAT_SERVER_SETTINGS)
return "Virtual Server / Settings";
if($pcat == TeamSpeak3::PERM_CAT_CHANNEL)
return "Channel";
if($pcat == TeamSpeak3::PERM_CAT_CHANNEL_INFORMATION)
return "Channel / Information";
if($pcat == TeamSpeak3::PERM_CAT_CHANNEL_CREATE)
return "Channel / Create";
if($pcat == TeamSpeak3::PERM_CAT_CHANNEL_MODIFY)
return "Channel / Modify";
if($pcat == TeamSpeak3::PERM_CAT_CHANNEL_DELETE)
return "Channel / Delete";
if($pcat == TeamSpeak3::PERM_CAT_CHANNEL_ACCESS)
return "Channel / Access";
if($pcat == TeamSpeak3::PERM_CAT_GROUP)
return "Group";
if($pcat == TeamSpeak3::PERM_CAT_GROUP_INFORMATION)
return "Group / Information";
if($pcat == TeamSpeak3::PERM_CAT_GROUP_CREATE)
return "Group / Create";
if($pcat == TeamSpeak3::PERM_CAT_GROUP_MODIFY)
return "Group / Modify";
if($pcat == TeamSpeak3::PERM_CAT_GROUP_DELETE)
return "Group / Delete";
if($pcat == TeamSpeak3::PERM_CAT_CLIENT)
return "Client";
if($pcat == TeamSpeak3::PERM_CAT_CLIENT_INFORMATION)
return "Client / Information";
if($pcat == TeamSpeak3::PERM_CAT_CLIENT_ADM_ACTIONS)
return "Client / Admin";
if($pcat == TeamSpeak3::PERM_CAT_CLIENT_BASICS)
return "Client / Basics";
if($pcat == TeamSpeak3::PERM_CAT_CLIENT_MODIFY)
return "Client / Modify";
if($pcat == TeamSpeak3::PERM_CAT_FILETRANSFER)
return "File Transfer";
if($pcat == TeamSpeak3::PERM_CAT_NEEDED_MODIFY_POWER)
return "Grant";
return "Unknown";
} | [
"public",
"static",
"function",
"permissionCategory",
"(",
"$",
"pcat",
")",
"{",
"if",
"(",
"$",
"pcat",
"==",
"TeamSpeak3",
"::",
"PERM_CAT_GLOBAL",
")",
"return",
"\"Global\"",
";",
"if",
"(",
"$",
"pcat",
"==",
"TeamSpeak3",
"::",
"PERM_CAT_GLOBAL_INFORMAT... | Converts a given permission category value to a human readable name.
@param integer $pcat
@return string | [
"Converts",
"a",
"given",
"permission",
"category",
"value",
"to",
"a",
"human",
"readable",
"name",
"."
] | train | https://github.com/planetteamspeak/ts3phpframework/blob/82ed6edc261547099c916a59f624caf5daa68035/libraries/TeamSpeak3/Helper/Convert.php#L147-L205 |
planetteamspeak/ts3phpframework | libraries/TeamSpeak3/Helper/Convert.php | TeamSpeak3_Helper_Convert.logLevel | public static function logLevel($level)
{
if(is_numeric($level))
{
if($level == TeamSpeak3::LOGLEVEL_CRITICAL)
return "CRITICAL";
if($level == TeamSpeak3::LOGLEVEL_ERROR)
return "ERROR";
if($level == TeamSpeak3::LOGLEVEL_DEBUG)
return "DEBUG";
if($level == TeamSpeak3::LOGLEVEL_WARNING)
return "WARNING";
if($level == TeamSpeak3::LOGLEVEL_INFO)
return "INFO";
return "DEVELOP";
}
else
{
if(strtoupper($level) == "CRITICAL")
return TeamSpeak3::LOGLEVEL_CRITICAL;
if(strtoupper($level) == "ERROR")
return TeamSpeak3::LOGLEVEL_ERROR;
if(strtoupper($level) == "DEBUG")
return TeamSpeak3::LOGLEVEL_DEBUG;
if(strtoupper($level) == "WARNING")
return TeamSpeak3::LOGLEVEL_WARNING;
if(strtoupper($level) == "INFO")
return TeamSpeak3::LOGLEVEL_INFO;
return TeamSpeak3::LOGLEVEL_DEVEL;
}
} | php | public static function logLevel($level)
{
if(is_numeric($level))
{
if($level == TeamSpeak3::LOGLEVEL_CRITICAL)
return "CRITICAL";
if($level == TeamSpeak3::LOGLEVEL_ERROR)
return "ERROR";
if($level == TeamSpeak3::LOGLEVEL_DEBUG)
return "DEBUG";
if($level == TeamSpeak3::LOGLEVEL_WARNING)
return "WARNING";
if($level == TeamSpeak3::LOGLEVEL_INFO)
return "INFO";
return "DEVELOP";
}
else
{
if(strtoupper($level) == "CRITICAL")
return TeamSpeak3::LOGLEVEL_CRITICAL;
if(strtoupper($level) == "ERROR")
return TeamSpeak3::LOGLEVEL_ERROR;
if(strtoupper($level) == "DEBUG")
return TeamSpeak3::LOGLEVEL_DEBUG;
if(strtoupper($level) == "WARNING")
return TeamSpeak3::LOGLEVEL_WARNING;
if(strtoupper($level) == "INFO")
return TeamSpeak3::LOGLEVEL_INFO;
return TeamSpeak3::LOGLEVEL_DEVEL;
}
} | [
"public",
"static",
"function",
"logLevel",
"(",
"$",
"level",
")",
"{",
"if",
"(",
"is_numeric",
"(",
"$",
"level",
")",
")",
"{",
"if",
"(",
"$",
"level",
"==",
"TeamSpeak3",
"::",
"LOGLEVEL_CRITICAL",
")",
"return",
"\"CRITICAL\"",
";",
"if",
"(",
"... | Converts a given log level ID to a human readable name and vice versa.
@param mixed $level
@return string | [
"Converts",
"a",
"given",
"log",
"level",
"ID",
"to",
"a",
"human",
"readable",
"name",
"and",
"vice",
"versa",
"."
] | train | https://github.com/planetteamspeak/ts3phpframework/blob/82ed6edc261547099c916a59f624caf5daa68035/libraries/TeamSpeak3/Helper/Convert.php#L213-L245 |
planetteamspeak/ts3phpframework | libraries/TeamSpeak3/Helper/Convert.php | TeamSpeak3_Helper_Convert.version | public static function version($version, $format = "Y-m-d h:i:s")
{
if(!$version instanceof TeamSpeak3_Helper_String)
{
$version = new TeamSpeak3_Helper_String($version);
}
$buildno = $version->section("[", 1)->filterDigits()->toInt();
return ($buildno <= 15001) ? $version : $version->section("[")->append("(" . date($format, $buildno) . ")");
} | php | public static function version($version, $format = "Y-m-d h:i:s")
{
if(!$version instanceof TeamSpeak3_Helper_String)
{
$version = new TeamSpeak3_Helper_String($version);
}
$buildno = $version->section("[", 1)->filterDigits()->toInt();
return ($buildno <= 15001) ? $version : $version->section("[")->append("(" . date($format, $buildno) . ")");
} | [
"public",
"static",
"function",
"version",
"(",
"$",
"version",
",",
"$",
"format",
"=",
"\"Y-m-d h:i:s\"",
")",
"{",
"if",
"(",
"!",
"$",
"version",
"instanceof",
"TeamSpeak3_Helper_String",
")",
"{",
"$",
"version",
"=",
"new",
"TeamSpeak3_Helper_String",
"(... | Returns a client-like formatted version of the TeamSpeak 3 version string.
@param string $version
@param string $format
@return string | [
"Returns",
"a",
"client",
"-",
"like",
"formatted",
"version",
"of",
"the",
"TeamSpeak",
"3",
"version",
"string",
"."
] | train | https://github.com/planetteamspeak/ts3phpframework/blob/82ed6edc261547099c916a59f624caf5daa68035/libraries/TeamSpeak3/Helper/Convert.php#L318-L328 |
planetteamspeak/ts3phpframework | libraries/TeamSpeak3/Viewer/Html.php | TeamSpeak3_Viewer_Html.fetchObject | public function fetchObject(TeamSpeak3_Node_Abstract $node, array $siblings = array())
{
$this->currObj = $node;
$this->currSib = $siblings;
$args = array(
$this->getContainerIdent(),
$this->getContainerClass(),
$this->getContainerSummary(),
$this->getRowClass(),
$this->getPrefixClass(),
$this->getPrefix(),
$this->getCorpusClass(),
$this->getCorpusTitle(),
$this->getCorpusIcon(),
$this->getCorpusName(),
$this->getSuffixClass(),
$this->getSuffixIcon(),
$this->getSuffixFlag(),
);
return TeamSpeak3_Helper_String::factory($this->pattern)->arg($args);
} | php | public function fetchObject(TeamSpeak3_Node_Abstract $node, array $siblings = array())
{
$this->currObj = $node;
$this->currSib = $siblings;
$args = array(
$this->getContainerIdent(),
$this->getContainerClass(),
$this->getContainerSummary(),
$this->getRowClass(),
$this->getPrefixClass(),
$this->getPrefix(),
$this->getCorpusClass(),
$this->getCorpusTitle(),
$this->getCorpusIcon(),
$this->getCorpusName(),
$this->getSuffixClass(),
$this->getSuffixIcon(),
$this->getSuffixFlag(),
);
return TeamSpeak3_Helper_String::factory($this->pattern)->arg($args);
} | [
"public",
"function",
"fetchObject",
"(",
"TeamSpeak3_Node_Abstract",
"$",
"node",
",",
"array",
"$",
"siblings",
"=",
"array",
"(",
")",
")",
"{",
"$",
"this",
"->",
"currObj",
"=",
"$",
"node",
";",
"$",
"this",
"->",
"currSib",
"=",
"$",
"siblings",
... | Returns the code needed to display a node in a TeamSpeak 3 viewer.
@param TeamSpeak3_Node_Abstract $node
@param array $siblings
@return string | [
"Returns",
"the",
"code",
"needed",
"to",
"display",
"a",
"node",
"in",
"a",
"TeamSpeak",
"3",
"viewer",
"."
] | train | https://github.com/planetteamspeak/ts3phpframework/blob/82ed6edc261547099c916a59f624caf5daa68035/libraries/TeamSpeak3/Viewer/Html.php#L123-L145 |
planetteamspeak/ts3phpframework | libraries/TeamSpeak3/Viewer/Html.php | TeamSpeak3_Viewer_Html.getPrefix | protected function getPrefix()
{
$prefix = "";
if(count($this->currSib))
{
$last = array_pop($this->currSib);
foreach($this->currSib as $sibling)
{
$prefix .= ($sibling) ? $this->getImage("tree_line.gif") : $this->getImage("tree_blank.png");
}
$prefix .= ($last) ? $this->getImage("tree_end.gif") : $this->getImage("tree_mid.gif");
}
return $prefix;
} | php | protected function getPrefix()
{
$prefix = "";
if(count($this->currSib))
{
$last = array_pop($this->currSib);
foreach($this->currSib as $sibling)
{
$prefix .= ($sibling) ? $this->getImage("tree_line.gif") : $this->getImage("tree_blank.png");
}
$prefix .= ($last) ? $this->getImage("tree_end.gif") : $this->getImage("tree_mid.gif");
}
return $prefix;
} | [
"protected",
"function",
"getPrefix",
"(",
")",
"{",
"$",
"prefix",
"=",
"\"\"",
";",
"if",
"(",
"count",
"(",
"$",
"this",
"->",
"currSib",
")",
")",
"{",
"$",
"last",
"=",
"array_pop",
"(",
"$",
"this",
"->",
"currSib",
")",
";",
"foreach",
"(",
... | Returns the HTML img tags to display the prefix of the current node.
@return string | [
"Returns",
"the",
"HTML",
"img",
"tags",
"to",
"display",
"the",
"prefix",
"of",
"the",
"current",
"node",
"."
] | train | https://github.com/planetteamspeak/ts3phpframework/blob/82ed6edc261547099c916a59f624caf5daa68035/libraries/TeamSpeak3/Viewer/Html.php#L207-L224 |
planetteamspeak/ts3phpframework | libraries/TeamSpeak3/Viewer/Html.php | TeamSpeak3_Viewer_Html.getCorpusTitle | protected function getCorpusTitle()
{
if($this->currObj instanceof TeamSpeak3_Node_Server)
{
return "ID: " . $this->currObj->getId() . " | Clients: " . $this->currObj->clientCount() . "/" . $this->currObj["virtualserver_maxclients"] . " | Uptime: " . TeamSpeak3_Helper_Convert::seconds($this->currObj["virtualserver_uptime"]);
}
elseif($this->currObj instanceof TeamSpeak3_Node_Channel && !$this->currObj->isSpacer())
{
return "ID: " . $this->currObj->getId() . " | Codec: " . TeamSpeak3_Helper_Convert::codec($this->currObj["channel_codec"]) . " | Quality: " . $this->currObj["channel_codec_quality"];
}
elseif($this->currObj instanceof TeamSpeak3_Node_Client)
{
return "ID: " . $this->currObj->getId() . " | Version: " . TeamSpeak3_Helper_Convert::versionShort($this->currObj["client_version"]) . " | Platform: " . $this->currObj["client_platform"];
}
elseif($this->currObj instanceof TeamSpeak3_Node_Servergroup || $this->currObj instanceof TeamSpeak3_Node_Channelgroup)
{
return "ID: " . $this->currObj->getId() . " | Type: " . TeamSpeak3_Helper_Convert::groupType($this->currObj["type"]) . " (" . ($this->currObj["savedb"] ? "Permanent" : "Temporary") . ")";
}
} | php | protected function getCorpusTitle()
{
if($this->currObj instanceof TeamSpeak3_Node_Server)
{
return "ID: " . $this->currObj->getId() . " | Clients: " . $this->currObj->clientCount() . "/" . $this->currObj["virtualserver_maxclients"] . " | Uptime: " . TeamSpeak3_Helper_Convert::seconds($this->currObj["virtualserver_uptime"]);
}
elseif($this->currObj instanceof TeamSpeak3_Node_Channel && !$this->currObj->isSpacer())
{
return "ID: " . $this->currObj->getId() . " | Codec: " . TeamSpeak3_Helper_Convert::codec($this->currObj["channel_codec"]) . " | Quality: " . $this->currObj["channel_codec_quality"];
}
elseif($this->currObj instanceof TeamSpeak3_Node_Client)
{
return "ID: " . $this->currObj->getId() . " | Version: " . TeamSpeak3_Helper_Convert::versionShort($this->currObj["client_version"]) . " | Platform: " . $this->currObj["client_platform"];
}
elseif($this->currObj instanceof TeamSpeak3_Node_Servergroup || $this->currObj instanceof TeamSpeak3_Node_Channelgroup)
{
return "ID: " . $this->currObj->getId() . " | Type: " . TeamSpeak3_Helper_Convert::groupType($this->currObj["type"]) . " (" . ($this->currObj["savedb"] ? "Permanent" : "Temporary") . ")";
}
} | [
"protected",
"function",
"getCorpusTitle",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"currObj",
"instanceof",
"TeamSpeak3_Node_Server",
")",
"{",
"return",
"\"ID: \"",
".",
"$",
"this",
"->",
"currObj",
"->",
"getId",
"(",
")",
".",
"\" | Clients: \"",
".... | Returns the HTML img tags which can be used to display the various icons for a
TeamSpeak_Node_Abstract object.
@return string | [
"Returns",
"the",
"HTML",
"img",
"tags",
"which",
"can",
"be",
"used",
"to",
"display",
"the",
"various",
"icons",
"for",
"a",
"TeamSpeak_Node_Abstract",
"object",
"."
] | train | https://github.com/planetteamspeak/ts3phpframework/blob/82ed6edc261547099c916a59f624caf5daa68035/libraries/TeamSpeak3/Viewer/Html.php#L291-L309 |
planetteamspeak/ts3phpframework | libraries/TeamSpeak3/Viewer/Html.php | TeamSpeak3_Viewer_Html.getSuffixIcon | protected function getSuffixIcon()
{
if($this->currObj instanceof TeamSpeak3_Node_Server)
{
return $this->getSuffixIconServer();
}
elseif($this->currObj instanceof TeamSpeak3_Node_Channel)
{
return $this->getSuffixIconChannel();
}
elseif($this->currObj instanceof TeamSpeak3_Node_Client)
{
return $this->getSuffixIconClient();
}
} | php | protected function getSuffixIcon()
{
if($this->currObj instanceof TeamSpeak3_Node_Server)
{
return $this->getSuffixIconServer();
}
elseif($this->currObj instanceof TeamSpeak3_Node_Channel)
{
return $this->getSuffixIconChannel();
}
elseif($this->currObj instanceof TeamSpeak3_Node_Client)
{
return $this->getSuffixIconClient();
}
} | [
"protected",
"function",
"getSuffixIcon",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"currObj",
"instanceof",
"TeamSpeak3_Node_Server",
")",
"{",
"return",
"$",
"this",
"->",
"getSuffixIconServer",
"(",
")",
";",
"}",
"elseif",
"(",
"$",
"this",
"->",
"c... | Returns the HTML img tags which can be used to display the various icons for a
TeamSpeak_Node_Abstract object.
@return string | [
"Returns",
"the",
"HTML",
"img",
"tags",
"which",
"can",
"be",
"used",
"to",
"display",
"the",
"various",
"icons",
"for",
"a",
"TeamSpeak_Node_Abstract",
"object",
"."
] | train | https://github.com/planetteamspeak/ts3phpframework/blob/82ed6edc261547099c916a59f624caf5daa68035/libraries/TeamSpeak3/Viewer/Html.php#L394-L408 |
planetteamspeak/ts3phpframework | libraries/TeamSpeak3/Viewer/Html.php | TeamSpeak3_Viewer_Html.getSuffixFlag | protected function getSuffixFlag()
{
if(!$this->currObj instanceof TeamSpeak3_Node_Client) return;
if($this->flagpath && $this->currObj["client_country"])
{
return $this->getImage($this->currObj["client_country"]->toLower() . ".png", $this->currObj["client_country"], null, FALSE, TRUE);
}
} | php | protected function getSuffixFlag()
{
if(!$this->currObj instanceof TeamSpeak3_Node_Client) return;
if($this->flagpath && $this->currObj["client_country"])
{
return $this->getImage($this->currObj["client_country"]->toLower() . ".png", $this->currObj["client_country"], null, FALSE, TRUE);
}
} | [
"protected",
"function",
"getSuffixFlag",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"currObj",
"instanceof",
"TeamSpeak3_Node_Client",
")",
"return",
";",
"if",
"(",
"$",
"this",
"->",
"flagpath",
"&&",
"$",
"this",
"->",
"currObj",
"[",
"\"client_... | Returns a HTML img tag which can be used to display the country flag for a
TeamSpeak_Node_Client object.
@return string | [
"Returns",
"a",
"HTML",
"img",
"tag",
"which",
"can",
"be",
"used",
"to",
"display",
"the",
"country",
"flag",
"for",
"a",
"TeamSpeak_Node_Client",
"object",
"."
] | train | https://github.com/planetteamspeak/ts3phpframework/blob/82ed6edc261547099c916a59f624caf5daa68035/libraries/TeamSpeak3/Viewer/Html.php#L643-L651 |
planetteamspeak/ts3phpframework | libraries/TeamSpeak3/Viewer/Html.php | TeamSpeak3_Viewer_Html.getImage | 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 . "' title='" . $text . "' alt='' align='top' />";
} | php | 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 . "' title='" . $text . "' alt='' align='top' />";
} | [
"protected",
"function",
"getImage",
"(",
"$",
"name",
",",
"$",
"text",
"=",
"\"\"",
",",
"$",
"class",
"=",
"null",
",",
"$",
"iconpath",
"=",
"TRUE",
",",
"$",
"flagpath",
"=",
"FALSE",
")",
"{",
"$",
"src",
"=",
"\"\"",
";",
"if",
"(",
"$",
... | Returns the code to display a custom HTML img tag.
@param string $name
@param string $text
@param string $class
@param boolean $iconpath
@param boolean $flagpath
@return string | [
"Returns",
"the",
"code",
"to",
"display",
"a",
"custom",
"HTML",
"img",
"tag",
"."
] | train | https://github.com/planetteamspeak/ts3phpframework/blob/82ed6edc261547099c916a59f624caf5daa68035/libraries/TeamSpeak3/Viewer/Html.php#L663-L678 |
planetteamspeak/ts3phpframework | libraries/TeamSpeak3/Helper/Crypt.php | TeamSpeak3_Helper_Crypt.encrypt | public function encrypt($string)
{
$string = trim($string);
$encryp = "";
$length = strlen($string);
$string .= str_repeat(chr(0), (8-($length%8))%8);
for($i = 0; $i < $length; $i += 8)
{
list(,$xl,$xr) = unpack("N2", substr($string, $i, 8));
$this->encipher($xl, $xr);
$encryp .= pack("N2", $xl, $xr);
}
return base64_encode($encryp);
} | php | public function encrypt($string)
{
$string = trim($string);
$encryp = "";
$length = strlen($string);
$string .= str_repeat(chr(0), (8-($length%8))%8);
for($i = 0; $i < $length; $i += 8)
{
list(,$xl,$xr) = unpack("N2", substr($string, $i, 8));
$this->encipher($xl, $xr);
$encryp .= pack("N2", $xl, $xr);
}
return base64_encode($encryp);
} | [
"public",
"function",
"encrypt",
"(",
"$",
"string",
")",
"{",
"$",
"string",
"=",
"trim",
"(",
"$",
"string",
")",
";",
"$",
"encryp",
"=",
"\"\"",
";",
"$",
"length",
"=",
"strlen",
"(",
"$",
"string",
")",
";",
"$",
"string",
".=",
"str_repeat",... | Encrypts a given string.
@param string $string
@return string | [
"Encrypts",
"a",
"given",
"string",
"."
] | train | https://github.com/planetteamspeak/ts3phpframework/blob/82ed6edc261547099c916a59f624caf5daa68035/libraries/TeamSpeak3/Helper/Crypt.php#L72-L87 |
planetteamspeak/ts3phpframework | libraries/TeamSpeak3/Helper/Crypt.php | TeamSpeak3_Helper_Crypt.decrypt | public function decrypt($string)
{
$string = base64_decode($string);
$decryp = "";
$length = strlen($string);
$string .= str_repeat(chr(0), (8-($length%8))%8);
for($i = 0; $i < $length; $i += 8)
{
list(,$xl,$xr) = unpack("N2", substr($string, $i, 8));
$this->decipher($xl, $xr);
$decryp .= pack("N2", $xl, $xr);
}
return trim($decryp);
} | php | public function decrypt($string)
{
$string = base64_decode($string);
$decryp = "";
$length = strlen($string);
$string .= str_repeat(chr(0), (8-($length%8))%8);
for($i = 0; $i < $length; $i += 8)
{
list(,$xl,$xr) = unpack("N2", substr($string, $i, 8));
$this->decipher($xl, $xr);
$decryp .= pack("N2", $xl, $xr);
}
return trim($decryp);
} | [
"public",
"function",
"decrypt",
"(",
"$",
"string",
")",
"{",
"$",
"string",
"=",
"base64_decode",
"(",
"$",
"string",
")",
";",
"$",
"decryp",
"=",
"\"\"",
";",
"$",
"length",
"=",
"strlen",
"(",
"$",
"string",
")",
";",
"$",
"string",
".=",
"str... | Decrypts a given string.
@param string $string
@return string | [
"Decrypts",
"a",
"given",
"string",
"."
] | train | https://github.com/planetteamspeak/ts3phpframework/blob/82ed6edc261547099c916a59f624caf5daa68035/libraries/TeamSpeak3/Helper/Crypt.php#L95-L110 |
planetteamspeak/ts3phpframework | libraries/TeamSpeak3/Helper/Crypt.php | TeamSpeak3_Helper_Crypt.encipher | protected function encipher(&$xl, &$xr)
{
for($i = 0; $i < 16; $i++)
{
$temp = $xl ^ $this->p[$i];
$xl = ((($this->s[0][($temp>>24) & 255] + $this->s[1][($temp>>16) & 255]) ^ $this->s[2][($temp>>8) & 255]) + $this->s[3][$temp & 255]) ^ $xr;
$xr = $temp;
}
$xr = $xl ^ $this->p[16];
$xl = $temp ^ $this->p[17];
} | php | protected function encipher(&$xl, &$xr)
{
for($i = 0; $i < 16; $i++)
{
$temp = $xl ^ $this->p[$i];
$xl = ((($this->s[0][($temp>>24) & 255] + $this->s[1][($temp>>16) & 255]) ^ $this->s[2][($temp>>8) & 255]) + $this->s[3][$temp & 255]) ^ $xr;
$xr = $temp;
}
$xr = $xl ^ $this->p[16];
$xl = $temp ^ $this->p[17];
} | [
"protected",
"function",
"encipher",
"(",
"&",
"$",
"xl",
",",
"&",
"$",
"xr",
")",
"{",
"for",
"(",
"$",
"i",
"=",
"0",
";",
"$",
"i",
"<",
"16",
";",
"$",
"i",
"++",
")",
"{",
"$",
"temp",
"=",
"$",
"xl",
"^",
"$",
"this",
"->",
"p",
... | Enciphers a single 64-bit block.
@param integer $xl
@param integer $xr | [
"Enciphers",
"a",
"single",
"64",
"-",
"bit",
"block",
"."
] | train | https://github.com/planetteamspeak/ts3phpframework/blob/82ed6edc261547099c916a59f624caf5daa68035/libraries/TeamSpeak3/Helper/Crypt.php#L118-L129 |
planetteamspeak/ts3phpframework | libraries/TeamSpeak3/Helper/Crypt.php | TeamSpeak3_Helper_Crypt.decipher | protected function decipher(&$xl, &$xr)
{
for($i = 17; $i > 1; $i--)
{
$temp = $xl ^ $this->p[$i];
$xl = ((($this->s[0][($temp>>24) & 255] + $this->s[1][($temp>>16) & 255]) ^ $this->s[2][($temp>>8) & 255]) + $this->s[3][$temp & 255]) ^ $xr;
$xr = $temp;
}
$xr = $xl ^ $this->p[1];
$xl = $temp ^ $this->p[0];
} | php | protected function decipher(&$xl, &$xr)
{
for($i = 17; $i > 1; $i--)
{
$temp = $xl ^ $this->p[$i];
$xl = ((($this->s[0][($temp>>24) & 255] + $this->s[1][($temp>>16) & 255]) ^ $this->s[2][($temp>>8) & 255]) + $this->s[3][$temp & 255]) ^ $xr;
$xr = $temp;
}
$xr = $xl ^ $this->p[1];
$xl = $temp ^ $this->p[0];
} | [
"protected",
"function",
"decipher",
"(",
"&",
"$",
"xl",
",",
"&",
"$",
"xr",
")",
"{",
"for",
"(",
"$",
"i",
"=",
"17",
";",
"$",
"i",
">",
"1",
";",
"$",
"i",
"--",
")",
"{",
"$",
"temp",
"=",
"$",
"xl",
"^",
"$",
"this",
"->",
"p",
... | Deciphers a single 64-bit block
@param integer $xl
@param integer $xr
@return void | [
"Deciphers",
"a",
"single",
"64",
"-",
"bit",
"block"
] | train | https://github.com/planetteamspeak/ts3phpframework/blob/82ed6edc261547099c916a59f624caf5daa68035/libraries/TeamSpeak3/Helper/Crypt.php#L138-L149 |
planetteamspeak/ts3phpframework | libraries/TeamSpeak3/Node/Host.php | TeamSpeak3_Node_Host.version | public function version($ident = null)
{
if($this->version === null)
{
$this->version = $this->request("version")->toList();
}
return ($ident && isset($this->version[$ident])) ? $this->version[$ident] : $this->version;
} | php | public function version($ident = null)
{
if($this->version === null)
{
$this->version = $this->request("version")->toList();
}
return ($ident && isset($this->version[$ident])) ? $this->version[$ident] : $this->version;
} | [
"public",
"function",
"version",
"(",
"$",
"ident",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"version",
"===",
"null",
")",
"{",
"$",
"this",
"->",
"version",
"=",
"$",
"this",
"->",
"request",
"(",
"\"version\"",
")",
"->",
"toList",
"... | Returns the servers version information including platform and build number.
@param string $ident
@return mixed | [
"Returns",
"the",
"servers",
"version",
"information",
"including",
"platform",
"and",
"build",
"number",
"."
] | train | https://github.com/planetteamspeak/ts3phpframework/blob/82ed6edc261547099c916a59f624caf5daa68035/libraries/TeamSpeak3/Node/Host.php#L118-L126 |
planetteamspeak/ts3phpframework | libraries/TeamSpeak3/Node/Host.php | TeamSpeak3_Node_Host.serverGetPortById | public function serverGetPortById($sid)
{
if(!array_key_exists((string) $sid, $this->serverList()))
{
throw new TeamSpeak3_Adapter_ServerQuery_Exception("invalid serverID", 0x400);
}
return $this->serverList[intval((string) $sid)]["virtualserver_port"];
} | php | public function serverGetPortById($sid)
{
if(!array_key_exists((string) $sid, $this->serverList()))
{
throw new TeamSpeak3_Adapter_ServerQuery_Exception("invalid serverID", 0x400);
}
return $this->serverList[intval((string) $sid)]["virtualserver_port"];
} | [
"public",
"function",
"serverGetPortById",
"(",
"$",
"sid",
")",
"{",
"if",
"(",
"!",
"array_key_exists",
"(",
"(",
"string",
")",
"$",
"sid",
",",
"$",
"this",
"->",
"serverList",
"(",
")",
")",
")",
"{",
"throw",
"new",
"TeamSpeak3_Adapter_ServerQuery_Ex... | Returns the port of a virtual server matching the given ID.
@param integer $sid
@return integer | [
"Returns",
"the",
"port",
"of",
"a",
"virtual",
"server",
"matching",
"the",
"given",
"ID",
"."
] | train | https://github.com/planetteamspeak/ts3phpframework/blob/82ed6edc261547099c916a59f624caf5daa68035/libraries/TeamSpeak3/Node/Host.php#L243-L251 |
planetteamspeak/ts3phpframework | libraries/TeamSpeak3/Node/Host.php | TeamSpeak3_Node_Host.serverGetByName | public function serverGetByName($name)
{
foreach($this->serverList() as $server)
{
if($server["virtualserver_name"] == $name) return $server;
}
throw new TeamSpeak3_Adapter_ServerQuery_Exception("invalid serverID", 0x400);
} | php | public function serverGetByName($name)
{
foreach($this->serverList() as $server)
{
if($server["virtualserver_name"] == $name) return $server;
}
throw new TeamSpeak3_Adapter_ServerQuery_Exception("invalid serverID", 0x400);
} | [
"public",
"function",
"serverGetByName",
"(",
"$",
"name",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"serverList",
"(",
")",
"as",
"$",
"server",
")",
"{",
"if",
"(",
"$",
"server",
"[",
"\"virtualserver_name\"",
"]",
"==",
"$",
"name",
")",
"return... | Returns the first TeamSpeak3_Node_Server object matching the given name.
@param string $name
@throws TeamSpeak3_Adapter_ServerQuery_Exception
@return TeamSpeak3_Node_Server | [
"Returns",
"the",
"first",
"TeamSpeak3_Node_Server",
"object",
"matching",
"the",
"given",
"name",
"."
] | train | https://github.com/planetteamspeak/ts3phpframework/blob/82ed6edc261547099c916a59f624caf5daa68035/libraries/TeamSpeak3/Node/Host.php#L296-L304 |
planetteamspeak/ts3phpframework | libraries/TeamSpeak3/Node/Host.php | TeamSpeak3_Node_Host.serverGetByUid | public function serverGetByUid($uid)
{
foreach($this->serverList() as $server)
{
if($server["virtualserver_unique_identifier"] == $uid) return $server;
}
throw new TeamSpeak3_Adapter_ServerQuery_Exception("invalid serverID", 0x400);
} | php | public function serverGetByUid($uid)
{
foreach($this->serverList() as $server)
{
if($server["virtualserver_unique_identifier"] == $uid) return $server;
}
throw new TeamSpeak3_Adapter_ServerQuery_Exception("invalid serverID", 0x400);
} | [
"public",
"function",
"serverGetByUid",
"(",
"$",
"uid",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"serverList",
"(",
")",
"as",
"$",
"server",
")",
"{",
"if",
"(",
"$",
"server",
"[",
"\"virtualserver_unique_identifier\"",
"]",
"==",
"$",
"uid",
")",... | Returns the first TeamSpeak3_Node_Server object matching the given unique identifier.
@param string $uid
@throws TeamSpeak3_Adapter_ServerQuery_Exception
@return TeamSpeak3_Node_Server | [
"Returns",
"the",
"first",
"TeamSpeak3_Node_Server",
"object",
"matching",
"the",
"given",
"unique",
"identifier",
"."
] | train | https://github.com/planetteamspeak/ts3phpframework/blob/82ed6edc261547099c916a59f624caf5daa68035/libraries/TeamSpeak3/Node/Host.php#L313-L321 |
planetteamspeak/ts3phpframework | libraries/TeamSpeak3/Node/Host.php | TeamSpeak3_Node_Host.serverCreate | public function serverCreate(array $properties = array())
{
$this->serverListReset();
$detail = $this->execute("servercreate", $properties)->toList();
$server = new TeamSpeak3_Node_Server($this, array("virtualserver_id" => intval($detail["sid"])));
TeamSpeak3_Helper_Signal::getInstance()->emit("notifyServercreated", $this, $detail["sid"]);
TeamSpeak3_Helper_Signal::getInstance()->emit("notifyTokencreated", $server, $detail["token"]);
return $detail;
} | php | public function serverCreate(array $properties = array())
{
$this->serverListReset();
$detail = $this->execute("servercreate", $properties)->toList();
$server = new TeamSpeak3_Node_Server($this, array("virtualserver_id" => intval($detail["sid"])));
TeamSpeak3_Helper_Signal::getInstance()->emit("notifyServercreated", $this, $detail["sid"]);
TeamSpeak3_Helper_Signal::getInstance()->emit("notifyTokencreated", $server, $detail["token"]);
return $detail;
} | [
"public",
"function",
"serverCreate",
"(",
"array",
"$",
"properties",
"=",
"array",
"(",
")",
")",
"{",
"$",
"this",
"->",
"serverListReset",
"(",
")",
";",
"$",
"detail",
"=",
"$",
"this",
"->",
"execute",
"(",
"\"servercreate\"",
",",
"$",
"properties... | Creates a new virtual server using given properties and returns an assoc
array containing the new ID and initial admin token.
@param array $properties
@return array | [
"Creates",
"a",
"new",
"virtual",
"server",
"using",
"given",
"properties",
"and",
"returns",
"an",
"assoc",
"array",
"containing",
"the",
"new",
"ID",
"and",
"initial",
"admin",
"token",
"."
] | train | https://github.com/planetteamspeak/ts3phpframework/blob/82ed6edc261547099c916a59f624caf5daa68035/libraries/TeamSpeak3/Node/Host.php#L330-L341 |
planetteamspeak/ts3phpframework | libraries/TeamSpeak3/Node/Host.php | TeamSpeak3_Node_Host.serverStopProcess | public function serverStopProcess($msg = null)
{
TeamSpeak3_Helper_Signal::getInstance()->emit("notifyServershutdown", $this);
$this->execute("serverprocessstop", array("reasonmsg" => $msg));
} | php | public function serverStopProcess($msg = null)
{
TeamSpeak3_Helper_Signal::getInstance()->emit("notifyServershutdown", $this);
$this->execute("serverprocessstop", array("reasonmsg" => $msg));
} | [
"public",
"function",
"serverStopProcess",
"(",
"$",
"msg",
"=",
"null",
")",
"{",
"TeamSpeak3_Helper_Signal",
"::",
"getInstance",
"(",
")",
"->",
"emit",
"(",
"\"notifyServershutdown\"",
",",
"$",
"this",
")",
";",
"$",
"this",
"->",
"execute",
"(",
"\"ser... | Stops the entire TeamSpeak 3 Server instance by shutting down the process.
@param string $msg
@return void | [
"Stops",
"the",
"entire",
"TeamSpeak",
"3",
"Server",
"instance",
"by",
"shutting",
"down",
"the",
"process",
"."
] | train | https://github.com/planetteamspeak/ts3phpframework/blob/82ed6edc261547099c916a59f624caf5daa68035/libraries/TeamSpeak3/Node/Host.php#L407-L412 |
planetteamspeak/ts3phpframework | libraries/TeamSpeak3/Node/Host.php | TeamSpeak3_Node_Host.serverList | public function serverList(array $filter = array())
{
if($this->serverList === null)
{
$servers = $this->request("serverlist -uid")->toAssocArray("virtualserver_id");
$this->serverList = array();
foreach($servers as $sid => $server)
{
$this->serverList[$sid] = new TeamSpeak3_Node_Server($this, $server);
}
$this->resetNodeList();
}
return $this->filterList($this->serverList, $filter);
} | php | public function serverList(array $filter = array())
{
if($this->serverList === null)
{
$servers = $this->request("serverlist -uid")->toAssocArray("virtualserver_id");
$this->serverList = array();
foreach($servers as $sid => $server)
{
$this->serverList[$sid] = new TeamSpeak3_Node_Server($this, $server);
}
$this->resetNodeList();
}
return $this->filterList($this->serverList, $filter);
} | [
"public",
"function",
"serverList",
"(",
"array",
"$",
"filter",
"=",
"array",
"(",
")",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"serverList",
"===",
"null",
")",
"{",
"$",
"servers",
"=",
"$",
"this",
"->",
"request",
"(",
"\"serverlist -uid\"",
")",
... | Returns an array filled with TeamSpeak3_Node_Server objects.
@param array $filter
@return array | [
"Returns",
"an",
"array",
"filled",
"with",
"TeamSpeak3_Node_Server",
"objects",
"."
] | train | https://github.com/planetteamspeak/ts3phpframework/blob/82ed6edc261547099c916a59f624caf5daa68035/libraries/TeamSpeak3/Node/Host.php#L420-L437 |
planetteamspeak/ts3phpframework | libraries/TeamSpeak3/Node/Host.php | TeamSpeak3_Node_Host.permissionTree | public function permissionTree()
{
$permtree = array();
foreach($this->permissionCats() as $key => $val)
{
$permtree[$val]["permcatid"] = $val;
$permtree[$val]["permcathex"] = "0x" . dechex($val);
$permtree[$val]["permcatname"] = TeamSpeak3_Helper_String::factory(TeamSpeak3_Helper_Convert::permissionCategory($val));
$permtree[$val]["permcatparent"] = $permtree[$val]["permcathex"]{3} == 0 ? 0 : hexdec($permtree[$val]["permcathex"]{2} . 0);
$permtree[$val]["permcatchilren"] = 0;
$permtree[$val]["permcatcount"] = 0;
if(isset($permtree[$permtree[$val]["permcatparent"]]))
{
$permtree[$permtree[$val]["permcatparent"]]["permcatchilren"]++;
}
if($permtree[$val]["permcatname"]->contains("/"))
{
$permtree[$val]["permcatname"] = $permtree[$val]["permcatname"]->section("/", 1)->trim();
}
foreach($this->permissionList() as $permission)
{
if($permission["permid"]["permcatid"] == $val)
{
$permtree[$val]["permcatcount"]++;
}
}
}
return $permtree;
} | php | public function permissionTree()
{
$permtree = array();
foreach($this->permissionCats() as $key => $val)
{
$permtree[$val]["permcatid"] = $val;
$permtree[$val]["permcathex"] = "0x" . dechex($val);
$permtree[$val]["permcatname"] = TeamSpeak3_Helper_String::factory(TeamSpeak3_Helper_Convert::permissionCategory($val));
$permtree[$val]["permcatparent"] = $permtree[$val]["permcathex"]{3} == 0 ? 0 : hexdec($permtree[$val]["permcathex"]{2} . 0);
$permtree[$val]["permcatchilren"] = 0;
$permtree[$val]["permcatcount"] = 0;
if(isset($permtree[$permtree[$val]["permcatparent"]]))
{
$permtree[$permtree[$val]["permcatparent"]]["permcatchilren"]++;
}
if($permtree[$val]["permcatname"]->contains("/"))
{
$permtree[$val]["permcatname"] = $permtree[$val]["permcatname"]->section("/", 1)->trim();
}
foreach($this->permissionList() as $permission)
{
if($permission["permid"]["permcatid"] == $val)
{
$permtree[$val]["permcatcount"]++;
}
}
}
return $permtree;
} | [
"public",
"function",
"permissionTree",
"(",
")",
"{",
"$",
"permtree",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"permissionCats",
"(",
")",
"as",
"$",
"key",
"=>",
"$",
"val",
")",
"{",
"$",
"permtree",
"[",
"$",
"val",
"]",... | Returns an array filled with all permission categories known to the server including
their ID, name and parent.
@return array | [
"Returns",
"an",
"array",
"filled",
"with",
"all",
"permission",
"categories",
"known",
"to",
"the",
"server",
"including",
"their",
"ID",
"name",
"and",
"parent",
"."
] | train | https://github.com/planetteamspeak/ts3phpframework/blob/82ed6edc261547099c916a59f624caf5daa68035/libraries/TeamSpeak3/Node/Host.php#L533-L566 |
planetteamspeak/ts3phpframework | libraries/TeamSpeak3/Node/Host.php | TeamSpeak3_Node_Host.permissionFind | public function permissionFind($permid)
{
if(!is_array($permid))
{
$permident = (is_numeric($permid)) ? "permid" : "permsid";
}
else
{
$permident = (is_numeric(current($permid))) ? "permid" : "permsid";
}
return $this->execute("permfind", array($permident => $permid))->toArray();
} | php | public function permissionFind($permid)
{
if(!is_array($permid))
{
$permident = (is_numeric($permid)) ? "permid" : "permsid";
}
else
{
$permident = (is_numeric(current($permid))) ? "permid" : "permsid";
}
return $this->execute("permfind", array($permident => $permid))->toArray();
} | [
"public",
"function",
"permissionFind",
"(",
"$",
"permid",
")",
"{",
"if",
"(",
"!",
"is_array",
"(",
"$",
"permid",
")",
")",
"{",
"$",
"permident",
"=",
"(",
"is_numeric",
"(",
"$",
"permid",
")",
")",
"?",
"\"permid\"",
":",
"\"permsid\"",
";",
"... | Returns the IDs of all clients, channels or groups using the permission with the
specified ID.
@param integer $permid
@return array | [
"Returns",
"the",
"IDs",
"of",
"all",
"clients",
"channels",
"or",
"groups",
"using",
"the",
"permission",
"with",
"the",
"specified",
"ID",
"."
] | train | https://github.com/planetteamspeak/ts3phpframework/blob/82ed6edc261547099c916a59f624caf5daa68035/libraries/TeamSpeak3/Node/Host.php#L575-L587 |
planetteamspeak/ts3phpframework | libraries/TeamSpeak3/Node/Host.php | TeamSpeak3_Node_Host.permissionGetIdByName | public function permissionGetIdByName($name)
{
if(!array_key_exists((string) $name, $this->permissionList()))
{
throw new TeamSpeak3_Adapter_ServerQuery_Exception("invalid permission ID", 0xA02);
}
return $this->permissionList[(string) $name]["permid"];
} | php | public function permissionGetIdByName($name)
{
if(!array_key_exists((string) $name, $this->permissionList()))
{
throw new TeamSpeak3_Adapter_ServerQuery_Exception("invalid permission ID", 0xA02);
}
return $this->permissionList[(string) $name]["permid"];
} | [
"public",
"function",
"permissionGetIdByName",
"(",
"$",
"name",
")",
"{",
"if",
"(",
"!",
"array_key_exists",
"(",
"(",
"string",
")",
"$",
"name",
",",
"$",
"this",
"->",
"permissionList",
"(",
")",
")",
")",
"{",
"throw",
"new",
"TeamSpeak3_Adapter_Serv... | Returns the ID of the permission matching the given name.
@param string $name
@throws TeamSpeak3_Adapter_ServerQuery_Exception
@return integer | [
"Returns",
"the",
"ID",
"of",
"the",
"permission",
"matching",
"the",
"given",
"name",
"."
] | train | https://github.com/planetteamspeak/ts3phpframework/blob/82ed6edc261547099c916a59f624caf5daa68035/libraries/TeamSpeak3/Node/Host.php#L596-L604 |
planetteamspeak/ts3phpframework | libraries/TeamSpeak3/Node/Host.php | TeamSpeak3_Node_Host.permissionGetNameById | public function permissionGetNameById($permid)
{
foreach($this->permissionList() as $name => $perm)
{
if($perm["permid"] == $permid) return new TeamSpeak3_Helper_String($name);
}
throw new TeamSpeak3_Adapter_ServerQuery_Exception("invalid permission ID", 0xA02);
} | php | public function permissionGetNameById($permid)
{
foreach($this->permissionList() as $name => $perm)
{
if($perm["permid"] == $permid) return new TeamSpeak3_Helper_String($name);
}
throw new TeamSpeak3_Adapter_ServerQuery_Exception("invalid permission ID", 0xA02);
} | [
"public",
"function",
"permissionGetNameById",
"(",
"$",
"permid",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"permissionList",
"(",
")",
"as",
"$",
"name",
"=>",
"$",
"perm",
")",
"{",
"if",
"(",
"$",
"perm",
"[",
"\"permid\"",
"]",
"==",
"$",
"pe... | Returns the name of the permission matching the given ID.
@param integer $permid
@throws TeamSpeak3_Adapter_ServerQuery_Exception
@return TeamSpeak3_Helper_String | [
"Returns",
"the",
"name",
"of",
"the",
"permission",
"matching",
"the",
"given",
"ID",
"."
] | train | https://github.com/planetteamspeak/ts3phpframework/blob/82ed6edc261547099c916a59f624caf5daa68035/libraries/TeamSpeak3/Node/Host.php#L613-L621 |
planetteamspeak/ts3phpframework | libraries/TeamSpeak3/Node/Host.php | TeamSpeak3_Node_Host.permissionGetCategoryById | public function permissionGetCategoryById($permid)
{
if(!is_numeric($permid))
{
$permid = $this->permissionGetIdByName($permid);
}
if($permid < 0x1000)
{
if($this->permissionEnds === null)
{
$this->fetchPermissionList();
}
if($this->permissionCats === null)
{
$this->fetchPermissionCats();
}
$catids = array_values($this->permissionCats());
foreach($this->permissionEnds as $key => $val)
{
if($val >= $permid && isset($catids[$key]))
{
return $catids[$key];
}
}
return 0;
}
else
{
return (int) $permid >> 8;
}
} | php | public function permissionGetCategoryById($permid)
{
if(!is_numeric($permid))
{
$permid = $this->permissionGetIdByName($permid);
}
if($permid < 0x1000)
{
if($this->permissionEnds === null)
{
$this->fetchPermissionList();
}
if($this->permissionCats === null)
{
$this->fetchPermissionCats();
}
$catids = array_values($this->permissionCats());
foreach($this->permissionEnds as $key => $val)
{
if($val >= $permid && isset($catids[$key]))
{
return $catids[$key];
}
}
return 0;
}
else
{
return (int) $permid >> 8;
}
} | [
"public",
"function",
"permissionGetCategoryById",
"(",
"$",
"permid",
")",
"{",
"if",
"(",
"!",
"is_numeric",
"(",
"$",
"permid",
")",
")",
"{",
"$",
"permid",
"=",
"$",
"this",
"->",
"permissionGetIdByName",
"(",
"$",
"permid",
")",
";",
"}",
"if",
"... | Returns the internal category of the permission matching the given ID.
All pre-3.0.7 permission IDs are are 2 bytes wide. The first byte identifies the category while
the second byte is the permission count within that group.
@param integer $permid
@return integer | [
"Returns",
"the",
"internal",
"category",
"of",
"the",
"permission",
"matching",
"the",
"given",
"ID",
"."
] | train | https://github.com/planetteamspeak/ts3phpframework/blob/82ed6edc261547099c916a59f624caf5daa68035/libraries/TeamSpeak3/Node/Host.php#L632-L667 |
planetteamspeak/ts3phpframework | libraries/TeamSpeak3/Node/Host.php | TeamSpeak3_Node_Host.permissionGetGrantById | public function permissionGetGrantById($permid)
{
if(!is_numeric($permid))
{
$permid = $this->permissionGetIdByName($permid);
}
if($permid < 0x1000)
{
return (int) $permid+0x8000;
}
else
{
return (int) bindec(substr(decbin($permid), -8))+0xFF00;
}
} | php | public function permissionGetGrantById($permid)
{
if(!is_numeric($permid))
{
$permid = $this->permissionGetIdByName($permid);
}
if($permid < 0x1000)
{
return (int) $permid+0x8000;
}
else
{
return (int) bindec(substr(decbin($permid), -8))+0xFF00;
}
} | [
"public",
"function",
"permissionGetGrantById",
"(",
"$",
"permid",
")",
"{",
"if",
"(",
"!",
"is_numeric",
"(",
"$",
"permid",
")",
")",
"{",
"$",
"permid",
"=",
"$",
"this",
"->",
"permissionGetIdByName",
"(",
"$",
"permid",
")",
";",
"}",
"if",
"(",... | Returns the internal ID of the i_needed_modify_power_* or grant permission.
Every permission has an associated i_needed_modify_power_* permission, for example b_client_ban_create has an
associated permission called i_needed_modify_power_client_ban_create.
@param integer $permid
@return integer | [
"Returns",
"the",
"internal",
"ID",
"of",
"the",
"i_needed_modify_power_",
"*",
"or",
"grant",
"permission",
"."
] | train | https://github.com/planetteamspeak/ts3phpframework/blob/82ed6edc261547099c916a59f624caf5daa68035/libraries/TeamSpeak3/Node/Host.php#L678-L693 |
planetteamspeak/ts3phpframework | libraries/TeamSpeak3/Node/Host.php | TeamSpeak3_Node_Host.serverGroupPermAutoRemove | public function serverGroupPermAutoRemove($sgtype, $permid)
{
if(!is_array($permid))
{
$permident = (is_numeric($permid)) ? "permid" : "permsid";
}
else
{
$permident = (is_numeric(current($permid))) ? "permid" : "permsid";
}
$this->execute("servergroupautodelperm", array("sgtype" => $sgtype, $permident => $permid));
} | php | public function serverGroupPermAutoRemove($sgtype, $permid)
{
if(!is_array($permid))
{
$permident = (is_numeric($permid)) ? "permid" : "permsid";
}
else
{
$permident = (is_numeric(current($permid))) ? "permid" : "permsid";
}
$this->execute("servergroupautodelperm", array("sgtype" => $sgtype, $permident => $permid));
} | [
"public",
"function",
"serverGroupPermAutoRemove",
"(",
"$",
"sgtype",
",",
"$",
"permid",
")",
"{",
"if",
"(",
"!",
"is_array",
"(",
"$",
"permid",
")",
")",
"{",
"$",
"permident",
"=",
"(",
"is_numeric",
"(",
"$",
"permid",
")",
")",
"?",
"\"permid\"... | Removes a set of specified permissions from all regular server groups on all virtual servers. The target groups
will be identified by the value of their i_group_auto_update_type permission specified with $sgtype.
@param integer $sgtype
@param integer $permid
@return void | [
"Removes",
"a",
"set",
"of",
"specified",
"permissions",
"from",
"all",
"regular",
"server",
"groups",
"on",
"all",
"virtual",
"servers",
".",
"The",
"target",
"groups",
"will",
"be",
"identified",
"by",
"the",
"value",
"of",
"their",
"i_group_auto_update_type",... | train | https://github.com/planetteamspeak/ts3phpframework/blob/82ed6edc261547099c916a59f624caf5daa68035/libraries/TeamSpeak3/Node/Host.php#L728-L740 |
planetteamspeak/ts3phpframework | libraries/TeamSpeak3/Node/Host.php | TeamSpeak3_Node_Host.selfPermCheck | public function selfPermCheck($permid)
{
if(!is_array($permid))
{
$permident = (is_numeric($permid)) ? "permid" : "permsid";
}
else
{
$permident = (is_numeric(current($permid))) ? "permid" : "permsid";
}
return $this->execute("permget", array($permident => $permid))->toAssocArray("permsid");
} | php | public function selfPermCheck($permid)
{
if(!is_array($permid))
{
$permident = (is_numeric($permid)) ? "permid" : "permsid";
}
else
{
$permident = (is_numeric(current($permid))) ? "permid" : "permsid";
}
return $this->execute("permget", array($permident => $permid))->toAssocArray("permsid");
} | [
"public",
"function",
"selfPermCheck",
"(",
"$",
"permid",
")",
"{",
"if",
"(",
"!",
"is_array",
"(",
"$",
"permid",
")",
")",
"{",
"$",
"permident",
"=",
"(",
"is_numeric",
"(",
"$",
"permid",
")",
")",
"?",
"\"permid\"",
":",
"\"permsid\"",
";",
"}... | Returns an array containing the value of a specified permission for your own client.
@param integer $permid
@return array | [
"Returns",
"an",
"array",
"containing",
"the",
"value",
"of",
"a",
"specified",
"permission",
"for",
"your",
"own",
"client",
"."
] | train | https://github.com/planetteamspeak/ts3phpframework/blob/82ed6edc261547099c916a59f624caf5daa68035/libraries/TeamSpeak3/Node/Host.php#L748-L760 |
planetteamspeak/ts3phpframework | libraries/TeamSpeak3/Node/Host.php | TeamSpeak3_Node_Host.logAdd | public function logAdd($logmsg, $loglevel = TeamSpeak3::LOGLEVEL_INFO)
{
$sid = $this->serverSelectedId();
$this->serverDeselect();
$this->execute("logadd", array("logmsg" => $logmsg, "loglevel" => $loglevel));
$this->serverSelect($sid);
} | php | public function logAdd($logmsg, $loglevel = TeamSpeak3::LOGLEVEL_INFO)
{
$sid = $this->serverSelectedId();
$this->serverDeselect();
$this->execute("logadd", array("logmsg" => $logmsg, "loglevel" => $loglevel));
$this->serverSelect($sid);
} | [
"public",
"function",
"logAdd",
"(",
"$",
"logmsg",
",",
"$",
"loglevel",
"=",
"TeamSpeak3",
"::",
"LOGLEVEL_INFO",
")",
"{",
"$",
"sid",
"=",
"$",
"this",
"->",
"serverSelectedId",
"(",
")",
";",
"$",
"this",
"->",
"serverDeselect",
"(",
")",
";",
"$"... | Writes a custom entry into the server instance log.
@param string $logmsg
@param integer $loglevel
@return void | [
"Writes",
"a",
"custom",
"entry",
"into",
"the",
"server",
"instance",
"log",
"."
] | train | https://github.com/planetteamspeak/ts3phpframework/blob/82ed6edc261547099c916a59f624caf5daa68035/libraries/TeamSpeak3/Node/Host.php#L806-L813 |
planetteamspeak/ts3phpframework | libraries/TeamSpeak3/Node/Host.php | TeamSpeak3_Node_Host.login | public function login($username, $password)
{
$this->execute("login", array("client_login_name" => $username, "client_login_password" => $password));
$this->whoamiReset();
$crypt = new TeamSpeak3_Helper_Crypt($username);
$this->setStorage("_login_user", $username);
$this->setStorage("_login_pass", $crypt->encrypt($password));
TeamSpeak3_Helper_Signal::getInstance()->emit("notifyLogin", $this);
} | php | public function login($username, $password)
{
$this->execute("login", array("client_login_name" => $username, "client_login_password" => $password));
$this->whoamiReset();
$crypt = new TeamSpeak3_Helper_Crypt($username);
$this->setStorage("_login_user", $username);
$this->setStorage("_login_pass", $crypt->encrypt($password));
TeamSpeak3_Helper_Signal::getInstance()->emit("notifyLogin", $this);
} | [
"public",
"function",
"login",
"(",
"$",
"username",
",",
"$",
"password",
")",
"{",
"$",
"this",
"->",
"execute",
"(",
"\"login\"",
",",
"array",
"(",
"\"client_login_name\"",
"=>",
"$",
"username",
",",
"\"client_login_password\"",
"=>",
"$",
"password",
"... | Authenticates with the TeamSpeak 3 Server instance using given ServerQuery login credentials.
@param string $username
@param string $password
@return void | [
"Authenticates",
"with",
"the",
"TeamSpeak",
"3",
"Server",
"instance",
"using",
"given",
"ServerQuery",
"login",
"credentials",
"."
] | train | https://github.com/planetteamspeak/ts3phpframework/blob/82ed6edc261547099c916a59f624caf5daa68035/libraries/TeamSpeak3/Node/Host.php#L822-L833 |
planetteamspeak/ts3phpframework | libraries/TeamSpeak3/Node/Host.php | TeamSpeak3_Node_Host.logout | public function logout()
{
$this->request("logout");
$this->whoamiReset();
$this->delStorage("_login_user");
$this->delStorage("_login_pass");
TeamSpeak3_Helper_Signal::getInstance()->emit("notifyLogout", $this);
} | php | public function logout()
{
$this->request("logout");
$this->whoamiReset();
$this->delStorage("_login_user");
$this->delStorage("_login_pass");
TeamSpeak3_Helper_Signal::getInstance()->emit("notifyLogout", $this);
} | [
"public",
"function",
"logout",
"(",
")",
"{",
"$",
"this",
"->",
"request",
"(",
"\"logout\"",
")",
";",
"$",
"this",
"->",
"whoamiReset",
"(",
")",
";",
"$",
"this",
"->",
"delStorage",
"(",
"\"_login_user\"",
")",
";",
"$",
"this",
"->",
"delStorage... | Deselects the active virtual server and logs out from the server instance.
@return void | [
"Deselects",
"the",
"active",
"virtual",
"server",
"and",
"logs",
"out",
"from",
"the",
"server",
"instance",
"."
] | train | https://github.com/planetteamspeak/ts3phpframework/blob/82ed6edc261547099c916a59f624caf5daa68035/libraries/TeamSpeak3/Node/Host.php#L840-L849 |
planetteamspeak/ts3phpframework | libraries/TeamSpeak3/Node/Host.php | TeamSpeak3_Node_Host.whoami | public function whoami()
{
if($this->whoami === null)
{
$this->whoami = $this->request("whoami")->toList();
}
return $this->whoami;
} | php | public function whoami()
{
if($this->whoami === null)
{
$this->whoami = $this->request("whoami")->toList();
}
return $this->whoami;
} | [
"public",
"function",
"whoami",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"whoami",
"===",
"null",
")",
"{",
"$",
"this",
"->",
"whoami",
"=",
"$",
"this",
"->",
"request",
"(",
"\"whoami\"",
")",
"->",
"toList",
"(",
")",
";",
"}",
"return",
... | Returns information about your current ServerQuery connection.
@return array | [
"Returns",
"information",
"about",
"your",
"current",
"ServerQuery",
"connection",
"."
] | train | https://github.com/planetteamspeak/ts3phpframework/blob/82ed6edc261547099c916a59f624caf5daa68035/libraries/TeamSpeak3/Node/Host.php#L856-L864 |
planetteamspeak/ts3phpframework | libraries/TeamSpeak3/Node/Host.php | TeamSpeak3_Node_Host.whoamiGet | public function whoamiGet($ident, $default = null)
{
if(array_key_exists($ident, $this->whoami()))
{
return $this->whoami[$ident];
}
return $default;
} | php | public function whoamiGet($ident, $default = null)
{
if(array_key_exists($ident, $this->whoami()))
{
return $this->whoami[$ident];
}
return $default;
} | [
"public",
"function",
"whoamiGet",
"(",
"$",
"ident",
",",
"$",
"default",
"=",
"null",
")",
"{",
"if",
"(",
"array_key_exists",
"(",
"$",
"ident",
",",
"$",
"this",
"->",
"whoami",
"(",
")",
")",
")",
"{",
"return",
"$",
"this",
"->",
"whoami",
"[... | Returns a single value from the current ServerQuery connection info.
@param string $ident
@param mixed $default
@return mixed | [
"Returns",
"a",
"single",
"value",
"from",
"the",
"current",
"ServerQuery",
"connection",
"info",
"."
] | train | https://github.com/planetteamspeak/ts3phpframework/blob/82ed6edc261547099c916a59f624caf5daa68035/libraries/TeamSpeak3/Node/Host.php#L873-L881 |
planetteamspeak/ts3phpframework | libraries/TeamSpeak3/Node/Host.php | TeamSpeak3_Node_Host.whoamiSet | public function whoamiSet($ident, $value = null)
{
$this->whoami();
$this->whoami[$ident] = (is_numeric($value)) ? (int) $value : TeamSpeak3_Helper_String::factory($value);
} | php | public function whoamiSet($ident, $value = null)
{
$this->whoami();
$this->whoami[$ident] = (is_numeric($value)) ? (int) $value : TeamSpeak3_Helper_String::factory($value);
} | [
"public",
"function",
"whoamiSet",
"(",
"$",
"ident",
",",
"$",
"value",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"whoami",
"(",
")",
";",
"$",
"this",
"->",
"whoami",
"[",
"$",
"ident",
"]",
"=",
"(",
"is_numeric",
"(",
"$",
"value",
")",
")",
... | Sets a single value in the current ServerQuery connection info.
@param string $ident
@param mixed $value
@return mixed | [
"Sets",
"a",
"single",
"value",
"in",
"the",
"current",
"ServerQuery",
"connection",
"info",
"."
] | train | https://github.com/planetteamspeak/ts3phpframework/blob/82ed6edc261547099c916a59f624caf5daa68035/libraries/TeamSpeak3/Node/Host.php#L890-L895 |
planetteamspeak/ts3phpframework | libraries/TeamSpeak3/Node/Channelgroup.php | TeamSpeak3_Node_Channelgroup.copy | public function copy($name = null, $tcgid = 0, $type = TeamSpeak3::GROUP_DBTYPE_REGULAR)
{
return $this->getParent()->channelGroupCopy($this->getId(), $name, $tcgid, $type);
} | php | public function copy($name = null, $tcgid = 0, $type = TeamSpeak3::GROUP_DBTYPE_REGULAR)
{
return $this->getParent()->channelGroupCopy($this->getId(), $name, $tcgid, $type);
} | [
"public",
"function",
"copy",
"(",
"$",
"name",
"=",
"null",
",",
"$",
"tcgid",
"=",
"0",
",",
"$",
"type",
"=",
"TeamSpeak3",
"::",
"GROUP_DBTYPE_REGULAR",
")",
"{",
"return",
"$",
"this",
"->",
"getParent",
"(",
")",
"->",
"channelGroupCopy",
"(",
"$... | Creates a copy of the channel group and returns the new groups ID.
@param string $name
@param integer $tcgid
@param integer $type
@return integer | [
"Creates",
"a",
"copy",
"of",
"the",
"channel",
"group",
"and",
"returns",
"the",
"new",
"groups",
"ID",
"."
] | train | https://github.com/planetteamspeak/ts3phpframework/blob/82ed6edc261547099c916a59f624caf5daa68035/libraries/TeamSpeak3/Node/Channelgroup.php#L84-L87 |
planetteamspeak/ts3phpframework | libraries/TeamSpeak3/Node/Channelgroup.php | TeamSpeak3_Node_Channelgroup.permAssign | public function permAssign($permid, $permvalue)
{
$this->getParent()->channelGroupPermAssign($this->getId(), $permid, $permvalue);
} | php | public function permAssign($permid, $permvalue)
{
$this->getParent()->channelGroupPermAssign($this->getId(), $permid, $permvalue);
} | [
"public",
"function",
"permAssign",
"(",
"$",
"permid",
",",
"$",
"permvalue",
")",
"{",
"$",
"this",
"->",
"getParent",
"(",
")",
"->",
"channelGroupPermAssign",
"(",
"$",
"this",
"->",
"getId",
"(",
")",
",",
"$",
"permid",
",",
"$",
"permvalue",
")"... | Adds a set of specified permissions to the channel group. Multiple permissions
can be added by providing the two parameters of each permission in separate arrays.
@param integer $permid
@param integer $permvalue
@return void | [
"Adds",
"a",
"set",
"of",
"specified",
"permissions",
"to",
"the",
"channel",
"group",
".",
"Multiple",
"permissions",
"can",
"be",
"added",
"by",
"providing",
"the",
"two",
"parameters",
"of",
"each",
"permission",
"in",
"separate",
"arrays",
"."
] | train | https://github.com/planetteamspeak/ts3phpframework/blob/82ed6edc261547099c916a59f624caf5daa68035/libraries/TeamSpeak3/Node/Channelgroup.php#L108-L111 |
planetteamspeak/ts3phpframework | libraries/TeamSpeak3/Node/Channelgroup.php | TeamSpeak3_Node_Channelgroup.clientList | public function clientList($cid = null, $cldbid = null, $resolve = FALSE)
{
return $this->getParent()->channelGroupClientList($this->getId(), $cid, $cldbid, $resolve);
} | php | public function clientList($cid = null, $cldbid = null, $resolve = FALSE)
{
return $this->getParent()->channelGroupClientList($this->getId(), $cid, $cldbid, $resolve);
} | [
"public",
"function",
"clientList",
"(",
"$",
"cid",
"=",
"null",
",",
"$",
"cldbid",
"=",
"null",
",",
"$",
"resolve",
"=",
"FALSE",
")",
"{",
"return",
"$",
"this",
"->",
"getParent",
"(",
")",
"->",
"channelGroupClientList",
"(",
"$",
"this",
"->",
... | Returns a list of clients assigned to the channel group specified.
@param integer $cid
@param integer $cldbid
@param boolean $resolve
@return array | [
"Returns",
"a",
"list",
"of",
"clients",
"assigned",
"to",
"the",
"channel",
"group",
"specified",
"."
] | train | https://github.com/planetteamspeak/ts3phpframework/blob/82ed6edc261547099c916a59f624caf5daa68035/libraries/TeamSpeak3/Node/Channelgroup.php#L153-L156 |
planetteamspeak/ts3phpframework | libraries/TeamSpeak3/Node/Channelgroup.php | TeamSpeak3_Node_Channelgroup.tokenCreate | public function tokenCreate($cid, $description = null, $customset = null)
{
return $this->privilegeKeyCreate($cid, $description, $customset);
} | php | public function tokenCreate($cid, $description = null, $customset = null)
{
return $this->privilegeKeyCreate($cid, $description, $customset);
} | [
"public",
"function",
"tokenCreate",
"(",
"$",
"cid",
",",
"$",
"description",
"=",
"null",
",",
"$",
"customset",
"=",
"null",
")",
"{",
"return",
"$",
"this",
"->",
"privilegeKeyCreate",
"(",
"$",
"cid",
",",
"$",
"description",
",",
"$",
"customset",
... | Alias for privilegeKeyCreate().
@deprecated | [
"Alias",
"for",
"privilegeKeyCreate",
"()",
"."
] | train | https://github.com/planetteamspeak/ts3phpframework/blob/82ed6edc261547099c916a59f624caf5daa68035/libraries/TeamSpeak3/Node/Channelgroup.php#L163-L166 |
planetteamspeak/ts3phpframework | libraries/TeamSpeak3/Adapter/ServerQuery.php | TeamSpeak3_Adapter_ServerQuery.syn | protected function syn()
{
$this->initTransport($this->options);
$this->transport->setAdapter($this);
TeamSpeak3_Helper_Profiler::init(spl_object_hash($this));
$rdy = $this->getTransport()->readLine();
if(!$rdy->startsWith(TeamSpeak3::TS3_PROTO_IDENT) && !$rdy->startsWith(TeamSpeak3::TEA_PROTO_IDENT) && !(defined("CUSTOM_PROTO_IDENT") && $rdy->startsWith(CUSTOM_PROTO_IDENT)))
{
throw new TeamSpeak3_Adapter_Exception("invalid reply from the server (" . $rdy . ")");
}
TeamSpeak3_Helper_Signal::getInstance()->emit("serverqueryConnected", $this);
} | php | protected function syn()
{
$this->initTransport($this->options);
$this->transport->setAdapter($this);
TeamSpeak3_Helper_Profiler::init(spl_object_hash($this));
$rdy = $this->getTransport()->readLine();
if(!$rdy->startsWith(TeamSpeak3::TS3_PROTO_IDENT) && !$rdy->startsWith(TeamSpeak3::TEA_PROTO_IDENT) && !(defined("CUSTOM_PROTO_IDENT") && $rdy->startsWith(CUSTOM_PROTO_IDENT)))
{
throw new TeamSpeak3_Adapter_Exception("invalid reply from the server (" . $rdy . ")");
}
TeamSpeak3_Helper_Signal::getInstance()->emit("serverqueryConnected", $this);
} | [
"protected",
"function",
"syn",
"(",
")",
"{",
"$",
"this",
"->",
"initTransport",
"(",
"$",
"this",
"->",
"options",
")",
";",
"$",
"this",
"->",
"transport",
"->",
"setAdapter",
"(",
"$",
"this",
")",
";",
"TeamSpeak3_Helper_Profiler",
"::",
"init",
"(... | Connects the TeamSpeak3_Transport_Abstract object and performs initial actions on the remote
server.
@throws TeamSpeak3_Adapter_Exception
@return void | [
"Connects",
"the",
"TeamSpeak3_Transport_Abstract",
"object",
"and",
"performs",
"initial",
"actions",
"on",
"the",
"remote",
"server",
"."
] | train | https://github.com/planetteamspeak/ts3phpframework/blob/82ed6edc261547099c916a59f624caf5daa68035/libraries/TeamSpeak3/Adapter/ServerQuery.php#L66-L81 |
planetteamspeak/ts3phpframework | libraries/TeamSpeak3/Adapter/ServerQuery.php | TeamSpeak3_Adapter_ServerQuery.request | public function request($cmd, $throw = TRUE)
{
$query = TeamSpeak3_Helper_String::factory($cmd)->section(TeamSpeak3::SEPARATOR_CELL);
if(strstr($cmd, "\r") || strstr($cmd, "\n"))
{
throw new TeamSpeak3_Adapter_Exception("illegal characters in command '" . $query . "'");
}
elseif(in_array($query, $this->block))
{
throw new TeamSpeak3_Adapter_ServerQuery_Exception("command not found", 0x100);
}
TeamSpeak3_Helper_Signal::getInstance()->emit("serverqueryCommandStarted", $cmd);
$this->getProfiler()->start();
$this->getTransport()->sendLine($cmd);
$this->timer = time();
$this->count++;
$rpl = array();
do {
$str = $this->getTransport()->readLine();
$rpl[] = $str;
} while($str instanceof TeamSpeak3_Helper_String && $str->section(TeamSpeak3::SEPARATOR_CELL) != TeamSpeak3::ERROR);
$this->getProfiler()->stop();
$reply = new TeamSpeak3_Adapter_ServerQuery_Reply($rpl, $cmd, $this->getHost(), $throw);
TeamSpeak3_Helper_Signal::getInstance()->emit("serverqueryCommandFinished", $cmd, $reply);
return $reply;
} | php | public function request($cmd, $throw = TRUE)
{
$query = TeamSpeak3_Helper_String::factory($cmd)->section(TeamSpeak3::SEPARATOR_CELL);
if(strstr($cmd, "\r") || strstr($cmd, "\n"))
{
throw new TeamSpeak3_Adapter_Exception("illegal characters in command '" . $query . "'");
}
elseif(in_array($query, $this->block))
{
throw new TeamSpeak3_Adapter_ServerQuery_Exception("command not found", 0x100);
}
TeamSpeak3_Helper_Signal::getInstance()->emit("serverqueryCommandStarted", $cmd);
$this->getProfiler()->start();
$this->getTransport()->sendLine($cmd);
$this->timer = time();
$this->count++;
$rpl = array();
do {
$str = $this->getTransport()->readLine();
$rpl[] = $str;
} while($str instanceof TeamSpeak3_Helper_String && $str->section(TeamSpeak3::SEPARATOR_CELL) != TeamSpeak3::ERROR);
$this->getProfiler()->stop();
$reply = new TeamSpeak3_Adapter_ServerQuery_Reply($rpl, $cmd, $this->getHost(), $throw);
TeamSpeak3_Helper_Signal::getInstance()->emit("serverqueryCommandFinished", $cmd, $reply);
return $reply;
} | [
"public",
"function",
"request",
"(",
"$",
"cmd",
",",
"$",
"throw",
"=",
"TRUE",
")",
"{",
"$",
"query",
"=",
"TeamSpeak3_Helper_String",
"::",
"factory",
"(",
"$",
"cmd",
")",
"->",
"section",
"(",
"TeamSpeak3",
"::",
"SEPARATOR_CELL",
")",
";",
"if",
... | Sends a prepared command to the server and returns the result.
@param string $cmd
@param boolean $throw
@throws TeamSpeak3_Adapter_Exception
@return TeamSpeak3_Adapter_ServerQuery_Reply | [
"Sends",
"a",
"prepared",
"command",
"to",
"the",
"server",
"and",
"returns",
"the",
"result",
"."
] | train | https://github.com/planetteamspeak/ts3phpframework/blob/82ed6edc261547099c916a59f624caf5daa68035/libraries/TeamSpeak3/Adapter/ServerQuery.php#L111-L145 |
planetteamspeak/ts3phpframework | libraries/TeamSpeak3/Adapter/ServerQuery.php | TeamSpeak3_Adapter_ServerQuery.wait | public function wait()
{
if($this->getTransport()->getConfig("blocking"))
{
throw new TeamSpeak3_Adapter_Exception("only available in non-blocking mode");
}
do {
$evt = $this->getTransport()->readLine();
} while($evt instanceof TeamSpeak3_Helper_String && !$evt->section(TeamSpeak3::SEPARATOR_CELL)->startsWith(TeamSpeak3::EVENT));
return new TeamSpeak3_Adapter_ServerQuery_Event($evt, $this->getHost());
} | php | public function wait()
{
if($this->getTransport()->getConfig("blocking"))
{
throw new TeamSpeak3_Adapter_Exception("only available in non-blocking mode");
}
do {
$evt = $this->getTransport()->readLine();
} while($evt instanceof TeamSpeak3_Helper_String && !$evt->section(TeamSpeak3::SEPARATOR_CELL)->startsWith(TeamSpeak3::EVENT));
return new TeamSpeak3_Adapter_ServerQuery_Event($evt, $this->getHost());
} | [
"public",
"function",
"wait",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"getTransport",
"(",
")",
"->",
"getConfig",
"(",
"\"blocking\"",
")",
")",
"{",
"throw",
"new",
"TeamSpeak3_Adapter_Exception",
"(",
"\"only available in non-blocking mode\"",
")",
";",
... | Waits for the server to send a notification message and returns the result.
@throws TeamSpeak3_Adapter_Exception
@return TeamSpeak3_Adapter_ServerQuery_Event | [
"Waits",
"for",
"the",
"server",
"to",
"send",
"a",
"notification",
"message",
"and",
"returns",
"the",
"result",
"."
] | train | https://github.com/planetteamspeak/ts3phpframework/blob/82ed6edc261547099c916a59f624caf5daa68035/libraries/TeamSpeak3/Adapter/ServerQuery.php#L153-L165 |
planetteamspeak/ts3phpframework | libraries/TeamSpeak3/Adapter/ServerQuery.php | TeamSpeak3_Adapter_ServerQuery.getHost | public function getHost()
{
if($this->host === null)
{
$this->host = new TeamSpeak3_Node_Host($this);
}
return $this->host;
} | php | public function getHost()
{
if($this->host === null)
{
$this->host = new TeamSpeak3_Node_Host($this);
}
return $this->host;
} | [
"public",
"function",
"getHost",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"host",
"===",
"null",
")",
"{",
"$",
"this",
"->",
"host",
"=",
"new",
"TeamSpeak3_Node_Host",
"(",
"$",
"this",
")",
";",
"}",
"return",
"$",
"this",
"->",
"host",
";",... | Returns the TeamSpeak3_Node_Host object of the current connection.
@return TeamSpeak3_Node_Host | [
"Returns",
"the",
"TeamSpeak3_Node_Host",
"object",
"of",
"the",
"current",
"connection",
"."
] | train | https://github.com/planetteamspeak/ts3phpframework/blob/82ed6edc261547099c916a59f624caf5daa68035/libraries/TeamSpeak3/Adapter/ServerQuery.php#L251-L259 |
planetteamspeak/ts3phpframework | libraries/TeamSpeak3/Exception.php | TeamSpeak3_Exception.prepareCustomMessage | protected function prepareCustomMessage(TeamSpeak3_Helper_String $mesg)
{
$args = array(
"code" => $this->getCode(),
"mesg" => $this->getMessage(),
"line" => $this->getLine(),
"file" => $this->getFile(),
);
return $mesg->arg($args)->toString();
} | php | protected function prepareCustomMessage(TeamSpeak3_Helper_String $mesg)
{
$args = array(
"code" => $this->getCode(),
"mesg" => $this->getMessage(),
"line" => $this->getLine(),
"file" => $this->getFile(),
);
return $mesg->arg($args)->toString();
} | [
"protected",
"function",
"prepareCustomMessage",
"(",
"TeamSpeak3_Helper_String",
"$",
"mesg",
")",
"{",
"$",
"args",
"=",
"array",
"(",
"\"code\"",
"=>",
"$",
"this",
"->",
"getCode",
"(",
")",
",",
"\"mesg\"",
"=>",
"$",
"this",
"->",
"getMessage",
"(",
... | Prepares a custom error message by replacing pre-defined signs with given values.
@param TeamSpeak3_Helper_String $mesg
@return TeamSpeak3_Helper_String | [
"Prepares",
"a",
"custom",
"error",
"message",
"by",
"replacing",
"pre",
"-",
"defined",
"signs",
"with",
"given",
"values",
"."
] | train | https://github.com/planetteamspeak/ts3phpframework/blob/82ed6edc261547099c916a59f624caf5daa68035/libraries/TeamSpeak3/Exception.php#L80-L90 |
planetteamspeak/ts3phpframework | libraries/TeamSpeak3/Exception.php | TeamSpeak3_Exception.registerCustomMessage | public static function registerCustomMessage($code, $mesg)
{
if(array_key_exists((int) $code, self::$messages))
{
throw new self("custom message for code 0x" . strtoupper(dechex($code)) . " is already registered");
}
if(!is_string($mesg))
{
throw new self("custom message for code 0x" . strtoupper(dechex($code)) . " must be a string");
}
self::$messages[(int) $code] = new TeamSpeak3_Helper_String($mesg);
} | php | public static function registerCustomMessage($code, $mesg)
{
if(array_key_exists((int) $code, self::$messages))
{
throw new self("custom message for code 0x" . strtoupper(dechex($code)) . " is already registered");
}
if(!is_string($mesg))
{
throw new self("custom message for code 0x" . strtoupper(dechex($code)) . " must be a string");
}
self::$messages[(int) $code] = new TeamSpeak3_Helper_String($mesg);
} | [
"public",
"static",
"function",
"registerCustomMessage",
"(",
"$",
"code",
",",
"$",
"mesg",
")",
"{",
"if",
"(",
"array_key_exists",
"(",
"(",
"int",
")",
"$",
"code",
",",
"self",
"::",
"$",
"messages",
")",
")",
"{",
"throw",
"new",
"self",
"(",
"... | Registers a custom error message to $code.
@param integer $code
@param string $mesg
@throws TeamSpeak3_Exception
@return void | [
"Registers",
"a",
"custom",
"error",
"message",
"to",
"$code",
"."
] | train | https://github.com/planetteamspeak/ts3phpframework/blob/82ed6edc261547099c916a59f624caf5daa68035/libraries/TeamSpeak3/Exception.php#L100-L113 |
Nayjest/Grids | src/Sorter.php | Sorter.link | public function link(FieldConfig $column, $direction)
{
return (new GridInputProcessor($this->grid))
->setSorting($column, $direction)
->getUrl();
} | php | public function link(FieldConfig $column, $direction)
{
return (new GridInputProcessor($this->grid))
->setSorting($column, $direction)
->getUrl();
} | [
"public",
"function",
"link",
"(",
"FieldConfig",
"$",
"column",
",",
"$",
"direction",
")",
"{",
"return",
"(",
"new",
"GridInputProcessor",
"(",
"$",
"this",
"->",
"grid",
")",
")",
"->",
"setSorting",
"(",
"$",
"column",
",",
"$",
"direction",
")",
... | Returns URL for sorting control.
@param FieldConfig $column
@param $direction
@return string | [
"Returns",
"URL",
"for",
"sorting",
"control",
"."
] | train | https://github.com/Nayjest/Grids/blob/06f0a3d1b62844006d7c5e177e554dba0933d18e/src/Sorter.php#L35-L40 |
Nayjest/Grids | src/Sorter.php | Sorter.apply | public function apply()
{
$input = $this->grid->getInputProcessor()->getInput();
$sort = null;
if (isset($input['sort'])) {
foreach ($input['sort'] as $field => $direction) {
$sort = [$field, $direction];
break;
}
}
foreach ($this->grid->getConfig()->getColumns() as $column) {
if ($sort) {
if ($column->getName() === $sort[0]) {
$column->setSorting($sort[1]);
} else {
$column->setSorting(null);
}
} else {
if ($direction = $column->getSorting()) {
$sort = [$column->getName(), $direction];
}
}
}
if ($sort) {
$this
->grid
->getConfig()
->getDataProvider()
->orderBy($sort[0], $sort[1]);
}
} | php | public function apply()
{
$input = $this->grid->getInputProcessor()->getInput();
$sort = null;
if (isset($input['sort'])) {
foreach ($input['sort'] as $field => $direction) {
$sort = [$field, $direction];
break;
}
}
foreach ($this->grid->getConfig()->getColumns() as $column) {
if ($sort) {
if ($column->getName() === $sort[0]) {
$column->setSorting($sort[1]);
} else {
$column->setSorting(null);
}
} else {
if ($direction = $column->getSorting()) {
$sort = [$column->getName(), $direction];
}
}
}
if ($sort) {
$this
->grid
->getConfig()
->getDataProvider()
->orderBy($sort[0], $sort[1]);
}
} | [
"public",
"function",
"apply",
"(",
")",
"{",
"$",
"input",
"=",
"$",
"this",
"->",
"grid",
"->",
"getInputProcessor",
"(",
")",
"->",
"getInput",
"(",
")",
";",
"$",
"sort",
"=",
"null",
";",
"if",
"(",
"isset",
"(",
"$",
"input",
"[",
"'sort'",
... | Applies sorting to data provider. | [
"Applies",
"sorting",
"to",
"data",
"provider",
"."
] | train | https://github.com/Nayjest/Grids/blob/06f0a3d1b62844006d7c5e177e554dba0933d18e/src/Sorter.php#L45-L75 |
Nayjest/Grids | src/ServiceProvider.php | ServiceProvider.boot | public function boot()
{
$pkg_path = dirname(__DIR__);
$views_path = $pkg_path . '/resources/views';
# only for Laravel 4 & some of 5-dev
if (version_compare(Application::VERSION, '5.0.0', '<')) {
$this->package('nayjest/grids');
$this->app['view']->addNamespace('grids', $views_path);
} else {
$this->loadViewsFrom($views_path, 'grids');
$this->loadTranslationsFrom($pkg_path . '/resources/lang', 'grids');
$this->publishes([
$views_path => base_path('resources/views/vendor/grids')
]);
}
if (!class_exists('Grids')) {
class_alias('\\Nayjest\\Grids\\Grids', '\\Grids');
}
} | php | public function boot()
{
$pkg_path = dirname(__DIR__);
$views_path = $pkg_path . '/resources/views';
# only for Laravel 4 & some of 5-dev
if (version_compare(Application::VERSION, '5.0.0', '<')) {
$this->package('nayjest/grids');
$this->app['view']->addNamespace('grids', $views_path);
} else {
$this->loadViewsFrom($views_path, 'grids');
$this->loadTranslationsFrom($pkg_path . '/resources/lang', 'grids');
$this->publishes([
$views_path => base_path('resources/views/vendor/grids')
]);
}
if (!class_exists('Grids')) {
class_alias('\\Nayjest\\Grids\\Grids', '\\Grids');
}
} | [
"public",
"function",
"boot",
"(",
")",
"{",
"$",
"pkg_path",
"=",
"dirname",
"(",
"__DIR__",
")",
";",
"$",
"views_path",
"=",
"$",
"pkg_path",
".",
"'/resources/views'",
";",
"# only for Laravel 4 & some of 5-dev",
"if",
"(",
"version_compare",
"(",
"Applicati... | Bootstrap the application events.
@return void | [
"Bootstrap",
"the",
"application",
"events",
"."
] | train | https://github.com/Nayjest/Grids/blob/06f0a3d1b62844006d7c5e177e554dba0933d18e/src/ServiceProvider.php#L31-L50 |
Nayjest/Grids | src/Components/Tr.php | Tr.renderCells | protected function renderCells()
{
$row = $this->getDataRow();
$out = '';
foreach($this->grid->getConfig()->getColumns() as $column) {
$component = new TableCell($column);
$component->initialize($this->grid);
$component->setContent($column->getValue($row));
$out .= $component->render();
}
return $out;
} | php | protected function renderCells()
{
$row = $this->getDataRow();
$out = '';
foreach($this->grid->getConfig()->getColumns() as $column) {
$component = new TableCell($column);
$component->initialize($this->grid);
$component->setContent($column->getValue($row));
$out .= $component->render();
}
return $out;
} | [
"protected",
"function",
"renderCells",
"(",
")",
"{",
"$",
"row",
"=",
"$",
"this",
"->",
"getDataRow",
"(",
")",
";",
"$",
"out",
"=",
"''",
";",
"foreach",
"(",
"$",
"this",
"->",
"grid",
"->",
"getConfig",
"(",
")",
"->",
"getColumns",
"(",
")"... | Renders row cells.
@return string | [
"Renders",
"row",
"cells",
"."
] | train | https://github.com/Nayjest/Grids/blob/06f0a3d1b62844006d7c5e177e554dba0933d18e/src/Components/Tr.php#L45-L56 |
Nayjest/Grids | src/Filter.php | Filter.getInputName | public function getInputName()
{
$key = $this->grid->getInputProcessor()->getKey();
$name = $this->config->getId();
return "{$key}[filters][{$name}]";
} | php | public function getInputName()
{
$key = $this->grid->getInputProcessor()->getKey();
$name = $this->config->getId();
return "{$key}[filters][{$name}]";
} | [
"public",
"function",
"getInputName",
"(",
")",
"{",
"$",
"key",
"=",
"$",
"this",
"->",
"grid",
"->",
"getInputProcessor",
"(",
")",
"->",
"getKey",
"(",
")",
";",
"$",
"name",
"=",
"$",
"this",
"->",
"config",
"->",
"getId",
"(",
")",
";",
"retur... | Returns input name for the filter.
@return string | [
"Returns",
"input",
"name",
"for",
"the",
"filter",
"."
] | train | https://github.com/Nayjest/Grids/blob/06f0a3d1b62844006d7c5e177e554dba0933d18e/src/Filter.php#L37-L42 |
Nayjest/Grids | src/Filter.php | Filter.getValue | public function getValue()
{
$from_input = $this
->grid
->getInputProcessor()
->getFilterValue($this->config->getId());
if ($from_input === null) {
return $this->config->getDefaultValue();
} else {
return $from_input;
}
} | php | public function getValue()
{
$from_input = $this
->grid
->getInputProcessor()
->getFilterValue($this->config->getId());
if ($from_input === null) {
return $this->config->getDefaultValue();
} else {
return $from_input;
}
} | [
"public",
"function",
"getValue",
"(",
")",
"{",
"$",
"from_input",
"=",
"$",
"this",
"->",
"grid",
"->",
"getInputProcessor",
"(",
")",
"->",
"getFilterValue",
"(",
"$",
"this",
"->",
"config",
"->",
"getId",
"(",
")",
")",
";",
"if",
"(",
"$",
"fro... | Returns filters value.
@return mixed | [
"Returns",
"filters",
"value",
"."
] | train | https://github.com/Nayjest/Grids/blob/06f0a3d1b62844006d7c5e177e554dba0933d18e/src/Filter.php#L59-L70 |
Nayjest/Grids | src/Filter.php | Filter.render | public function render()
{
$data = $this->grid->getViewData();
$data['column'] = $this->column;
$data['filter'] = $this;
$data['label'] = $this->config->getLabel();
return View::make(
$this->getTemplate(),
$data
)->render();
} | php | public function render()
{
$data = $this->grid->getViewData();
$data['column'] = $this->column;
$data['filter'] = $this;
$data['label'] = $this->config->getLabel();
return View::make(
$this->getTemplate(),
$data
)->render();
} | [
"public",
"function",
"render",
"(",
")",
"{",
"$",
"data",
"=",
"$",
"this",
"->",
"grid",
"->",
"getViewData",
"(",
")",
";",
"$",
"data",
"[",
"'column'",
"]",
"=",
"$",
"this",
"->",
"column",
";",
"$",
"data",
"[",
"'filter'",
"]",
"=",
"$",... | Renders filtering control.
@return string | [
"Renders",
"filtering",
"control",
"."
] | train | https://github.com/Nayjest/Grids/blob/06f0a3d1b62844006d7c5e177e554dba0933d18e/src/Filter.php#L77-L87 |
Nayjest/Grids | src/Filter.php | Filter.getTemplate | protected function getTemplate()
{
$filter_tpl = $this->config->getTemplate();
$grid_tpl = $this->grid->getConfig()->getTemplate();
return str_replace('*.', "$grid_tpl.filters.", $filter_tpl);
} | php | protected function getTemplate()
{
$filter_tpl = $this->config->getTemplate();
$grid_tpl = $this->grid->getConfig()->getTemplate();
return str_replace('*.', "$grid_tpl.filters.", $filter_tpl);
} | [
"protected",
"function",
"getTemplate",
"(",
")",
"{",
"$",
"filter_tpl",
"=",
"$",
"this",
"->",
"config",
"->",
"getTemplate",
"(",
")",
";",
"$",
"grid_tpl",
"=",
"$",
"this",
"->",
"grid",
"->",
"getConfig",
"(",
")",
"->",
"getTemplate",
"(",
")",... | Returns name of template for filtering control.
@return string | [
"Returns",
"name",
"of",
"template",
"for",
"filtering",
"control",
"."
] | train | https://github.com/Nayjest/Grids/blob/06f0a3d1b62844006d7c5e177e554dba0933d18e/src/Filter.php#L94-L99 |
Nayjest/Grids | src/Filter.php | Filter.apply | public function apply()
{
$value = $this->getValue();
if (null === $value || '' === $value) {
return;
}
if ($func = $this->config->getFilteringFunc()) {
$func($value, $this->grid->getConfig()->getDataProvider());
return;
}
$isLike = $this->config->getOperator() === FilterConfig::OPERATOR_LIKE;
if ($isLike && strpos($value, '%') === false) {
$value = "%$value%";
}
$this->grid->getConfig()->getDataProvider()->filter(
$this->config->getName(),
$this->config->getOperator(),
$value
);
} | php | public function apply()
{
$value = $this->getValue();
if (null === $value || '' === $value) {
return;
}
if ($func = $this->config->getFilteringFunc()) {
$func($value, $this->grid->getConfig()->getDataProvider());
return;
}
$isLike = $this->config->getOperator() === FilterConfig::OPERATOR_LIKE;
if ($isLike && strpos($value, '%') === false) {
$value = "%$value%";
}
$this->grid->getConfig()->getDataProvider()->filter(
$this->config->getName(),
$this->config->getOperator(),
$value
);
} | [
"public",
"function",
"apply",
"(",
")",
"{",
"$",
"value",
"=",
"$",
"this",
"->",
"getValue",
"(",
")",
";",
"if",
"(",
"null",
"===",
"$",
"value",
"||",
"''",
"===",
"$",
"value",
")",
"{",
"return",
";",
"}",
"if",
"(",
"$",
"func",
"=",
... | Applies filtering to data source. | [
"Applies",
"filtering",
"to",
"data",
"source",
"."
] | train | https://github.com/Nayjest/Grids/blob/06f0a3d1b62844006d7c5e177e554dba0933d18e/src/Filter.php#L104-L123 |
Nayjest/Grids | src/Grid.php | Grid.provideName | protected function provideName()
{
$bt_len = 10;
$backtrace = debug_backtrace(null, $bt_len);
$str = '';
for ($id = 2; $id < $bt_len; $id++) {
$trace = isset($backtrace[$id]) ? $backtrace[$id] : [];
if (empty($trace['class']) || !$this instanceof $trace['class']) {
# may be closure
if (isset($trace['file'], $trace['line'])) {
$str .= $trace['file'] . $trace['line'];
}
}
}
$this->config->setName(substr(md5($str), 0, 16));
} | php | protected function provideName()
{
$bt_len = 10;
$backtrace = debug_backtrace(null, $bt_len);
$str = '';
for ($id = 2; $id < $bt_len; $id++) {
$trace = isset($backtrace[$id]) ? $backtrace[$id] : [];
if (empty($trace['class']) || !$this instanceof $trace['class']) {
# may be closure
if (isset($trace['file'], $trace['line'])) {
$str .= $trace['file'] . $trace['line'];
}
}
}
$this->config->setName(substr(md5($str), 0, 16));
} | [
"protected",
"function",
"provideName",
"(",
")",
"{",
"$",
"bt_len",
"=",
"10",
";",
"$",
"backtrace",
"=",
"debug_backtrace",
"(",
"null",
",",
"$",
"bt_len",
")",
";",
"$",
"str",
"=",
"''",
";",
"for",
"(",
"$",
"id",
"=",
"2",
";",
"$",
"id"... | Provides unique name for each grid on the page
@return null | [
"Provides",
"unique",
"name",
"for",
"each",
"grid",
"on",
"the",
"page"
] | train | https://github.com/Nayjest/Grids/blob/06f0a3d1b62844006d7c5e177e554dba0933d18e/src/Grid.php#L91-L106 |
Nayjest/Grids | src/Grid.php | Grid.needToSortColumns | protected function needToSortColumns()
{
foreach ($this->config->getColumns() as $column) {
if ($column->getOrder() !== 0) {
return true;
}
}
return false;
} | php | protected function needToSortColumns()
{
foreach ($this->config->getColumns() as $column) {
if ($column->getOrder() !== 0) {
return true;
}
}
return false;
} | [
"protected",
"function",
"needToSortColumns",
"(",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"config",
"->",
"getColumns",
"(",
")",
"as",
"$",
"column",
")",
"{",
"if",
"(",
"$",
"column",
"->",
"getOrder",
"(",
")",
"!==",
"0",
")",
"{",
"return... | Returns true if columns must be sorted.
@return bool | [
"Returns",
"true",
"if",
"columns",
"must",
"be",
"sorted",
"."
] | train | https://github.com/Nayjest/Grids/blob/06f0a3d1b62844006d7c5e177e554dba0933d18e/src/Grid.php#L113-L121 |
Nayjest/Grids | src/Grid.php | Grid.sortColumns | protected function sortColumns()
{
$this->config->getColumns()->sort(function (FieldConfig $a, FieldConfig $b) {
return $a->getOrder() > $b->getOrder();
});
} | php | protected function sortColumns()
{
$this->config->getColumns()->sort(function (FieldConfig $a, FieldConfig $b) {
return $a->getOrder() > $b->getOrder();
});
} | [
"protected",
"function",
"sortColumns",
"(",
")",
"{",
"$",
"this",
"->",
"config",
"->",
"getColumns",
"(",
")",
"->",
"sort",
"(",
"function",
"(",
"FieldConfig",
"$",
"a",
",",
"FieldConfig",
"$",
"b",
")",
"{",
"return",
"$",
"a",
"->",
"getOrder",... | Sorts columns according to its order. | [
"Sorts",
"columns",
"according",
"to",
"its",
"order",
"."
] | train | https://github.com/Nayjest/Grids/blob/06f0a3d1b62844006d7c5e177e554dba0933d18e/src/Grid.php#L126-L131 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.