id int32 0 241k | repo stringlengths 6 63 | path stringlengths 5 140 | func_name stringlengths 3 151 | original_string stringlengths 84 13k | language stringclasses 1
value | code stringlengths 84 13k | code_tokens list | docstring stringlengths 3 47.2k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 91 247 |
|---|---|---|---|---|---|---|---|---|---|---|---|
188,500 | wormling/phparia | src/wormling/phparia/Api/Asterisk.php | Asterisk.getModule | public function getModule($moduleName)
{
$uri = "asterisk/module/$moduleName";
$response = $this->client->getEndpoint()->get($uri);
return new Module(\GuzzleHttp\json_decode($response->getBody()));
} | php | public function getModule($moduleName)
{
$uri = "asterisk/module/$moduleName";
$response = $this->client->getEndpoint()->get($uri);
return new Module(\GuzzleHttp\json_decode($response->getBody()));
} | [
"public",
"function",
"getModule",
"(",
"$",
"moduleName",
")",
"{",
"$",
"uri",
"=",
"\"asterisk/module/$moduleName\"",
";",
"$",
"response",
"=",
"$",
"this",
"->",
"client",
"->",
"getEndpoint",
"(",
")",
"->",
"get",
"(",
"$",
"uri",
")",
";",
"retur... | Get Asterisk module information.
@param string $moduleName Module's name
@return Module
@throws NotFoundException
@throws ConflictException | [
"Get",
"Asterisk",
"module",
"information",
"."
] | 955f9c01bd6001f11776273e262dbed0b7eb74d0 | https://github.com/wormling/phparia/blob/955f9c01bd6001f11776273e262dbed0b7eb74d0/src/wormling/phparia/Api/Asterisk.php#L172-L179 |
188,501 | wormling/phparia | src/wormling/phparia/Api/Asterisk.php | Asterisk.listLogChannels | public function listLogChannels()
{
$uri = 'asterisk/logging';
$response = $this->client->getEndpoint()->get($uri);
$logChannels = [];
foreach (\GuzzleHttp\json_decode($response->getBody()) as $logChannel) {
$logChannels[] = new Module($logChannel);
}
r... | php | public function listLogChannels()
{
$uri = 'asterisk/logging';
$response = $this->client->getEndpoint()->get($uri);
$logChannels = [];
foreach (\GuzzleHttp\json_decode($response->getBody()) as $logChannel) {
$logChannels[] = new Module($logChannel);
}
r... | [
"public",
"function",
"listLogChannels",
"(",
")",
"{",
"$",
"uri",
"=",
"'asterisk/logging'",
";",
"$",
"response",
"=",
"$",
"this",
"->",
"client",
"->",
"getEndpoint",
"(",
")",
"->",
"get",
"(",
"$",
"uri",
")",
";",
"$",
"logChannels",
"=",
"[",
... | Gets Asterisk log channel information.
@return LogChannel[] | [
"Gets",
"Asterisk",
"log",
"channel",
"information",
"."
] | 955f9c01bd6001f11776273e262dbed0b7eb74d0 | https://github.com/wormling/phparia/blob/955f9c01bd6001f11776273e262dbed0b7eb74d0/src/wormling/phparia/Api/Asterisk.php#L230-L242 |
188,502 | wormling/phparia | src/wormling/phparia/Api/Asterisk.php | Asterisk.addLog | public function addLog($logChannelName, $configuration)
{
$uri = "asterisk/logging/$logChannelName";
try {
$this->client->getEndpoint()->post($uri, [
'form_params' => [
'configuration' => $configuration
]
]);
} catc... | php | public function addLog($logChannelName, $configuration)
{
$uri = "asterisk/logging/$logChannelName";
try {
$this->client->getEndpoint()->post($uri, [
'form_params' => [
'configuration' => $configuration
]
]);
} catc... | [
"public",
"function",
"addLog",
"(",
"$",
"logChannelName",
",",
"$",
"configuration",
")",
"{",
"$",
"uri",
"=",
"\"asterisk/logging/$logChannelName\"",
";",
"try",
"{",
"$",
"this",
"->",
"client",
"->",
"getEndpoint",
"(",
")",
"->",
"post",
"(",
"$",
"... | Adds a log channel.
@param string $logChannelName
@param string $configuration
@throws InvalidParameterException
@throws ConflictException | [
"Adds",
"a",
"log",
"channel",
"."
] | 955f9c01bd6001f11776273e262dbed0b7eb74d0 | https://github.com/wormling/phparia/blob/955f9c01bd6001f11776273e262dbed0b7eb74d0/src/wormling/phparia/Api/Asterisk.php#L252-L265 |
188,503 | wormling/phparia | src/wormling/phparia/Api/Asterisk.php | Asterisk.deleteLog | public function deleteLog($logChannelName)
{
$uri = "asterisk/logging/$logChannelName";
try {
$this->client->getEndpoint()->delete($uri);
} catch (RequestException $e) {
$this->processRequestException($e);
}
} | php | public function deleteLog($logChannelName)
{
$uri = "asterisk/logging/$logChannelName";
try {
$this->client->getEndpoint()->delete($uri);
} catch (RequestException $e) {
$this->processRequestException($e);
}
} | [
"public",
"function",
"deleteLog",
"(",
"$",
"logChannelName",
")",
"{",
"$",
"uri",
"=",
"\"asterisk/logging/$logChannelName\"",
";",
"try",
"{",
"$",
"this",
"->",
"client",
"->",
"getEndpoint",
"(",
")",
"->",
"delete",
"(",
"$",
"uri",
")",
";",
"}",
... | Deletes a log channel.
@param string $logChannelName
@throws NotFoundException | [
"Deletes",
"a",
"log",
"channel",
"."
] | 955f9c01bd6001f11776273e262dbed0b7eb74d0 | https://github.com/wormling/phparia/blob/955f9c01bd6001f11776273e262dbed0b7eb74d0/src/wormling/phparia/Api/Asterisk.php#L273-L282 |
188,504 | wormling/phparia | src/wormling/phparia/Api/Asterisk.php | Asterisk.rotateLog | public function rotateLog($logChannelName)
{
$uri = "asterisk/logging/$logChannelName";
try {
$this->client->getEndpoint()->put($uri);
} catch (RequestException $e) {
$this->processRequestException($e);
}
} | php | public function rotateLog($logChannelName)
{
$uri = "asterisk/logging/$logChannelName";
try {
$this->client->getEndpoint()->put($uri);
} catch (RequestException $e) {
$this->processRequestException($e);
}
} | [
"public",
"function",
"rotateLog",
"(",
"$",
"logChannelName",
")",
"{",
"$",
"uri",
"=",
"\"asterisk/logging/$logChannelName\"",
";",
"try",
"{",
"$",
"this",
"->",
"client",
"->",
"getEndpoint",
"(",
")",
"->",
"put",
"(",
"$",
"uri",
")",
";",
"}",
"c... | Rotates a log channel.
@param string $logChannelName
@throws NotFoundException | [
"Rotates",
"a",
"log",
"channel",
"."
] | 955f9c01bd6001f11776273e262dbed0b7eb74d0 | https://github.com/wormling/phparia/blob/955f9c01bd6001f11776273e262dbed0b7eb74d0/src/wormling/phparia/Api/Asterisk.php#L290-L299 |
188,505 | wormling/phparia | src/wormling/phparia/Api/Asterisk.php | Asterisk.getGlobalVar | public function getGlobalVar($variable)
{
$uri = "asterisk/variable?variable=$variable";
try {
$response = $this->client->getEndpoint()->get($uri);
} catch (RequestException $e) {
$this->processRequestException($e);
}
return new Variable(\GuzzleHttp\... | php | public function getGlobalVar($variable)
{
$uri = "asterisk/variable?variable=$variable";
try {
$response = $this->client->getEndpoint()->get($uri);
} catch (RequestException $e) {
$this->processRequestException($e);
}
return new Variable(\GuzzleHttp\... | [
"public",
"function",
"getGlobalVar",
"(",
"$",
"variable",
")",
"{",
"$",
"uri",
"=",
"\"asterisk/variable?variable=$variable\"",
";",
"try",
"{",
"$",
"response",
"=",
"$",
"this",
"->",
"client",
"->",
"getEndpoint",
"(",
")",
"->",
"get",
"(",
"$",
"ur... | Get the value of a global variable.
@param string $variable (required) The variable to get
@return Variable
@throws InvalidParameterException | [
"Get",
"the",
"value",
"of",
"a",
"global",
"variable",
"."
] | 955f9c01bd6001f11776273e262dbed0b7eb74d0 | https://github.com/wormling/phparia/blob/955f9c01bd6001f11776273e262dbed0b7eb74d0/src/wormling/phparia/Api/Asterisk.php#L308-L319 |
188,506 | wormling/phparia | src/wormling/phparia/Api/Asterisk.php | Asterisk.setGlobalVar | public function setGlobalVar($variable, $value = null)
{
$uri = 'asterisk/variable';
try {
$this->client->getEndpoint()->post($uri, [
'form_params' => [
'variable' => $variable,
'value' => $value
]
]);
... | php | public function setGlobalVar($variable, $value = null)
{
$uri = 'asterisk/variable';
try {
$this->client->getEndpoint()->post($uri, [
'form_params' => [
'variable' => $variable,
'value' => $value
]
]);
... | [
"public",
"function",
"setGlobalVar",
"(",
"$",
"variable",
",",
"$",
"value",
"=",
"null",
")",
"{",
"$",
"uri",
"=",
"'asterisk/variable'",
";",
"try",
"{",
"$",
"this",
"->",
"client",
"->",
"getEndpoint",
"(",
")",
"->",
"post",
"(",
"$",
"uri",
... | Set the value of a global variable.
@param string $variable (required) The variable to set
@param string $value The value to set the variable to
@throws InvalidParameterException | [
"Set",
"the",
"value",
"of",
"a",
"global",
"variable",
"."
] | 955f9c01bd6001f11776273e262dbed0b7eb74d0 | https://github.com/wormling/phparia/blob/955f9c01bd6001f11776273e262dbed0b7eb74d0/src/wormling/phparia/Api/Asterisk.php#L341-L355 |
188,507 | wormling/phparia | src/wormling/phparia/Api/Playbacks.php | Playbacks.getPlayback | public function getPlayback($playbackId)
{
$uri = "playbacks/$playbackId";
try {
$response = $this->client->getEndpoint()->get($uri);
} catch (RequestException $e) {
$this->processRequestException($e);
}
return new Playback($this->client, \GuzzleHttp\... | php | public function getPlayback($playbackId)
{
$uri = "playbacks/$playbackId";
try {
$response = $this->client->getEndpoint()->get($uri);
} catch (RequestException $e) {
$this->processRequestException($e);
}
return new Playback($this->client, \GuzzleHttp\... | [
"public",
"function",
"getPlayback",
"(",
"$",
"playbackId",
")",
"{",
"$",
"uri",
"=",
"\"playbacks/$playbackId\"",
";",
"try",
"{",
"$",
"response",
"=",
"$",
"this",
"->",
"client",
"->",
"getEndpoint",
"(",
")",
"->",
"get",
"(",
"$",
"uri",
")",
"... | Get a playback's details.
@param string $playbackId Playback's id
@return Playback
@throws NotFoundException | [
"Get",
"a",
"playback",
"s",
"details",
"."
] | 955f9c01bd6001f11776273e262dbed0b7eb74d0 | https://github.com/wormling/phparia/blob/955f9c01bd6001f11776273e262dbed0b7eb74d0/src/wormling/phparia/Api/Playbacks.php#L48-L58 |
188,508 | wormling/phparia | src/wormling/phparia/Api/Playbacks.php | Playbacks.stopPlayback | public function stopPlayback($playbackId)
{
$uri = "playbacks/$playbackId";
try {
$this->client->getEndpoint()->delete($uri);
} catch (RequestException $e) {
$this->processRequestException($e);
}
} | php | public function stopPlayback($playbackId)
{
$uri = "playbacks/$playbackId";
try {
$this->client->getEndpoint()->delete($uri);
} catch (RequestException $e) {
$this->processRequestException($e);
}
} | [
"public",
"function",
"stopPlayback",
"(",
"$",
"playbackId",
")",
"{",
"$",
"uri",
"=",
"\"playbacks/$playbackId\"",
";",
"try",
"{",
"$",
"this",
"->",
"client",
"->",
"getEndpoint",
"(",
")",
"->",
"delete",
"(",
"$",
"uri",
")",
";",
"}",
"catch",
... | Stop a playback.
@param string $playbackId Playback's id
@throws NotFoundException | [
"Stop",
"a",
"playback",
"."
] | 955f9c01bd6001f11776273e262dbed0b7eb74d0 | https://github.com/wormling/phparia/blob/955f9c01bd6001f11776273e262dbed0b7eb74d0/src/wormling/phparia/Api/Playbacks.php#L66-L74 |
188,509 | wormling/phparia | src/wormling/phparia/Api/Playbacks.php | Playbacks.controlPlayback | public function controlPlayback($playbackId, $operation)
{
$uri = "playbacks/$playbackId/control";
try {
$this->client->getEndpoint()->post($uri, [
'form_params' => [
'operation' => $operation,
]
]);
} catch (Request... | php | public function controlPlayback($playbackId, $operation)
{
$uri = "playbacks/$playbackId/control";
try {
$this->client->getEndpoint()->post($uri, [
'form_params' => [
'operation' => $operation,
]
]);
} catch (Request... | [
"public",
"function",
"controlPlayback",
"(",
"$",
"playbackId",
",",
"$",
"operation",
")",
"{",
"$",
"uri",
"=",
"\"playbacks/$playbackId/control\"",
";",
"try",
"{",
"$",
"this",
"->",
"client",
"->",
"getEndpoint",
"(",
")",
"->",
"post",
"(",
"$",
"ur... | Control a playback.
@param string $playbackId Playback's id
@param string $operation (required) Operation to perform on the playback. Allowed values: restart, pause, unpause, reverse, forward.
@throws ConflictException
@throws InvalidParameterException
@throws NotFoundException | [
"Control",
"a",
"playback",
"."
] | 955f9c01bd6001f11776273e262dbed0b7eb74d0 | https://github.com/wormling/phparia/blob/955f9c01bd6001f11776273e262dbed0b7eb74d0/src/wormling/phparia/Api/Playbacks.php#L85-L97 |
188,510 | wormling/phparia | src/wormling/phparia/Client/Phparia.php | Phparia.connect | public function connect($ariAddress, $amiAddress = null, $streamOptions = [], $clientOptions = [])
{
$this->ariClient->connect($ariAddress, $streamOptions, $clientOptions);
$this->wsClient = $this->ariClient->getWsClient();
$this->stasisApplicationName = $this->ariClient->getStasisApplicatio... | php | public function connect($ariAddress, $amiAddress = null, $streamOptions = [], $clientOptions = [])
{
$this->ariClient->connect($ariAddress, $streamOptions, $clientOptions);
$this->wsClient = $this->ariClient->getWsClient();
$this->stasisApplicationName = $this->ariClient->getStasisApplicatio... | [
"public",
"function",
"connect",
"(",
"$",
"ariAddress",
",",
"$",
"amiAddress",
"=",
"null",
",",
"$",
"streamOptions",
"=",
"[",
"]",
",",
"$",
"clientOptions",
"=",
"[",
"]",
")",
"{",
"$",
"this",
"->",
"ariClient",
"->",
"connect",
"(",
"$",
"ar... | Connect to ARI and optionally AMI
@param string $ariAddress
@param string|null $amiAddress
@param array $streamOptions Example: ['ssl' => ['verify_peer' => false, 'verify_peer_name' => false]];
@param array $clientOptions Example: ['verify' => false]; | [
"Connect",
"to",
"ARI",
"and",
"optionally",
"AMI"
] | 955f9c01bd6001f11776273e262dbed0b7eb74d0 | https://github.com/wormling/phparia/blob/955f9c01bd6001f11776273e262dbed0b7eb74d0/src/wormling/phparia/Client/Phparia.php#L83-L95 |
188,511 | wormling/phparia | src/wormling/phparia/Client/Phparia.php | Phparia.stop | public function stop()
{
$deferred = new Deferred();
$onStop = $this->onStop;
$onStop()
->then(function () use (&$deferred) {
$this->ariClient->onClose(function () use (&$deferred) {
$this->eventLoop->stop();
$deferred->res... | php | public function stop()
{
$deferred = new Deferred();
$onStop = $this->onStop;
$onStop()
->then(function () use (&$deferred) {
$this->ariClient->onClose(function () use (&$deferred) {
$this->eventLoop->stop();
$deferred->res... | [
"public",
"function",
"stop",
"(",
")",
"{",
"$",
"deferred",
"=",
"new",
"Deferred",
"(",
")",
";",
"$",
"onStop",
"=",
"$",
"this",
"->",
"onStop",
";",
"$",
"onStop",
"(",
")",
"->",
"then",
"(",
"function",
"(",
")",
"use",
"(",
"&",
"$",
"... | Disconnect and stop the event loop
@return \React\Promise\Promise|\React\Promise\PromiseInterface | [
"Disconnect",
"and",
"stop",
"the",
"event",
"loop"
] | 955f9c01bd6001f11776273e262dbed0b7eb74d0 | https://github.com/wormling/phparia/blob/955f9c01bd6001f11776273e262dbed0b7eb74d0/src/wormling/phparia/Client/Phparia.php#L110-L125 |
188,512 | wormling/phparia | src/wormling/phparia/Api/Sounds.php | Sounds.getSounds | public function getSounds()
{
$uri = 'sounds';
$response = $this->client->getEndpoint()->get($uri);
$sounds = [];
foreach (\GuzzleHttp\json_decode($response->getBody()) as $sound) {
$sounds[] = new Sound($sound);
}
return $sounds;
} | php | public function getSounds()
{
$uri = 'sounds';
$response = $this->client->getEndpoint()->get($uri);
$sounds = [];
foreach (\GuzzleHttp\json_decode($response->getBody()) as $sound) {
$sounds[] = new Sound($sound);
}
return $sounds;
} | [
"public",
"function",
"getSounds",
"(",
")",
"{",
"$",
"uri",
"=",
"'sounds'",
";",
"$",
"response",
"=",
"$",
"this",
"->",
"client",
"->",
"getEndpoint",
"(",
")",
"->",
"get",
"(",
"$",
"uri",
")",
";",
"$",
"sounds",
"=",
"[",
"]",
";",
"fore... | List all sounds.
@return Sound[] | [
"List",
"all",
"sounds",
"."
] | 955f9c01bd6001f11776273e262dbed0b7eb74d0 | https://github.com/wormling/phparia/blob/955f9c01bd6001f11776273e262dbed0b7eb74d0/src/wormling/phparia/Api/Sounds.php#L36-L47 |
188,513 | wormling/phparia | src/wormling/phparia/Api/Sounds.php | Sounds.getSound | public function getSound($soundId)
{
$uri = "sounds/$soundId";
$response = $this->client->getEndpoint()->get($uri);
return new Sound(\GuzzleHttp\json_decode($response->getBody()));
} | php | public function getSound($soundId)
{
$uri = "sounds/$soundId";
$response = $this->client->getEndpoint()->get($uri);
return new Sound(\GuzzleHttp\json_decode($response->getBody()));
} | [
"public",
"function",
"getSound",
"(",
"$",
"soundId",
")",
"{",
"$",
"uri",
"=",
"\"sounds/$soundId\"",
";",
"$",
"response",
"=",
"$",
"this",
"->",
"client",
"->",
"getEndpoint",
"(",
")",
"->",
"get",
"(",
"$",
"uri",
")",
";",
"return",
"new",
"... | Get a sound's details.
@param string $soundId Sound's id
@return Sound | [
"Get",
"a",
"sound",
"s",
"details",
"."
] | 955f9c01bd6001f11776273e262dbed0b7eb74d0 | https://github.com/wormling/phparia/blob/955f9c01bd6001f11776273e262dbed0b7eb74d0/src/wormling/phparia/Api/Sounds.php#L55-L61 |
188,514 | wormling/phparia | src/wormling/phparia/Client/AriClient.php | AriClient.connect | public function connect($address, array $streamOptions = [], $httpOptions = [])
{
$components = parse_url($address);
$scheme = $components['scheme'];
$host = $components['host'];
$port = $components['port'];
$path = $components['path'];
$query = $components['query'];
... | php | public function connect($address, array $streamOptions = [], $httpOptions = [])
{
$components = parse_url($address);
$scheme = $components['scheme'];
$host = $components['host'];
$port = $components['port'];
$path = $components['path'];
$query = $components['query'];
... | [
"public",
"function",
"connect",
"(",
"$",
"address",
",",
"array",
"$",
"streamOptions",
"=",
"[",
"]",
",",
"$",
"httpOptions",
"=",
"[",
"]",
")",
"{",
"$",
"components",
"=",
"parse_url",
"(",
"$",
"address",
")",
";",
"$",
"scheme",
"=",
"$",
... | Connect to ARI.
@param string $address Example ws://localhost:8088/ari/events?api_key=username:password&app=stasis_app_name
@param array $streamOptions Such as ['ssl' => ['verify_peer' => false, 'verify_peer_name' => false]];
@param array $httpOptions Such as ['verify' => false]; | [
"Connect",
"to",
"ARI",
"."
] | 955f9c01bd6001f11776273e262dbed0b7eb74d0 | https://github.com/wormling/phparia/blob/955f9c01bd6001f11776273e262dbed0b7eb74d0/src/wormling/phparia/Client/AriClient.php#L139-L189 |
188,515 | wormling/phparia | src/wormling/phparia/Client/AmiClient.php | AmiClient.connect | public function connect($address)
{
$factory = new Factory($this->eventLoop);
return $factory->createClient($address)
->then(function (Client $client) {
$this->amiClient = $client;
$this->actionSender = new ActionSender($client);
$this->ac... | php | public function connect($address)
{
$factory = new Factory($this->eventLoop);
return $factory->createClient($address)
->then(function (Client $client) {
$this->amiClient = $client;
$this->actionSender = new ActionSender($client);
$this->ac... | [
"public",
"function",
"connect",
"(",
"$",
"address",
")",
"{",
"$",
"factory",
"=",
"new",
"Factory",
"(",
"$",
"this",
"->",
"eventLoop",
")",
";",
"return",
"$",
"factory",
"->",
"createClient",
"(",
"$",
"address",
")",
"->",
"then",
"(",
"function... | Connect to AMI and start emitting events.
@param string $address Example uaername:password@localhost:5038
@return \React\Promise\Promise | [
"Connect",
"to",
"AMI",
"and",
"start",
"emitting",
"events",
"."
] | 955f9c01bd6001f11776273e262dbed0b7eb74d0 | https://github.com/wormling/phparia/blob/955f9c01bd6001f11776273e262dbed0b7eb74d0/src/wormling/phparia/Client/AmiClient.php#L74-L92 |
188,516 | gidkom/php-openfire-restapi | src/Gidkom/OpenFireRestApi/OpenFireRestApi.php | OpenFireRestApi.getUsers | public function getUsers($opts = [])
{
$query = '';
if(isset($opts['search'])) $query .= '?search='.$opts['search'];
$endpoint = '/users'.$query;
return $this->doRequest('GET', $endpoint);
} | php | public function getUsers($opts = [])
{
$query = '';
if(isset($opts['search'])) $query .= '?search='.$opts['search'];
$endpoint = '/users'.$query;
return $this->doRequest('GET', $endpoint);
} | [
"public",
"function",
"getUsers",
"(",
"$",
"opts",
"=",
"[",
"]",
")",
"{",
"$",
"query",
"=",
"''",
";",
"if",
"(",
"isset",
"(",
"$",
"opts",
"[",
"'search'",
"]",
")",
")",
"$",
"query",
".=",
"'?search='",
".",
"$",
"opts",
"[",
"'search'",
... | Get all registered users
@return json|false Json with data or error, or False when something went fully wrong | [
"Get",
"all",
"registered",
"users"
] | 4424094d9f97ad65145b30f840cb9276af9a3b53 | https://github.com/gidkom/php-openfire-restapi/blob/4424094d9f97ad65145b30f840cb9276af9a3b53/src/Gidkom/OpenFireRestApi/OpenFireRestApi.php#L24-L32 |
188,517 | gidkom/php-openfire-restapi | src/Gidkom/OpenFireRestApi/OpenFireRestApi.php | OpenFireRestApi.updateUser | public function updateUser($username, $password, $name=false, $email=false, $groups=false)
{
$endpoint = '/users/'.$username;
return $this->doRequest('PUT', $endpoint, compact('username', 'password','name','email', 'groups'));
} | php | public function updateUser($username, $password, $name=false, $email=false, $groups=false)
{
$endpoint = '/users/'.$username;
return $this->doRequest('PUT', $endpoint, compact('username', 'password','name','email', 'groups'));
} | [
"public",
"function",
"updateUser",
"(",
"$",
"username",
",",
"$",
"password",
",",
"$",
"name",
"=",
"false",
",",
"$",
"email",
"=",
"false",
",",
"$",
"groups",
"=",
"false",
")",
"{",
"$",
"endpoint",
"=",
"'/users/'",
".",
"$",
"username",
";",... | Updates an OpenFire user
@param string $username Username
@param string|false $password Password (Optional)
@param string|false $name Name (Optional)
@param string|false $email Email (Optional)
@param string[]|false $groups Groups (Optional)
@return json|false ... | [
"Updates",
"an",
"OpenFire",
"user"
] | 4424094d9f97ad65145b30f840cb9276af9a3b53 | https://github.com/gidkom/php-openfire-restapi/blob/4424094d9f97ad65145b30f840cb9276af9a3b53/src/Gidkom/OpenFireRestApi/OpenFireRestApi.php#L86-L90 |
188,518 | gidkom/php-openfire-restapi | src/Gidkom/OpenFireRestApi/OpenFireRestApi.php | OpenFireRestApi.addToRoster | public function addToRoster($username, $jid, $name=false, $subscriptionType=false)
{
$endpoint = '/users/'.$username.'/roster';
return $this->doRequest('POST', $endpoint, compact('jid','name','subscriptionType'));
} | php | public function addToRoster($username, $jid, $name=false, $subscriptionType=false)
{
$endpoint = '/users/'.$username.'/roster';
return $this->doRequest('POST', $endpoint, compact('jid','name','subscriptionType'));
} | [
"public",
"function",
"addToRoster",
"(",
"$",
"username",
",",
"$",
"jid",
",",
"$",
"name",
"=",
"false",
",",
"$",
"subscriptionType",
"=",
"false",
")",
"{",
"$",
"endpoint",
"=",
"'/users/'",
".",
"$",
"username",
".",
"'/roster'",
";",
"return",
... | Adds to this OpenFire user's roster
@param string $username Username
@param string $jid JID
@param string|false $name Name (Optional)
@param int|false $subscriptionType Subscription (Optional)
@return json|false Json wit... | [
"Adds",
"to",
"this",
"OpenFire",
"user",
"s",
"roster"
] | 4424094d9f97ad65145b30f840cb9276af9a3b53 | https://github.com/gidkom/php-openfire-restapi/blob/4424094d9f97ad65145b30f840cb9276af9a3b53/src/Gidkom/OpenFireRestApi/OpenFireRestApi.php#L194-L198 |
188,519 | gidkom/php-openfire-restapi | src/Gidkom/OpenFireRestApi/OpenFireRestApi.php | OpenFireRestApi.deleteFromRoster | public function deleteFromRoster($username, $jid)
{
$endpoint = '/users/'.$username.'/roster/'.$jid;
return $this->doRequest('DELETE', $endpoint, $jid);
} | php | public function deleteFromRoster($username, $jid)
{
$endpoint = '/users/'.$username.'/roster/'.$jid;
return $this->doRequest('DELETE', $endpoint, $jid);
} | [
"public",
"function",
"deleteFromRoster",
"(",
"$",
"username",
",",
"$",
"jid",
")",
"{",
"$",
"endpoint",
"=",
"'/users/'",
".",
"$",
"username",
".",
"'/roster/'",
".",
"$",
"jid",
";",
"return",
"$",
"this",
"->",
"doRequest",
"(",
"'DELETE'",
",",
... | Removes from this OpenFire user's roster
@param string $username Username
@param string $jid JID
@return json|false Json with data or error, or False when something went fully wrong | [
"Removes",
"from",
"this",
"OpenFire",
"user",
"s",
"roster"
] | 4424094d9f97ad65145b30f840cb9276af9a3b53 | https://github.com/gidkom/php-openfire-restapi/blob/4424094d9f97ad65145b30f840cb9276af9a3b53/src/Gidkom/OpenFireRestApi/OpenFireRestApi.php#L208-L212 |
188,520 | gidkom/php-openfire-restapi | src/Gidkom/OpenFireRestApi/OpenFireRestApi.php | OpenFireRestApi.updateRoster | public function updateRoster($username, $jid, $nickname=false, $subscriptionType=false)
{
$endpoint = '/users/'.$username.'/roster/'.$jid;
return $this->doRequest('PUT', $endpoint, $jid, compact('jid','username','subscriptionType'));
} | php | public function updateRoster($username, $jid, $nickname=false, $subscriptionType=false)
{
$endpoint = '/users/'.$username.'/roster/'.$jid;
return $this->doRequest('PUT', $endpoint, $jid, compact('jid','username','subscriptionType'));
} | [
"public",
"function",
"updateRoster",
"(",
"$",
"username",
",",
"$",
"jid",
",",
"$",
"nickname",
"=",
"false",
",",
"$",
"subscriptionType",
"=",
"false",
")",
"{",
"$",
"endpoint",
"=",
"'/users/'",
".",
"$",
"username",
".",
"'/roster/'",
".",
"$",
... | Updates this OpenFire user's roster
@param string $username Username
@param string $jid JID
@param string|false $nickname Nick Name (Optional)
@param int|false $subscriptionType Subscription (Optional)
@return json|false ... | [
"Updates",
"this",
"OpenFire",
"user",
"s",
"roster"
] | 4424094d9f97ad65145b30f840cb9276af9a3b53 | https://github.com/gidkom/php-openfire-restapi/blob/4424094d9f97ad65145b30f840cb9276af9a3b53/src/Gidkom/OpenFireRestApi/OpenFireRestApi.php#L223-L227 |
188,521 | wormling/phparia | src/wormling/phparia/Api/Bridges.php | Bridges.getBridges | public function getBridges()
{
$uri = 'bridges';
$response = $this->client->getEndpoint()->get($uri);
$bridges = [];
foreach (\GuzzleHttp\json_decode($response->getBody()) as $bridge) {
$bridges[] = new Bridge($this->client, $bridge);
}
return $bridges;
... | php | public function getBridges()
{
$uri = 'bridges';
$response = $this->client->getEndpoint()->get($uri);
$bridges = [];
foreach (\GuzzleHttp\json_decode($response->getBody()) as $bridge) {
$bridges[] = new Bridge($this->client, $bridge);
}
return $bridges;
... | [
"public",
"function",
"getBridges",
"(",
")",
"{",
"$",
"uri",
"=",
"'bridges'",
";",
"$",
"response",
"=",
"$",
"this",
"->",
"client",
"->",
"getEndpoint",
"(",
")",
"->",
"get",
"(",
"$",
"uri",
")",
";",
"$",
"bridges",
"=",
"[",
"]",
";",
"f... | List all active bridges in Asterisk.
@return Bridge[] | [
"List",
"all",
"active",
"bridges",
"in",
"Asterisk",
"."
] | 955f9c01bd6001f11776273e262dbed0b7eb74d0 | https://github.com/wormling/phparia/blob/955f9c01bd6001f11776273e262dbed0b7eb74d0/src/wormling/phparia/Api/Bridges.php#L40-L51 |
188,522 | wormling/phparia | src/wormling/phparia/Api/Bridges.php | Bridges.createBridge | public function createBridge($bridgeId, $type, $name)
{
$uri = 'bridges';
$response = $this->client->getEndpoint()->post($uri, [
'form_params' => [
'bridgeId' => $bridgeId,
'type' => $type,
'name' => $name,
]
]);
... | php | public function createBridge($bridgeId, $type, $name)
{
$uri = 'bridges';
$response = $this->client->getEndpoint()->post($uri, [
'form_params' => [
'bridgeId' => $bridgeId,
'type' => $type,
'name' => $name,
]
]);
... | [
"public",
"function",
"createBridge",
"(",
"$",
"bridgeId",
",",
"$",
"type",
",",
"$",
"name",
")",
"{",
"$",
"uri",
"=",
"'bridges'",
";",
"$",
"response",
"=",
"$",
"this",
"->",
"client",
"->",
"getEndpoint",
"(",
")",
"->",
"post",
"(",
"$",
"... | Create a new bridge. This bridge persists until it has been shut down, or Asterisk has been shut down.
@param string $bridgeId Unique ID to give to the bridge being created.
@param string $type Comma separated list of bridge type attributes (mixing, holding, dtmf_events, proxy_media).
@param string $name Name to give ... | [
"Create",
"a",
"new",
"bridge",
".",
"This",
"bridge",
"persists",
"until",
"it",
"has",
"been",
"shut",
"down",
"or",
"Asterisk",
"has",
"been",
"shut",
"down",
"."
] | 955f9c01bd6001f11776273e262dbed0b7eb74d0 | https://github.com/wormling/phparia/blob/955f9c01bd6001f11776273e262dbed0b7eb74d0/src/wormling/phparia/Api/Bridges.php#L61-L73 |
188,523 | wormling/phparia | src/wormling/phparia/Api/Bridges.php | Bridges.getBridge | public function getBridge($bridgeId)
{
$uri = "bridges/$bridgeId";
try {
$response = $this->client->getEndpoint()->get($uri);
} catch (RequestException $e) {
$this->processRequestException($e);
}
return new Bridge($this->client, \GuzzleHttp\json_decod... | php | public function getBridge($bridgeId)
{
$uri = "bridges/$bridgeId";
try {
$response = $this->client->getEndpoint()->get($uri);
} catch (RequestException $e) {
$this->processRequestException($e);
}
return new Bridge($this->client, \GuzzleHttp\json_decod... | [
"public",
"function",
"getBridge",
"(",
"$",
"bridgeId",
")",
"{",
"$",
"uri",
"=",
"\"bridges/$bridgeId\"",
";",
"try",
"{",
"$",
"response",
"=",
"$",
"this",
"->",
"client",
"->",
"getEndpoint",
"(",
")",
"->",
"get",
"(",
"$",
"uri",
")",
";",
"}... | Get bridge details.
@param string $bridgeId Bridge's id
@return Bridge
@throws NotFoundException | [
"Get",
"bridge",
"details",
"."
] | 955f9c01bd6001f11776273e262dbed0b7eb74d0 | https://github.com/wormling/phparia/blob/955f9c01bd6001f11776273e262dbed0b7eb74d0/src/wormling/phparia/Api/Bridges.php#L103-L113 |
188,524 | wormling/phparia | src/wormling/phparia/Api/Bridges.php | Bridges.deleteBridge | public function deleteBridge($bridgeId)
{
$uri = "bridges/$bridgeId";
try {
$this->client->getEndpoint()->delete($uri);
} catch (RequestException $e) {
$this->processRequestException($e);
}
} | php | public function deleteBridge($bridgeId)
{
$uri = "bridges/$bridgeId";
try {
$this->client->getEndpoint()->delete($uri);
} catch (RequestException $e) {
$this->processRequestException($e);
}
} | [
"public",
"function",
"deleteBridge",
"(",
"$",
"bridgeId",
")",
"{",
"$",
"uri",
"=",
"\"bridges/$bridgeId\"",
";",
"try",
"{",
"$",
"this",
"->",
"client",
"->",
"getEndpoint",
"(",
")",
"->",
"delete",
"(",
"$",
"uri",
")",
";",
"}",
"catch",
"(",
... | Shut down a bridge. If any channels are in this bridge, they will be removed and resume whatever they were doing beforehand.
@param string $bridgeId Bridge's id
@throws NotFoundException | [
"Shut",
"down",
"a",
"bridge",
".",
"If",
"any",
"channels",
"are",
"in",
"this",
"bridge",
"they",
"will",
"be",
"removed",
"and",
"resume",
"whatever",
"they",
"were",
"doing",
"beforehand",
"."
] | 955f9c01bd6001f11776273e262dbed0b7eb74d0 | https://github.com/wormling/phparia/blob/955f9c01bd6001f11776273e262dbed0b7eb74d0/src/wormling/phparia/Api/Bridges.php#L121-L129 |
188,525 | wormling/phparia | src/wormling/phparia/Api/Bridges.php | Bridges.removeChannel | public function removeChannel($bridgeId, $channel)
{
$uri = "bridges/$bridgeId/removeChannel";
try {
$this->client->getEndpoint()->post($uri, [
'form_params' => [
'channel' => $channel,
]
]);
} catch (RequestExceptio... | php | public function removeChannel($bridgeId, $channel)
{
$uri = "bridges/$bridgeId/removeChannel";
try {
$this->client->getEndpoint()->post($uri, [
'form_params' => [
'channel' => $channel,
]
]);
} catch (RequestExceptio... | [
"public",
"function",
"removeChannel",
"(",
"$",
"bridgeId",
",",
"$",
"channel",
")",
"{",
"$",
"uri",
"=",
"\"bridges/$bridgeId/removeChannel\"",
";",
"try",
"{",
"$",
"this",
"->",
"client",
"->",
"getEndpoint",
"(",
")",
"->",
"post",
"(",
"$",
"uri",
... | Remove a channel from a bridge.
@param string $bridgeId Bridge's id
@param string $channel (required) Ids of channels to remove from bridge. Allows comma separated values.
@throwe InvalidParameterException
@throws NotFoundException
@throws ConflictException
@throws UnprocessableEntityException | [
"Remove",
"a",
"channel",
"from",
"a",
"bridge",
"."
] | 955f9c01bd6001f11776273e262dbed0b7eb74d0 | https://github.com/wormling/phparia/blob/955f9c01bd6001f11776273e262dbed0b7eb74d0/src/wormling/phparia/Api/Bridges.php#L166-L178 |
188,526 | wormling/phparia | src/wormling/phparia/Api/Bridges.php | Bridges.setVideoSource | public function setVideoSource($id, $channelId)
{
$uri = "bridges/$id/videoSource/$channelId";
try {
$this->client->getEndpoint()->post($uri);
} catch (RequestException $e) {
$this->processRequestException($e);
}
} | php | public function setVideoSource($id, $channelId)
{
$uri = "bridges/$id/videoSource/$channelId";
try {
$this->client->getEndpoint()->post($uri);
} catch (RequestException $e) {
$this->processRequestException($e);
}
} | [
"public",
"function",
"setVideoSource",
"(",
"$",
"id",
",",
"$",
"channelId",
")",
"{",
"$",
"uri",
"=",
"\"bridges/$id/videoSource/$channelId\"",
";",
"try",
"{",
"$",
"this",
"->",
"client",
"->",
"getEndpoint",
"(",
")",
"->",
"post",
"(",
"$",
"uri",
... | Set a channel as the video source in a multi-party mixing bridge. This operation has no effect on bridges with
two or fewer participants.
@param string $id Bridge's id
@param string $channelId Channel's id
@throws NotFoundException
@throws ConflictException
@throws UnprocessableEntityException | [
"Set",
"a",
"channel",
"as",
"the",
"video",
"source",
"in",
"a",
"multi",
"-",
"party",
"mixing",
"bridge",
".",
"This",
"operation",
"has",
"no",
"effect",
"on",
"bridges",
"with",
"two",
"or",
"fewer",
"participants",
"."
] | 955f9c01bd6001f11776273e262dbed0b7eb74d0 | https://github.com/wormling/phparia/blob/955f9c01bd6001f11776273e262dbed0b7eb74d0/src/wormling/phparia/Api/Bridges.php#L190-L198 |
188,527 | wormling/phparia | src/wormling/phparia/Api/Bridges.php | Bridges.clearVideoSource | public function clearVideoSource($id)
{
$uri = "bridges/$id/videoSource";
try {
$this->client->getEndpoint()->delete($uri);
} catch (RequestException $e) {
$this->processRequestException($e);
}
} | php | public function clearVideoSource($id)
{
$uri = "bridges/$id/videoSource";
try {
$this->client->getEndpoint()->delete($uri);
} catch (RequestException $e) {
$this->processRequestException($e);
}
} | [
"public",
"function",
"clearVideoSource",
"(",
"$",
"id",
")",
"{",
"$",
"uri",
"=",
"\"bridges/$id/videoSource\"",
";",
"try",
"{",
"$",
"this",
"->",
"client",
"->",
"getEndpoint",
"(",
")",
"->",
"delete",
"(",
"$",
"uri",
")",
";",
"}",
"catch",
"(... | Removes any explicit video source in a multi-party mixing bridge. This operation has no effect on bridges with
two or fewer participants. When no explicit video source is set, talk detection will be used to determine the
active video stream.
@param string $id Bridge's id
@throws NotFoundException
@throws ConflictExcep... | [
"Removes",
"any",
"explicit",
"video",
"source",
"in",
"a",
"multi",
"-",
"party",
"mixing",
"bridge",
".",
"This",
"operation",
"has",
"no",
"effect",
"on",
"bridges",
"with",
"two",
"or",
"fewer",
"participants",
".",
"When",
"no",
"explicit",
"video",
"... | 955f9c01bd6001f11776273e262dbed0b7eb74d0 | https://github.com/wormling/phparia/blob/955f9c01bd6001f11776273e262dbed0b7eb74d0/src/wormling/phparia/Api/Bridges.php#L210-L218 |
188,528 | wormling/phparia | src/wormling/phparia/Api/DeviceStates.php | DeviceStates.getDeviceStates | public function getDeviceStates()
{
$uri = 'deviceStates';
$response = $this->client->getEndpoint()->get($uri);
$deviceStates = [];
foreach (\GuzzleHttp\json_decode($response->getBody()) as $deviceState) {
$deviceStates[] = new DeviceState($this->client, $deviceState);
... | php | public function getDeviceStates()
{
$uri = 'deviceStates';
$response = $this->client->getEndpoint()->get($uri);
$deviceStates = [];
foreach (\GuzzleHttp\json_decode($response->getBody()) as $deviceState) {
$deviceStates[] = new DeviceState($this->client, $deviceState);
... | [
"public",
"function",
"getDeviceStates",
"(",
")",
"{",
"$",
"uri",
"=",
"'deviceStates'",
";",
"$",
"response",
"=",
"$",
"this",
"->",
"client",
"->",
"getEndpoint",
"(",
")",
"->",
"get",
"(",
"$",
"uri",
")",
";",
"$",
"deviceStates",
"=",
"[",
"... | List all ARI controlled device states.
@return DeviceState[] | [
"List",
"all",
"ARI",
"controlled",
"device",
"states",
"."
] | 955f9c01bd6001f11776273e262dbed0b7eb74d0 | https://github.com/wormling/phparia/blob/955f9c01bd6001f11776273e262dbed0b7eb74d0/src/wormling/phparia/Api/DeviceStates.php#L49-L60 |
188,529 | wormling/phparia | src/wormling/phparia/Api/DeviceStates.php | DeviceStates.getDeviceState | public function getDeviceState($deviceName)
{
$uri = "deviceStates/$deviceName";
$response = $this->client->getEndpoint()->get($uri);
return new DeviceState($this->client, \GuzzleHttp\json_decode($response->getBody()));
} | php | public function getDeviceState($deviceName)
{
$uri = "deviceStates/$deviceName";
$response = $this->client->getEndpoint()->get($uri);
return new DeviceState($this->client, \GuzzleHttp\json_decode($response->getBody()));
} | [
"public",
"function",
"getDeviceState",
"(",
"$",
"deviceName",
")",
"{",
"$",
"uri",
"=",
"\"deviceStates/$deviceName\"",
";",
"$",
"response",
"=",
"$",
"this",
"->",
"client",
"->",
"getEndpoint",
"(",
")",
"->",
"get",
"(",
"$",
"uri",
")",
";",
"ret... | Retrieve the current state of a device.
@param string $deviceName
@return DeviceState | [
"Retrieve",
"the",
"current",
"state",
"of",
"a",
"device",
"."
] | 955f9c01bd6001f11776273e262dbed0b7eb74d0 | https://github.com/wormling/phparia/blob/955f9c01bd6001f11776273e262dbed0b7eb74d0/src/wormling/phparia/Api/DeviceStates.php#L68-L74 |
188,530 | wormling/phparia | src/wormling/phparia/Api/DeviceStates.php | DeviceStates.deleteDeviceState | public function deleteDeviceState($deviceName)
{
$uri = "deviceStates/$deviceName";
try {
$this->client->getEndpoint()->delete($uri);
} catch (RequestException $e) {
$this->processRequestException($e);
}
} | php | public function deleteDeviceState($deviceName)
{
$uri = "deviceStates/$deviceName";
try {
$this->client->getEndpoint()->delete($uri);
} catch (RequestException $e) {
$this->processRequestException($e);
}
} | [
"public",
"function",
"deleteDeviceState",
"(",
"$",
"deviceName",
")",
"{",
"$",
"uri",
"=",
"\"deviceStates/$deviceName\"",
";",
"try",
"{",
"$",
"this",
"->",
"client",
"->",
"getEndpoint",
"(",
")",
"->",
"delete",
"(",
"$",
"uri",
")",
";",
"}",
"ca... | Destroy a device-state controlled by ARI.
@param string $deviceName Name of the device
@throws ConflictException
@throws NotFoundException | [
"Destroy",
"a",
"device",
"-",
"state",
"controlled",
"by",
"ARI",
"."
] | 955f9c01bd6001f11776273e262dbed0b7eb74d0 | https://github.com/wormling/phparia/blob/955f9c01bd6001f11776273e262dbed0b7eb74d0/src/wormling/phparia/Api/DeviceStates.php#L105-L113 |
188,531 | yii2mod/yii2-enum | helpers/BaseEnum.php | BaseEnum.createByName | public static function createByName($name)
{
$constants = static::getConstantsByName();
if (!array_key_exists($name, $constants)) {
throw new UnexpectedValueException("Name '{$name}' is not exists in the enum constants list " . get_called_class());
}
return new static($... | php | public static function createByName($name)
{
$constants = static::getConstantsByName();
if (!array_key_exists($name, $constants)) {
throw new UnexpectedValueException("Name '{$name}' is not exists in the enum constants list " . get_called_class());
}
return new static($... | [
"public",
"static",
"function",
"createByName",
"(",
"$",
"name",
")",
"{",
"$",
"constants",
"=",
"static",
"::",
"getConstantsByName",
"(",
")",
";",
"if",
"(",
"!",
"array_key_exists",
"(",
"$",
"name",
",",
"$",
"constants",
")",
")",
"{",
"throw",
... | Creates a new type instance using the name of a value.
@param string $name The name of a value
@throws UnexpectedValueException
@return $this The new type instance | [
"Creates",
"a",
"new",
"type",
"instance",
"using",
"the",
"name",
"of",
"a",
"value",
"."
] | 3f93e105f35530d267f0968968b6fd7029b2bd56 | https://github.com/yii2mod/yii2-enum/blob/3f93e105f35530d267f0968968b6fd7029b2bd56/helpers/BaseEnum.php#L74-L83 |
188,532 | yii2mod/yii2-enum | helpers/BaseEnum.php | BaseEnum.getLabel | public static function getLabel($value)
{
$list = static::$list;
if (isset($list[$value])) {
return Yii::t(static::$messageCategory, $list[$value]);
}
return null;
} | php | public static function getLabel($value)
{
$list = static::$list;
if (isset($list[$value])) {
return Yii::t(static::$messageCategory, $list[$value]);
}
return null;
} | [
"public",
"static",
"function",
"getLabel",
"(",
"$",
"value",
")",
"{",
"$",
"list",
"=",
"static",
"::",
"$",
"list",
";",
"if",
"(",
"isset",
"(",
"$",
"list",
"[",
"$",
"value",
"]",
")",
")",
"{",
"return",
"Yii",
"::",
"t",
"(",
"static",
... | Get label by value
@var string value
@return string label | [
"Get",
"label",
"by",
"value"
] | 3f93e105f35530d267f0968968b6fd7029b2bd56 | https://github.com/yii2mod/yii2-enum/blob/3f93e105f35530d267f0968968b6fd7029b2bd56/helpers/BaseEnum.php#L134-L143 |
188,533 | Codeception/AssertThrows | AssertThrows.php | AssertThrows.assertThrowsWithMessage | public function assertThrowsWithMessage($throws, $message, callable $fn)
{
/** @var $this TestCase * */
$result = $this->getTestResultObject();
if (is_array($throws)) {
$message = ($throws[1]) ? $throws[1] : false;
$throws = $throws[0];
}
$message =... | php | public function assertThrowsWithMessage($throws, $message, callable $fn)
{
/** @var $this TestCase * */
$result = $this->getTestResultObject();
if (is_array($throws)) {
$message = ($throws[1]) ? $throws[1] : false;
$throws = $throws[0];
}
$message =... | [
"public",
"function",
"assertThrowsWithMessage",
"(",
"$",
"throws",
",",
"$",
"message",
",",
"callable",
"$",
"fn",
")",
"{",
"/** @var $this TestCase * */",
"$",
"result",
"=",
"$",
"this",
"->",
"getTestResultObject",
"(",
")",
";",
"if",
"(",
"is_array",... | Asserts that callback throws an exception with a message
@param $throws
@param $message
@param callable $fn | [
"Asserts",
"that",
"callback",
"throws",
"an",
"exception",
"with",
"a",
"message"
] | 98750b1321da1325142b5ecc8c42cb342f429141 | https://github.com/Codeception/AssertThrows/blob/98750b1321da1325142b5ecc8c42cb342f429141/AssertThrows.php#L30-L76 |
188,534 | shpasser/GaeSupportL5 | src/Shpasser/GaeSupportL5/Setup/Configurator.php | Configurator.createEnvProductionFile | protected function createEnvProductionFile($env_file, $env_production_file, $dbSocket, $dbName)
{
if (!file_exists($env_file)) {
$this->myCommand->error('Cannot find ".env" file to import the existing options.');
return;
}
if (file_exists($env_production_file)) {
... | php | protected function createEnvProductionFile($env_file, $env_production_file, $dbSocket, $dbName)
{
if (!file_exists($env_file)) {
$this->myCommand->error('Cannot find ".env" file to import the existing options.');
return;
}
if (file_exists($env_production_file)) {
... | [
"protected",
"function",
"createEnvProductionFile",
"(",
"$",
"env_file",
",",
"$",
"env_production_file",
",",
"$",
"dbSocket",
",",
"$",
"dbName",
")",
"{",
"if",
"(",
"!",
"file_exists",
"(",
"$",
"env_file",
")",
")",
"{",
"$",
"this",
"->",
"myCommand... | Creates a '.env.production' file based on the existing '.env' file.
@param string $env_file The '.env' file path.
@param string $env_production_file The '.env.production' file path.
@param string $dbSocket Cloud SQL socket connection string.
@param string $dbName Cloud SQL database name. | [
"Creates",
"a",
".",
"env",
".",
"production",
"file",
"based",
"on",
"the",
"existing",
".",
"env",
"file",
"."
] | 392d09f176b1f37096aae4b98d6be32f43fc631a | https://github.com/shpasser/GaeSupportL5/blob/392d09f176b1f37096aae4b98d6be32f43fc631a/src/Shpasser/GaeSupportL5/Setup/Configurator.php#L96-L141 |
188,535 | shpasser/GaeSupportL5 | src/Shpasser/GaeSupportL5/Setup/Configurator.php | Configurator.createEnvLocalFile | protected function createEnvLocalFile($env_file, $env_local_file, $dbHost, $dbName)
{
if (!file_exists($env_file)) {
$this->myCommand->error('Cannot find ".env" file to import the existing options.');
return;
}
if (file_exists($env_local_file)) {
$overwri... | php | protected function createEnvLocalFile($env_file, $env_local_file, $dbHost, $dbName)
{
if (!file_exists($env_file)) {
$this->myCommand->error('Cannot find ".env" file to import the existing options.');
return;
}
if (file_exists($env_local_file)) {
$overwri... | [
"protected",
"function",
"createEnvLocalFile",
"(",
"$",
"env_file",
",",
"$",
"env_local_file",
",",
"$",
"dbHost",
",",
"$",
"dbName",
")",
"{",
"if",
"(",
"!",
"file_exists",
"(",
"$",
"env_file",
")",
")",
"{",
"$",
"this",
"->",
"myCommand",
"->",
... | Creates a '.env.local' file based on the existing '.env' file.
@param string $env_file The '.env' file path.
@param string $env_local_file The '.env.local' file path.
@param string $dbHost Cloud SQL host IPv4 address.
@param string $dbName Cloud SQL database name. | [
"Creates",
"a",
".",
"env",
".",
"local",
"file",
"based",
"on",
"the",
"existing",
".",
"env",
"file",
"."
] | 392d09f176b1f37096aae4b98d6be32f43fc631a | https://github.com/shpasser/GaeSupportL5/blob/392d09f176b1f37096aae4b98d6be32f43fc631a/src/Shpasser/GaeSupportL5/Setup/Configurator.php#L151-L191 |
188,536 | shpasser/GaeSupportL5 | src/Shpasser/GaeSupportL5/Setup/Configurator.php | Configurator.processFile | protected function processFile($filePath, $processors)
{
$contents = file_get_contents($filePath);
$processed = $contents;
foreach ($processors as $processor) {
$processed = $this->$processor($processed);
}
if ($processed === $contents) {
return;
... | php | protected function processFile($filePath, $processors)
{
$contents = file_get_contents($filePath);
$processed = $contents;
foreach ($processors as $processor) {
$processed = $this->$processor($processed);
}
if ($processed === $contents) {
return;
... | [
"protected",
"function",
"processFile",
"(",
"$",
"filePath",
",",
"$",
"processors",
")",
"{",
"$",
"contents",
"=",
"file_get_contents",
"(",
"$",
"filePath",
")",
";",
"$",
"processed",
"=",
"$",
"contents",
";",
"foreach",
"(",
"$",
"processors",
"as",... | Processes a given file with given processors.
@param string $filePath the path of the file to be processed.
@param array $processors array of processor function names to
be called during the file processing. Every such function shall
receive the file contents string as a parameter and return the
modified file con... | [
"Processes",
"a",
"given",
"file",
"with",
"given",
"processors",
"."
] | 392d09f176b1f37096aae4b98d6be32f43fc631a | https://github.com/shpasser/GaeSupportL5/blob/392d09f176b1f37096aae4b98d6be32f43fc631a/src/Shpasser/GaeSupportL5/Setup/Configurator.php#L224-L241 |
188,537 | shpasser/GaeSupportL5 | src/Shpasser/GaeSupportL5/Setup/Configurator.php | Configurator.replaceAppClass | protected function replaceAppClass($contents)
{
$modified = str_replace(
'Illuminate\Foundation\Application',
'Shpasser\GaeSupportL5\Foundation\Application',
$contents);
if ($contents !== $modified) {
$this->myCommand->info('Replaced the application c... | php | protected function replaceAppClass($contents)
{
$modified = str_replace(
'Illuminate\Foundation\Application',
'Shpasser\GaeSupportL5\Foundation\Application',
$contents);
if ($contents !== $modified) {
$this->myCommand->info('Replaced the application c... | [
"protected",
"function",
"replaceAppClass",
"(",
"$",
"contents",
")",
"{",
"$",
"modified",
"=",
"str_replace",
"(",
"'Illuminate\\Foundation\\Application'",
",",
"'Shpasser\\GaeSupportL5\\Foundation\\Application'",
",",
"$",
"contents",
")",
";",
"if",
"(",
"$",
"co... | Processor function. Replaces the Laravel
application class with the one compatible with GAE.
@param string $contents the 'bootstrap/app.php' file contents.
@return string the modified file contents. | [
"Processor",
"function",
".",
"Replaces",
"the",
"Laravel",
"application",
"class",
"with",
"the",
"one",
"compatible",
"with",
"GAE",
"."
] | 392d09f176b1f37096aae4b98d6be32f43fc631a | https://github.com/shpasser/GaeSupportL5/blob/392d09f176b1f37096aae4b98d6be32f43fc631a/src/Shpasser/GaeSupportL5/Setup/Configurator.php#L251-L263 |
188,538 | shpasser/GaeSupportL5 | src/Shpasser/GaeSupportL5/Setup/Configurator.php | Configurator.replaceLaravelServiceProviders | protected function replaceLaravelServiceProviders($contents)
{
$strings = [
'Illuminate\Mail\MailServiceProvider',
'Illuminate\Queue\QueueServiceProvider'
];
// Replacement to:
// - additionally support Google App Engine Queues,
// - additionally su... | php | protected function replaceLaravelServiceProviders($contents)
{
$strings = [
'Illuminate\Mail\MailServiceProvider',
'Illuminate\Queue\QueueServiceProvider'
];
// Replacement to:
// - additionally support Google App Engine Queues,
// - additionally su... | [
"protected",
"function",
"replaceLaravelServiceProviders",
"(",
"$",
"contents",
")",
"{",
"$",
"strings",
"=",
"[",
"'Illuminate\\Mail\\MailServiceProvider'",
",",
"'Illuminate\\Queue\\QueueServiceProvider'",
"]",
";",
"// Replacement to:",
"// - additionally support Google App... | Processor function. Replaces the Laravel
service providers with GAE compatible ones.
@param string $contents the 'config/app.php' file contents.
@return string the modified file contents. | [
"Processor",
"function",
".",
"Replaces",
"the",
"Laravel",
"service",
"providers",
"with",
"GAE",
"compatible",
"ones",
"."
] | 392d09f176b1f37096aae4b98d6be32f43fc631a | https://github.com/shpasser/GaeSupportL5/blob/392d09f176b1f37096aae4b98d6be32f43fc631a/src/Shpasser/GaeSupportL5/Setup/Configurator.php#L273-L295 |
188,539 | shpasser/GaeSupportL5 | src/Shpasser/GaeSupportL5/Setup/Configurator.php | Configurator.setLogHandler | protected function setLogHandler($contents)
{
$expression = "/'log'.*=>((?!env\('APP_LOG').)*'\b.+?\b'\)?/";
$replacement = "'log' => env('APP_LOG', 'single')";
$modified = preg_replace($expression, $replacement, $contents);
if ($contents !== $modified)
{
$this-... | php | protected function setLogHandler($contents)
{
$expression = "/'log'.*=>((?!env\('APP_LOG').)*'\b.+?\b'\)?/";
$replacement = "'log' => env('APP_LOG', 'single')";
$modified = preg_replace($expression, $replacement, $contents);
if ($contents !== $modified)
{
$this-... | [
"protected",
"function",
"setLogHandler",
"(",
"$",
"contents",
")",
"{",
"$",
"expression",
"=",
"\"/'log'.*=>((?!env\\('APP_LOG').)*'\\b.+?\\b'\\)?/\"",
";",
"$",
"replacement",
"=",
"\"'log' => env('APP_LOG', 'single')\"",
";",
"$",
"modified",
"=",
"preg_replace",
"("... | Processor function. Sets the syslog log handler
for a Laravel GAE app.
@param string $contents the 'config/app.php' file contents.
@return string the modified file contents. | [
"Processor",
"function",
".",
"Sets",
"the",
"syslog",
"log",
"handler",
"for",
"a",
"Laravel",
"GAE",
"app",
"."
] | 392d09f176b1f37096aae4b98d6be32f43fc631a | https://github.com/shpasser/GaeSupportL5/blob/392d09f176b1f37096aae4b98d6be32f43fc631a/src/Shpasser/GaeSupportL5/Setup/Configurator.php#L305-L318 |
188,540 | shpasser/GaeSupportL5 | src/Shpasser/GaeSupportL5/Setup/Configurator.php | Configurator.preprocessWindowsPaths | protected function preprocessWindowsPaths($contents)
{
$expression = "/'([A-Za-z]:)?((\\\\|\/)[^\\/:*?\"\'<>|\r\n]*)*'/";
$paths = array();
preg_match_all($expression, $contents, $paths);
$modified = $contents;
foreach ($paths[0] as $path) {
$normalizedPath = st... | php | protected function preprocessWindowsPaths($contents)
{
$expression = "/'([A-Za-z]:)?((\\\\|\/)[^\\/:*?\"\'<>|\r\n]*)*'/";
$paths = array();
preg_match_all($expression, $contents, $paths);
$modified = $contents;
foreach ($paths[0] as $path) {
$normalizedPath = st... | [
"protected",
"function",
"preprocessWindowsPaths",
"(",
"$",
"contents",
")",
"{",
"$",
"expression",
"=",
"\"/'([A-Za-z]:)?((\\\\\\\\|\\/)[^\\\\/:*?\\\"\\'<>|\\r\\n]*)*'/\"",
";",
"$",
"paths",
"=",
"array",
"(",
")",
";",
"preg_match_all",
"(",
"$",
"expression",
",... | Processor function. Pre-processes windows paths.
@param string $contents the 'bootstrap/cache/config.php' file contents.
@return string the modified file contents. | [
"Processor",
"function",
".",
"Pre",
"-",
"processes",
"windows",
"paths",
"."
] | 392d09f176b1f37096aae4b98d6be32f43fc631a | https://github.com/shpasser/GaeSupportL5/blob/392d09f176b1f37096aae4b98d6be32f43fc631a/src/Shpasser/GaeSupportL5/Setup/Configurator.php#L474-L492 |
188,541 | shpasser/GaeSupportL5 | src/Shpasser/GaeSupportL5/Setup/Configurator.php | Configurator.fixCachedConfig | protected function fixCachedConfig($contents)
{
$app_path = app_path();
$storage_path = storage_path();
$base_path = base_path();
$replaceFunction = 'str_replace';
if ($this->isRunningOnWindows()) {
$contents = $this->preprocessWindowsPaths($contents);
... | php | protected function fixCachedConfig($contents)
{
$app_path = app_path();
$storage_path = storage_path();
$base_path = base_path();
$replaceFunction = 'str_replace';
if ($this->isRunningOnWindows()) {
$contents = $this->preprocessWindowsPaths($contents);
... | [
"protected",
"function",
"fixCachedConfig",
"(",
"$",
"contents",
")",
"{",
"$",
"app_path",
"=",
"app_path",
"(",
")",
";",
"$",
"storage_path",
"=",
"storage_path",
"(",
")",
";",
"$",
"base_path",
"=",
"base_path",
"(",
")",
";",
"$",
"replaceFunction",... | Fixes the paths in the cached config file.
@param string $contents the 'bootstrap/cache/config.php' file contents.
@return string the modified file contents. | [
"Fixes",
"the",
"paths",
"in",
"the",
"cached",
"config",
"file",
"."
] | 392d09f176b1f37096aae4b98d6be32f43fc631a | https://github.com/shpasser/GaeSupportL5/blob/392d09f176b1f37096aae4b98d6be32f43fc631a/src/Shpasser/GaeSupportL5/Setup/Configurator.php#L500-L535 |
188,542 | shpasser/GaeSupportL5 | src/Shpasser/GaeSupportL5/Setup/Configurator.php | Configurator.generatePhpIni | protected function generatePhpIni($appId, $bucketId, $filePath)
{
if (file_exists($filePath)) {
$overwrite = $this->myCommand->confirm(
'Overwrite the existing "php.ini" file?', false
);
if (! $overwrite) {
return;
}
}
... | php | protected function generatePhpIni($appId, $bucketId, $filePath)
{
if (file_exists($filePath)) {
$overwrite = $this->myCommand->confirm(
'Overwrite the existing "php.ini" file?', false
);
if (! $overwrite) {
return;
}
}
... | [
"protected",
"function",
"generatePhpIni",
"(",
"$",
"appId",
",",
"$",
"bucketId",
",",
"$",
"filePath",
")",
"{",
"if",
"(",
"file_exists",
"(",
"$",
"filePath",
")",
")",
"{",
"$",
"overwrite",
"=",
"$",
"this",
"->",
"myCommand",
"->",
"confirm",
"... | Generates a "php.ini" file for a GAE app.
@param string $appId the GAE app id.
@param string $bucketId the GAE gs-bucket id.
@param string $filePath the 'php.ini' file path. | [
"Generates",
"a",
"php",
".",
"ini",
"file",
"for",
"a",
"GAE",
"app",
"."
] | 392d09f176b1f37096aae4b98d6be32f43fc631a | https://github.com/shpasser/GaeSupportL5/blob/392d09f176b1f37096aae4b98d6be32f43fc631a/src/Shpasser/GaeSupportL5/Setup/Configurator.php#L622-L649 |
188,543 | shpasser/GaeSupportL5 | src/Shpasser/GaeSupportL5/Setup/Configurator.php | Configurator.restoreFile | protected function restoreFile($filePath, $backupPath, $clean = true)
{
if (file_exists($backupPath)) {
copy($backupPath, $filePath);
if ($clean) {
unlink($backupPath);
}
}
return $backupPath;
} | php | protected function restoreFile($filePath, $backupPath, $clean = true)
{
if (file_exists($backupPath)) {
copy($backupPath, $filePath);
if ($clean) {
unlink($backupPath);
}
}
return $backupPath;
} | [
"protected",
"function",
"restoreFile",
"(",
"$",
"filePath",
",",
"$",
"backupPath",
",",
"$",
"clean",
"=",
"true",
")",
"{",
"if",
"(",
"file_exists",
"(",
"$",
"backupPath",
")",
")",
"{",
"copy",
"(",
"$",
"backupPath",
",",
"$",
"filePath",
")",
... | Restores a file from its backup copy.
@param string $filePath the file path.
@param string $backupPath the backup path.
@param boolean $clean if 'true' deletes the backup copy.
@return string the created backup file path. | [
"Restores",
"a",
"file",
"from",
"its",
"backup",
"copy",
"."
] | 392d09f176b1f37096aae4b98d6be32f43fc631a | https://github.com/shpasser/GaeSupportL5/blob/392d09f176b1f37096aae4b98d6be32f43fc631a/src/Shpasser/GaeSupportL5/Setup/Configurator.php#L693-L704 |
188,544 | shpasser/GaeSupportL5 | src/Shpasser/GaeSupportL5/Setup/IniHelper.php | IniHelper.read | public function read($file)
{
$this->filePath = $file;
$this->config = parse_ini_file($this->filePath);
} | php | public function read($file)
{
$this->filePath = $file;
$this->config = parse_ini_file($this->filePath);
} | [
"public",
"function",
"read",
"(",
"$",
"file",
")",
"{",
"$",
"this",
"->",
"filePath",
"=",
"$",
"file",
";",
"$",
"this",
"->",
"config",
"=",
"parse_ini_file",
"(",
"$",
"this",
"->",
"filePath",
")",
";",
"}"
] | Reads a INI file and parses its values into an array.
@param string $file The file path to parse. | [
"Reads",
"a",
"INI",
"file",
"and",
"parses",
"its",
"values",
"into",
"an",
"array",
"."
] | 392d09f176b1f37096aae4b98d6be32f43fc631a | https://github.com/shpasser/GaeSupportL5/blob/392d09f176b1f37096aae4b98d6be32f43fc631a/src/Shpasser/GaeSupportL5/Setup/IniHelper.php#L25-L29 |
188,545 | shpasser/GaeSupportL5 | src/Shpasser/GaeSupportL5/Setup/IniHelper.php | IniHelper.write | public function write($file = "")
{
$iniString = $this->generateIniString($this->config);
file_put_contents($file ? $file : $this->filePath, $iniString);
} | php | public function write($file = "")
{
$iniString = $this->generateIniString($this->config);
file_put_contents($file ? $file : $this->filePath, $iniString);
} | [
"public",
"function",
"write",
"(",
"$",
"file",
"=",
"\"\"",
")",
"{",
"$",
"iniString",
"=",
"$",
"this",
"->",
"generateIniString",
"(",
"$",
"this",
"->",
"config",
")",
";",
"file_put_contents",
"(",
"$",
"file",
"?",
"$",
"file",
":",
"$",
"thi... | Writes the configuration data back to the INI file.
@param string $file If not empty will be used as an
INI file path to be written. | [
"Writes",
"the",
"configuration",
"data",
"back",
"to",
"the",
"INI",
"file",
"."
] | 392d09f176b1f37096aae4b98d6be32f43fc631a | https://github.com/shpasser/GaeSupportL5/blob/392d09f176b1f37096aae4b98d6be32f43fc631a/src/Shpasser/GaeSupportL5/Setup/IniHelper.php#L37-L41 |
188,546 | shpasser/GaeSupportL5 | src/Shpasser/GaeSupportL5/Setup/IniHelper.php | IniHelper.generateIniString | protected function generateIniString($array)
{
$iniString = "";
foreach ($array as $key => $value) {
if (is_array($value)) {
$iniString .= "[{$key}]".PHP_EOL;
$iniString .= $this->generateIniString($value);
} else {
$iniString ... | php | protected function generateIniString($array)
{
$iniString = "";
foreach ($array as $key => $value) {
if (is_array($value)) {
$iniString .= "[{$key}]".PHP_EOL;
$iniString .= $this->generateIniString($value);
} else {
$iniString ... | [
"protected",
"function",
"generateIniString",
"(",
"$",
"array",
")",
"{",
"$",
"iniString",
"=",
"\"\"",
";",
"foreach",
"(",
"$",
"array",
"as",
"$",
"key",
"=>",
"$",
"value",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"value",
")",
")",
"{",
"$... | Generates an INI string from a given associative array.
@param array $array the array containing the INI data.
@return string | [
"Generates",
"an",
"INI",
"string",
"from",
"a",
"given",
"associative",
"array",
"."
] | 392d09f176b1f37096aae4b98d6be32f43fc631a | https://github.com/shpasser/GaeSupportL5/blob/392d09f176b1f37096aae4b98d6be32f43fc631a/src/Shpasser/GaeSupportL5/Setup/IniHelper.php#L49-L63 |
188,547 | shpasser/GaeSupportL5 | src/Shpasser/GaeSupportL5/Http/Controllers/ArtisanConsoleController.php | ArtisanConsoleController.execute | public function execute(Request $request)
{
$command = $request->input('command');
if ($command === '') {
$command = 'list';
}
$output= new BufferedOutput;
Artisan::handle(new StringInput($command.self::NON_INTERACTIVE), $output);
$results = $output->fe... | php | public function execute(Request $request)
{
$command = $request->input('command');
if ($command === '') {
$command = 'list';
}
$output= new BufferedOutput;
Artisan::handle(new StringInput($command.self::NON_INTERACTIVE), $output);
$results = $output->fe... | [
"public",
"function",
"execute",
"(",
"Request",
"$",
"request",
")",
"{",
"$",
"command",
"=",
"$",
"request",
"->",
"input",
"(",
"'command'",
")",
";",
"if",
"(",
"$",
"command",
"===",
"''",
")",
"{",
"$",
"command",
"=",
"'list'",
";",
"}",
"$... | Executes a command submitted from Artisan Console page.
@param Request $request Laravel HTTP request object.
@return mixed view containing the Artisan Console. | [
"Executes",
"a",
"command",
"submitted",
"from",
"Artisan",
"Console",
"page",
"."
] | 392d09f176b1f37096aae4b98d6be32f43fc631a | https://github.com/shpasser/GaeSupportL5/blob/392d09f176b1f37096aae4b98d6be32f43fc631a/src/Shpasser/GaeSupportL5/Http/Controllers/ArtisanConsoleController.php#L35-L49 |
188,548 | shpasser/GaeSupportL5 | src/Shpasser/GaeSupportL5/Setup/SetupCommand.php | SetupCommand.fire | public function fire()
{
$dbSocket = $this->option('db-socket');
$dbHost = $this->option('db-host');
$dbName = $this->option('db-name');
if (! is_null($dbName) && (is_null($dbSocket) && is_null($dbHost))) {
$this->error("Option '--db-name' requires at least one of: '... | php | public function fire()
{
$dbSocket = $this->option('db-socket');
$dbHost = $this->option('db-host');
$dbName = $this->option('db-name');
if (! is_null($dbName) && (is_null($dbSocket) && is_null($dbHost))) {
$this->error("Option '--db-name' requires at least one of: '... | [
"public",
"function",
"fire",
"(",
")",
"{",
"$",
"dbSocket",
"=",
"$",
"this",
"->",
"option",
"(",
"'db-socket'",
")",
";",
"$",
"dbHost",
"=",
"$",
"this",
"->",
"option",
"(",
"'db-host'",
")",
";",
"$",
"dbName",
"=",
"$",
"this",
"->",
"optio... | Execute the console command.
For backward compatibility.
@return mixed | [
"Execute",
"the",
"console",
"command",
".",
"For",
"backward",
"compatibility",
"."
] | 392d09f176b1f37096aae4b98d6be32f43fc631a | https://github.com/shpasser/GaeSupportL5/blob/392d09f176b1f37096aae4b98d6be32f43fc631a/src/Shpasser/GaeSupportL5/Setup/SetupCommand.php#L49-L70 |
188,549 | radutopala/skype-bot-php | src/Skype/Console/CommandFactory.php | CommandFactory.generateCommand | private function generateCommand($name, \ReflectionMethod $method, $token = null)
{
$methodName = $this->transformer->transform($method->getName());
$command = new Command(strtolower($name . ':' . $methodName));
$factory = DocBlockFactory::createInstance();
$docBlock = $factory->c... | php | private function generateCommand($name, \ReflectionMethod $method, $token = null)
{
$methodName = $this->transformer->transform($method->getName());
$command = new Command(strtolower($name . ':' . $methodName));
$factory = DocBlockFactory::createInstance();
$docBlock = $factory->c... | [
"private",
"function",
"generateCommand",
"(",
"$",
"name",
",",
"\\",
"ReflectionMethod",
"$",
"method",
",",
"$",
"token",
"=",
"null",
")",
"{",
"$",
"methodName",
"=",
"$",
"this",
"->",
"transformer",
"->",
"transform",
"(",
"$",
"method",
"->",
"ge... | Creates a Command based on an Api Method.
@param string $name
@param \ReflectionMethod $method
@param string $token
@return Command | [
"Creates",
"a",
"Command",
"based",
"on",
"an",
"Api",
"Method",
"."
] | 2d72cdb2c5adbe6b3fbf40dac8e1c85a09f9426b | https://github.com/radutopala/skype-bot-php/blob/2d72cdb2c5adbe6b3fbf40dac8e1c85a09f9426b/src/Skype/Console/CommandFactory.php#L75-L89 |
188,550 | radutopala/skype-bot-php | src/Skype/Console/CommandFactory.php | CommandFactory.buildDefinition | private function buildDefinition(\ReflectionMethod $method, DocBlock $docBlock, $token = null)
{
$definition = new InputDefinition();
foreach ($docBlock->getTags() as $tag) {
if ($tag instanceof DocBlock\Tags\Param) {
$tagsDescription[$tag->getVariableName()] = $tag->get... | php | private function buildDefinition(\ReflectionMethod $method, DocBlock $docBlock, $token = null)
{
$definition = new InputDefinition();
foreach ($docBlock->getTags() as $tag) {
if ($tag instanceof DocBlock\Tags\Param) {
$tagsDescription[$tag->getVariableName()] = $tag->get... | [
"private",
"function",
"buildDefinition",
"(",
"\\",
"ReflectionMethod",
"$",
"method",
",",
"DocBlock",
"$",
"docBlock",
",",
"$",
"token",
"=",
"null",
")",
"{",
"$",
"definition",
"=",
"new",
"InputDefinition",
"(",
")",
";",
"foreach",
"(",
"$",
"docBl... | Builds the Input Definition based upon Api Method Parameters.
@param \ReflectionMethod $method
@param string $token
@return InputDefinition | [
"Builds",
"the",
"Input",
"Definition",
"based",
"upon",
"Api",
"Method",
"Parameters",
"."
] | 2d72cdb2c5adbe6b3fbf40dac8e1c85a09f9426b | https://github.com/radutopala/skype-bot-php/blob/2d72cdb2c5adbe6b3fbf40dac8e1c85a09f9426b/src/Skype/Console/CommandFactory.php#L99-L124 |
188,551 | radutopala/skype-bot-php | src/Skype/Console/CommandFactory.php | CommandFactory.createCode | private function createCode($name, \ReflectionMethod $method)
{
return function (InputInterface $input, OutputInterface $output) use ($name, $method) {
$client = new Client([], null, $output);
if ($input->getOption('token')) {
$client->authorize($input->getOption('to... | php | private function createCode($name, \ReflectionMethod $method)
{
return function (InputInterface $input, OutputInterface $output) use ($name, $method) {
$client = new Client([], null, $output);
if ($input->getOption('token')) {
$client->authorize($input->getOption('to... | [
"private",
"function",
"createCode",
"(",
"$",
"name",
",",
"\\",
"ReflectionMethod",
"$",
"method",
")",
"{",
"return",
"function",
"(",
"InputInterface",
"$",
"input",
",",
"OutputInterface",
"$",
"output",
")",
"use",
"(",
"$",
"name",
",",
"$",
"method... | Creates the command execution code.
@param string $name
@param \ReflectionMethod $method
@return \Closure | [
"Creates",
"the",
"command",
"execution",
"code",
"."
] | 2d72cdb2c5adbe6b3fbf40dac8e1c85a09f9426b | https://github.com/radutopala/skype-bot-php/blob/2d72cdb2c5adbe6b3fbf40dac8e1c85a09f9426b/src/Skype/Console/CommandFactory.php#L134-L156 |
188,552 | radutopala/skype-bot-php | src/Skype/Api/Conversation.php | Conversation.activity | public function activity($target, $text, $suggestedActions = [])
{
$json = [
'type' => 'message/text',
'text' => $text,
];
if (!empty($suggestedActions)) {
$json['suggestedActions']['actions'] = $suggestedActions;
}
return $this->request(... | php | public function activity($target, $text, $suggestedActions = [])
{
$json = [
'type' => 'message/text',
'text' => $text,
];
if (!empty($suggestedActions)) {
$json['suggestedActions']['actions'] = $suggestedActions;
}
return $this->request(... | [
"public",
"function",
"activity",
"(",
"$",
"target",
",",
"$",
"text",
",",
"$",
"suggestedActions",
"=",
"[",
"]",
")",
"{",
"$",
"json",
"=",
"[",
"'type'",
"=>",
"'message/text'",
",",
"'text'",
"=>",
"$",
"text",
",",
"]",
";",
"if",
"(",
"!",... | Sends an activity message
@param string $target In format of 8:<username> or 19:<group>
@param string $text The message
@param array $suggestedActions
@return \Psr\Http\Message\ResponseInterface | [
"Sends",
"an",
"activity",
"message"
] | 2d72cdb2c5adbe6b3fbf40dac8e1c85a09f9426b | https://github.com/radutopala/skype-bot-php/blob/2d72cdb2c5adbe6b3fbf40dac8e1c85a09f9426b/src/Skype/Api/Conversation.php#L15-L29 |
188,553 | shpasser/GaeSupportL5 | src/Shpasser/GaeSupportL5/Queue/QueueServiceProvider.php | QueueServiceProvider.registerGaeConnector | protected function registerGaeConnector($manager)
{
$app = $this->app;
$manager->addConnector('gae', function () use ($app) {
return new GaeConnector($app['encrypter'], $app['request']);
});
} | php | protected function registerGaeConnector($manager)
{
$app = $this->app;
$manager->addConnector('gae', function () use ($app) {
return new GaeConnector($app['encrypter'], $app['request']);
});
} | [
"protected",
"function",
"registerGaeConnector",
"(",
"$",
"manager",
")",
"{",
"$",
"app",
"=",
"$",
"this",
"->",
"app",
";",
"$",
"manager",
"->",
"addConnector",
"(",
"'gae'",
",",
"function",
"(",
")",
"use",
"(",
"$",
"app",
")",
"{",
"return",
... | Register the GAE queue connector.
@param \Illuminate\Queue\QueueManager $manager
@return void | [
"Register",
"the",
"GAE",
"queue",
"connector",
"."
] | 392d09f176b1f37096aae4b98d6be32f43fc631a | https://github.com/shpasser/GaeSupportL5/blob/392d09f176b1f37096aae4b98d6be32f43fc631a/src/Shpasser/GaeSupportL5/Queue/QueueServiceProvider.php#L27-L34 |
188,554 | shpasser/GaeSupportL5 | src/Shpasser/GaeSupportL5/Storage/Optimizer.php | Optimizer.bootstrap | public function bootstrap()
{
if (! $this->runningInConsole && $this->initializeFs()) {
$this->buildFsTree();
$this->initialized = true;
}
return $this->initialized;
} | php | public function bootstrap()
{
if (! $this->runningInConsole && $this->initializeFs()) {
$this->buildFsTree();
$this->initialized = true;
}
return $this->initialized;
} | [
"public",
"function",
"bootstrap",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"runningInConsole",
"&&",
"$",
"this",
"->",
"initializeFs",
"(",
")",
")",
"{",
"$",
"this",
"->",
"buildFsTree",
"(",
")",
";",
"$",
"this",
"->",
"initialized",
"... | Bootstraps the Optimizer.
@return boolean 'true' if successful, otherwise 'false'. | [
"Bootstraps",
"the",
"Optimizer",
"."
] | 392d09f176b1f37096aae4b98d6be32f43fc631a | https://github.com/shpasser/GaeSupportL5/blob/392d09f176b1f37096aae4b98d6be32f43fc631a/src/Shpasser/GaeSupportL5/Storage/Optimizer.php#L68-L76 |
188,555 | shpasser/GaeSupportL5 | src/Shpasser/GaeSupportL5/Storage/Optimizer.php | Optimizer.getCachedConfigPath | public function getCachedConfigPath()
{
if ($this->initialized && env('CACHE_CONFIG_FILE')) {
$this->cacheFile($this->basePath.'/bootstrap/cache/config.php', $this->configPath);
return $this->configPath;
}
return false;
} | php | public function getCachedConfigPath()
{
if ($this->initialized && env('CACHE_CONFIG_FILE')) {
$this->cacheFile($this->basePath.'/bootstrap/cache/config.php', $this->configPath);
return $this->configPath;
}
return false;
} | [
"public",
"function",
"getCachedConfigPath",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"initialized",
"&&",
"env",
"(",
"'CACHE_CONFIG_FILE'",
")",
")",
"{",
"$",
"this",
"->",
"cacheFile",
"(",
"$",
"this",
"->",
"basePath",
".",
"'/bootstrap/cache/confi... | Get the path to the configuration cache file.
@return string | [
"Get",
"the",
"path",
"to",
"the",
"configuration",
"cache",
"file",
"."
] | 392d09f176b1f37096aae4b98d6be32f43fc631a | https://github.com/shpasser/GaeSupportL5/blob/392d09f176b1f37096aae4b98d6be32f43fc631a/src/Shpasser/GaeSupportL5/Storage/Optimizer.php#L84-L92 |
188,556 | shpasser/GaeSupportL5 | src/Shpasser/GaeSupportL5/Storage/Optimizer.php | Optimizer.getCachedRoutesPath | public function getCachedRoutesPath()
{
if ($this->initialized && env('CACHE_ROUTES_FILE')) {
$this->cacheFile($this->basePath.'/bootstrap/cache/routes.php', $this->routesPath);
return $this->routesPath;
}
return false;
} | php | public function getCachedRoutesPath()
{
if ($this->initialized && env('CACHE_ROUTES_FILE')) {
$this->cacheFile($this->basePath.'/bootstrap/cache/routes.php', $this->routesPath);
return $this->routesPath;
}
return false;
} | [
"public",
"function",
"getCachedRoutesPath",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"initialized",
"&&",
"env",
"(",
"'CACHE_ROUTES_FILE'",
")",
")",
"{",
"$",
"this",
"->",
"cacheFile",
"(",
"$",
"this",
"->",
"basePath",
".",
"'/bootstrap/cache/route... | Get the path to the routes cache file.
@return string | [
"Get",
"the",
"path",
"to",
"the",
"routes",
"cache",
"file",
"."
] | 392d09f176b1f37096aae4b98d6be32f43fc631a | https://github.com/shpasser/GaeSupportL5/blob/392d09f176b1f37096aae4b98d6be32f43fc631a/src/Shpasser/GaeSupportL5/Storage/Optimizer.php#L100-L108 |
188,557 | shpasser/GaeSupportL5 | src/Shpasser/GaeSupportL5/Storage/Optimizer.php | Optimizer.cacheFile | protected function cacheFile($path, $cachefsPath)
{
if (array_key_exists($path, $this->cachedFiles)) {
return;
}
if (file_exists($path)) {
$contents = file_get_contents($path);
file_put_contents($cachefsPath, $contents);
$this->cachedFiles[$p... | php | protected function cacheFile($path, $cachefsPath)
{
if (array_key_exists($path, $this->cachedFiles)) {
return;
}
if (file_exists($path)) {
$contents = file_get_contents($path);
file_put_contents($cachefsPath, $contents);
$this->cachedFiles[$p... | [
"protected",
"function",
"cacheFile",
"(",
"$",
"path",
",",
"$",
"cachefsPath",
")",
"{",
"if",
"(",
"array_key_exists",
"(",
"$",
"path",
",",
"$",
"this",
"->",
"cachedFiles",
")",
")",
"{",
"return",
";",
"}",
"if",
"(",
"file_exists",
"(",
"$",
... | Adds the requested file to cache.
@param string $path path to the file to be cached.
@param string $cachefsPath path for the cached file(under 'cachefs://'). | [
"Adds",
"the",
"requested",
"file",
"to",
"cache",
"."
] | 392d09f176b1f37096aae4b98d6be32f43fc631a | https://github.com/shpasser/GaeSupportL5/blob/392d09f176b1f37096aae4b98d6be32f43fc631a/src/Shpasser/GaeSupportL5/Storage/Optimizer.php#L144-L156 |
188,558 | shpasser/GaeSupportL5 | src/Shpasser/GaeSupportL5/Storage/CacheFs.php | CacheFs.initialize | public static function initialize()
{
if (self::$registered) {
return true;
}
try {
// initialize the connection to memcached
if (is_null(self::cache())) {
return false;
}
// register the wrapper
stream_... | php | public static function initialize()
{
if (self::$registered) {
return true;
}
try {
// initialize the connection to memcached
if (is_null(self::cache())) {
return false;
}
// register the wrapper
stream_... | [
"public",
"static",
"function",
"initialize",
"(",
")",
"{",
"if",
"(",
"self",
"::",
"$",
"registered",
")",
"{",
"return",
"true",
";",
"}",
"try",
"{",
"// initialize the connection to memcached",
"if",
"(",
"is_null",
"(",
"self",
"::",
"cache",
"(",
"... | Establishes a connection to memcached server and
registers the Stream Wrapper.
@return boolean 'true' if connection was successful, 'false' otherwise. | [
"Establishes",
"a",
"connection",
"to",
"memcached",
"server",
"and",
"registers",
"the",
"Stream",
"Wrapper",
"."
] | 392d09f176b1f37096aae4b98d6be32f43fc631a | https://github.com/shpasser/GaeSupportL5/blob/392d09f176b1f37096aae4b98d6be32f43fc631a/src/Shpasser/GaeSupportL5/Storage/CacheFs.php#L52-L71 |
188,559 | shpasser/GaeSupportL5 | src/Shpasser/GaeSupportL5/Storage/CacheFs.php | CacheFs.cache | private static function cache()
{
if (is_null(self::$memcached) && class_exists('Memcached')) {
$servers = [['host' => '127.0.0.1', 'port' => 11211, 'weight' => 100]];
self::$memcached = new Memcached();
foreach ($servers as $server) {
self::$memcached->... | php | private static function cache()
{
if (is_null(self::$memcached) && class_exists('Memcached')) {
$servers = [['host' => '127.0.0.1', 'port' => 11211, 'weight' => 100]];
self::$memcached = new Memcached();
foreach ($servers as $server) {
self::$memcached->... | [
"private",
"static",
"function",
"cache",
"(",
")",
"{",
"if",
"(",
"is_null",
"(",
"self",
"::",
"$",
"memcached",
")",
"&&",
"class_exists",
"(",
"'Memcached'",
")",
")",
"{",
"$",
"servers",
"=",
"[",
"[",
"'host'",
"=>",
"'127.0.0.1'",
",",
"'port'... | Returns the memcached instance.
@return Memcached
@throws RuntimeException | [
"Returns",
"the",
"memcached",
"instance",
"."
] | 392d09f176b1f37096aae4b98d6be32f43fc631a | https://github.com/shpasser/GaeSupportL5/blob/392d09f176b1f37096aae4b98d6be32f43fc631a/src/Shpasser/GaeSupportL5/Storage/CacheFs.php#L79-L98 |
188,560 | shpasser/GaeSupportL5 | src/Shpasser/GaeSupportL5/Storage/CacheFs.php | CacheFs.rename | public function rename($from, $to)
{
// TODO: add directories support
$contents = self::cache()->get($from);
if (false === $contents) {
return false;
}
self::cache()->delete($from);
self::cache()->set($to, $contents);
return true;
} | php | public function rename($from, $to)
{
// TODO: add directories support
$contents = self::cache()->get($from);
if (false === $contents) {
return false;
}
self::cache()->delete($from);
self::cache()->set($to, $contents);
return true;
} | [
"public",
"function",
"rename",
"(",
"$",
"from",
",",
"$",
"to",
")",
"{",
"// TODO: add directories support",
"$",
"contents",
"=",
"self",
"::",
"cache",
"(",
")",
"->",
"get",
"(",
"$",
"from",
")",
";",
"if",
"(",
"false",
"===",
"$",
"contents",
... | Renames a storage object.
@return true if the object was renamed, false otherwise | [
"Renames",
"a",
"storage",
"object",
"."
] | 392d09f176b1f37096aae4b98d6be32f43fc631a | https://github.com/shpasser/GaeSupportL5/blob/392d09f176b1f37096aae4b98d6be32f43fc631a/src/Shpasser/GaeSupportL5/Storage/CacheFs.php#L139-L152 |
188,561 | shpasser/GaeSupportL5 | src/Shpasser/GaeSupportL5/Storage/CacheFs.php | CacheFs.stream_open | public function stream_open($path, $mode, $options, &$opened_path)
{
$contents = self::cache()->get($path);
$fileExists = (false !== $contents);
switch ($mode) {
case 'r':
case 'rb':
case 'r+':
case 'rb+':
if (! $fileExists) {
... | php | public function stream_open($path, $mode, $options, &$opened_path)
{
$contents = self::cache()->get($path);
$fileExists = (false !== $contents);
switch ($mode) {
case 'r':
case 'rb':
case 'r+':
case 'rb+':
if (! $fileExists) {
... | [
"public",
"function",
"stream_open",
"(",
"$",
"path",
",",
"$",
"mode",
",",
"$",
"options",
",",
"&",
"$",
"opened_path",
")",
"{",
"$",
"contents",
"=",
"self",
"::",
"cache",
"(",
")",
"->",
"get",
"(",
"$",
"path",
")",
";",
"$",
"fileExists",... | Opens a stream.
@param $path
@param $mode
@param $options
@param $opened_path
@return bool true on success, false otherwise.
@throws RuntimeException | [
"Opens",
"a",
"stream",
"."
] | 392d09f176b1f37096aae4b98d6be32f43fc631a | https://github.com/shpasser/GaeSupportL5/blob/392d09f176b1f37096aae4b98d6be32f43fc631a/src/Shpasser/GaeSupportL5/Storage/CacheFs.php#L231-L277 |
188,562 | shpasser/GaeSupportL5 | src/Shpasser/GaeSupportL5/Storage/CacheFs.php | CacheFs.url_stat | public function url_stat($path, $flags)
{
$now = time();
$stat = [
'dev' => 0, // no specific device number
'ino' => 0, // no inode number
'mode' => 0, // inode protection mode
'nlink' => 1, // number of links
'uid'... | php | public function url_stat($path, $flags)
{
$now = time();
$stat = [
'dev' => 0, // no specific device number
'ino' => 0, // no inode number
'mode' => 0, // inode protection mode
'nlink' => 1, // number of links
'uid'... | [
"public",
"function",
"url_stat",
"(",
"$",
"path",
",",
"$",
"flags",
")",
"{",
"$",
"now",
"=",
"time",
"(",
")",
";",
"$",
"stat",
"=",
"[",
"'dev'",
"=>",
"0",
",",
"// no specific device number",
"'ino'",
"=>",
"0",
",",
"// no inode number",
"'mo... | Returns stat information for a given path.
@param string $path
@param int $flags
@return array stat information. | [
"Returns",
"stat",
"information",
"for",
"a",
"given",
"path",
"."
] | 392d09f176b1f37096aae4b98d6be32f43fc631a | https://github.com/shpasser/GaeSupportL5/blob/392d09f176b1f37096aae4b98d6be32f43fc631a/src/Shpasser/GaeSupportL5/Storage/CacheFs.php#L361-L398 |
188,563 | shpasser/GaeSupportL5 | src/Shpasser/GaeSupportL5/Setup/EnvHelper.php | EnvHelper.read | public function read($file)
{
$this->filePath = $file;
$this->lines = file($this->filePath, FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES);
} | php | public function read($file)
{
$this->filePath = $file;
$this->lines = file($this->filePath, FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES);
} | [
"public",
"function",
"read",
"(",
"$",
"file",
")",
"{",
"$",
"this",
"->",
"filePath",
"=",
"$",
"file",
";",
"$",
"this",
"->",
"lines",
"=",
"file",
"(",
"$",
"this",
"->",
"filePath",
",",
"FILE_IGNORE_NEW_LINES",
"|",
"FILE_SKIP_EMPTY_LINES",
")",
... | Reads a ENV file into an array.
@param string $file The file path to parse. | [
"Reads",
"a",
"ENV",
"file",
"into",
"an",
"array",
"."
] | 392d09f176b1f37096aae4b98d6be32f43fc631a | https://github.com/shpasser/GaeSupportL5/blob/392d09f176b1f37096aae4b98d6be32f43fc631a/src/Shpasser/GaeSupportL5/Setup/EnvHelper.php#L25-L29 |
188,564 | shpasser/GaeSupportL5 | src/Shpasser/GaeSupportL5/Setup/EnvHelper.php | EnvHelper.write | public function write($file = "")
{
$envString = $this->generateEnvString($this->lines);
file_put_contents($file ? $file : $this->filePath, $envString);
} | php | public function write($file = "")
{
$envString = $this->generateEnvString($this->lines);
file_put_contents($file ? $file : $this->filePath, $envString);
} | [
"public",
"function",
"write",
"(",
"$",
"file",
"=",
"\"\"",
")",
"{",
"$",
"envString",
"=",
"$",
"this",
"->",
"generateEnvString",
"(",
"$",
"this",
"->",
"lines",
")",
";",
"file_put_contents",
"(",
"$",
"file",
"?",
"$",
"file",
":",
"$",
"this... | Writes the configuration data back to the ENV file.
@param string $file If not empty will be used as an
ENV file path to be written. | [
"Writes",
"the",
"configuration",
"data",
"back",
"to",
"the",
"ENV",
"file",
"."
] | 392d09f176b1f37096aae4b98d6be32f43fc631a | https://github.com/shpasser/GaeSupportL5/blob/392d09f176b1f37096aae4b98d6be32f43fc631a/src/Shpasser/GaeSupportL5/Setup/EnvHelper.php#L37-L41 |
188,565 | shpasser/GaeSupportL5 | src/Shpasser/GaeSupportL5/Setup/EnvHelper.php | EnvHelper.parseEnvLine | protected function parseEnvLine($line, &$key, &$value)
{
$parseOk = false;
$keyExpr = '/(^\S+)\s*=\s*/';
if (preg_match($keyExpr, $line, $matched) === 1) {
$key = $matched[1];
$value = substr($line, strlen($matched[0]));
$parseOk = true;
}
... | php | protected function parseEnvLine($line, &$key, &$value)
{
$parseOk = false;
$keyExpr = '/(^\S+)\s*=\s*/';
if (preg_match($keyExpr, $line, $matched) === 1) {
$key = $matched[1];
$value = substr($line, strlen($matched[0]));
$parseOk = true;
}
... | [
"protected",
"function",
"parseEnvLine",
"(",
"$",
"line",
",",
"&",
"$",
"key",
",",
"&",
"$",
"value",
")",
"{",
"$",
"parseOk",
"=",
"false",
";",
"$",
"keyExpr",
"=",
"'/(^\\S+)\\s*=\\s*/'",
";",
"if",
"(",
"preg_match",
"(",
"$",
"keyExpr",
",",
... | Parses key and value for a given line.
@param string $line the line to be parsed.
@param string &$key the parsed key.
@param string &$value the parsed value.
@return boolean true if parsing was successful, false otherwise. | [
"Parses",
"key",
"and",
"value",
"for",
"a",
"given",
"line",
"."
] | 392d09f176b1f37096aae4b98d6be32f43fc631a | https://github.com/shpasser/GaeSupportL5/blob/392d09f176b1f37096aae4b98d6be32f43fc631a/src/Shpasser/GaeSupportL5/Setup/EnvHelper.php#L68-L80 |
188,566 | shpasser/GaeSupportL5 | src/Shpasser/GaeSupportL5/Setup/EnvHelper.php | EnvHelper.findLine | protected function findLine($key)
{
$parsedKey = null;
$parsedValue = null;
foreach ($this->lines as $index => $line) {
$parseOk = $this->parseEnvLine($line, $parsedKey, $parsedValue);
if ($parseOk && $key === $parsedKey) {
return $index;
... | php | protected function findLine($key)
{
$parsedKey = null;
$parsedValue = null;
foreach ($this->lines as $index => $line) {
$parseOk = $this->parseEnvLine($line, $parsedKey, $parsedValue);
if ($parseOk && $key === $parsedKey) {
return $index;
... | [
"protected",
"function",
"findLine",
"(",
"$",
"key",
")",
"{",
"$",
"parsedKey",
"=",
"null",
";",
"$",
"parsedValue",
"=",
"null",
";",
"foreach",
"(",
"$",
"this",
"->",
"lines",
"as",
"$",
"index",
"=>",
"$",
"line",
")",
"{",
"$",
"parseOk",
"... | Finds the line containing the given key.
@param string $key the key.
@return integer the line index > 0, otherwise -1. | [
"Finds",
"the",
"line",
"containing",
"the",
"given",
"key",
"."
] | 392d09f176b1f37096aae4b98d6be32f43fc631a | https://github.com/shpasser/GaeSupportL5/blob/392d09f176b1f37096aae4b98d6be32f43fc631a/src/Shpasser/GaeSupportL5/Setup/EnvHelper.php#L88-L101 |
188,567 | shpasser/GaeSupportL5 | src/Shpasser/GaeSupportL5/Setup/EnvHelper.php | EnvHelper.offsetSet | public function offsetSet($offset, $value)
{
if (is_null($offset)) {
$this->lines[] = $value;
} else {
$index = $this->findLine($offset);
if ($index >= 0) {
$this->lines[$index] = "{$offset}={$value}";
} else {
$this->l... | php | public function offsetSet($offset, $value)
{
if (is_null($offset)) {
$this->lines[] = $value;
} else {
$index = $this->findLine($offset);
if ($index >= 0) {
$this->lines[$index] = "{$offset}={$value}";
} else {
$this->l... | [
"public",
"function",
"offsetSet",
"(",
"$",
"offset",
",",
"$",
"value",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"offset",
")",
")",
"{",
"$",
"this",
"->",
"lines",
"[",
"]",
"=",
"$",
"value",
";",
"}",
"else",
"{",
"$",
"index",
"=",
"$",... | Assigns a value to the specified offset
@param string $offset The offset to assign the value to
@param mixed $value The value to set
@access public
@abstracting ArrayAccess | [
"Assigns",
"a",
"value",
"to",
"the",
"specified",
"offset"
] | 392d09f176b1f37096aae4b98d6be32f43fc631a | https://github.com/shpasser/GaeSupportL5/blob/392d09f176b1f37096aae4b98d6be32f43fc631a/src/Shpasser/GaeSupportL5/Setup/EnvHelper.php#L111-L124 |
188,568 | shpasser/GaeSupportL5 | src/Shpasser/GaeSupportL5/Setup/EnvHelper.php | EnvHelper.offsetExists | public function offsetExists($offset)
{
$lineFound = false;
$index = $this->findLine($offset);
if ($index >= 0) {
$lineFound = true;
}
return $lineFound;
} | php | public function offsetExists($offset)
{
$lineFound = false;
$index = $this->findLine($offset);
if ($index >= 0) {
$lineFound = true;
}
return $lineFound;
} | [
"public",
"function",
"offsetExists",
"(",
"$",
"offset",
")",
"{",
"$",
"lineFound",
"=",
"false",
";",
"$",
"index",
"=",
"$",
"this",
"->",
"findLine",
"(",
"$",
"offset",
")",
";",
"if",
"(",
"$",
"index",
">=",
"0",
")",
"{",
"$",
"lineFound",... | Whether or not an offset exists
@param string $offset An offset to check for
@access public
@return boolean
@abstracting ArrayAccess | [
"Whether",
"or",
"not",
"an",
"offset",
"exists"
] | 392d09f176b1f37096aae4b98d6be32f43fc631a | https://github.com/shpasser/GaeSupportL5/blob/392d09f176b1f37096aae4b98d6be32f43fc631a/src/Shpasser/GaeSupportL5/Setup/EnvHelper.php#L134-L145 |
188,569 | shpasser/GaeSupportL5 | src/Shpasser/GaeSupportL5/Setup/EnvHelper.php | EnvHelper.offsetUnset | public function offsetUnset($offset)
{
$index = $this->findLine($offset);
if ($index >= 0) {
unset($this->lines[$index]);
}
} | php | public function offsetUnset($offset)
{
$index = $this->findLine($offset);
if ($index >= 0) {
unset($this->lines[$index]);
}
} | [
"public",
"function",
"offsetUnset",
"(",
"$",
"offset",
")",
"{",
"$",
"index",
"=",
"$",
"this",
"->",
"findLine",
"(",
"$",
"offset",
")",
";",
"if",
"(",
"$",
"index",
">=",
"0",
")",
"{",
"unset",
"(",
"$",
"this",
"->",
"lines",
"[",
"$",
... | Un-sets an offset
@param string $offset The offset to unset
@access public
@abstracting ArrayAccess | [
"Un",
"-",
"sets",
"an",
"offset"
] | 392d09f176b1f37096aae4b98d6be32f43fc631a | https://github.com/shpasser/GaeSupportL5/blob/392d09f176b1f37096aae4b98d6be32f43fc631a/src/Shpasser/GaeSupportL5/Setup/EnvHelper.php#L154-L161 |
188,570 | shpasser/GaeSupportL5 | src/Shpasser/GaeSupportL5/Mail/Transport/GaeTransport.php | GaeTransport.getAttachmentsArray | protected function getAttachmentsArray($message)
{
$attachments = array();
foreach ($message->getChildren() as $entity) {
if ($entity instanceof Swift_Attachment) {
$attachments[] = array(
'name' => $entity->getFilename(),
'data' =... | php | protected function getAttachmentsArray($message)
{
$attachments = array();
foreach ($message->getChildren() as $entity) {
if ($entity instanceof Swift_Attachment) {
$attachments[] = array(
'name' => $entity->getFilename(),
'data' =... | [
"protected",
"function",
"getAttachmentsArray",
"(",
"$",
"message",
")",
"{",
"$",
"attachments",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"message",
"->",
"getChildren",
"(",
")",
"as",
"$",
"entity",
")",
"{",
"if",
"(",
"$",
"entity",
"ins... | Returns an array of attachments extracted from
a given mail message.
@param $message
@return array | [
"Returns",
"an",
"array",
"of",
"attachments",
"extracted",
"from",
"a",
"given",
"mail",
"message",
"."
] | 392d09f176b1f37096aae4b98d6be32f43fc631a | https://github.com/shpasser/GaeSupportL5/blob/392d09f176b1f37096aae4b98d6be32f43fc631a/src/Shpasser/GaeSupportL5/Mail/Transport/GaeTransport.php#L116-L131 |
188,571 | shpasser/GaeSupportL5 | src/Shpasser/GaeSupportL5/Foundation/Application.php | Application.getCachedServicesPath | public function getCachedServicesPath()
{
$path = $this->optimizer->getCachedServicesPath();
if ($path) {
return $path;
}
if ($this->isRunningOnGae()) {
return $this->storagePath().'/framework/services.json';
}
return parent::getCachedServic... | php | public function getCachedServicesPath()
{
$path = $this->optimizer->getCachedServicesPath();
if ($path) {
return $path;
}
if ($this->isRunningOnGae()) {
return $this->storagePath().'/framework/services.json';
}
return parent::getCachedServic... | [
"public",
"function",
"getCachedServicesPath",
"(",
")",
"{",
"$",
"path",
"=",
"$",
"this",
"->",
"optimizer",
"->",
"getCachedServicesPath",
"(",
")",
";",
"if",
"(",
"$",
"path",
")",
"{",
"return",
"$",
"path",
";",
"}",
"if",
"(",
"$",
"this",
"... | Get the path to the cached services.json file.
@return string | [
"Get",
"the",
"path",
"to",
"the",
"cached",
"services",
".",
"json",
"file",
"."
] | 392d09f176b1f37096aae4b98d6be32f43fc631a | https://github.com/shpasser/GaeSupportL5/blob/392d09f176b1f37096aae4b98d6be32f43fc631a/src/Shpasser/GaeSupportL5/Foundation/Application.php#L100-L113 |
188,572 | shpasser/GaeSupportL5 | src/Shpasser/GaeSupportL5/Foundation/Application.php | Application.replaceDefaultSymfonyLineDumpers | protected function replaceDefaultSymfonyLineDumpers()
{
HtmlDumper::$defaultOutput =
CliDumper::$defaultOutput =
function ($line, $depth, $indentPad) {
if (-1 !== $depth) {
echo str_repeat($indentPad, $depth).$line.PHP_EOL;
}
... | php | protected function replaceDefaultSymfonyLineDumpers()
{
HtmlDumper::$defaultOutput =
CliDumper::$defaultOutput =
function ($line, $depth, $indentPad) {
if (-1 !== $depth) {
echo str_repeat($indentPad, $depth).$line.PHP_EOL;
}
... | [
"protected",
"function",
"replaceDefaultSymfonyLineDumpers",
"(",
")",
"{",
"HtmlDumper",
"::",
"$",
"defaultOutput",
"=",
"CliDumper",
"::",
"$",
"defaultOutput",
"=",
"function",
"(",
"$",
"line",
",",
"$",
"depth",
",",
"$",
"indentPad",
")",
"{",
"if",
"... | Replaces the default output stream of Symfony's
CliDumper and HtmlDumper classes in order to
be able to run on Google App Engine.
'php://stdout' is used by CliDumper,
'php://output' is used by HtmlDumper,
both are not supported on GAE. | [
"Replaces",
"the",
"default",
"output",
"stream",
"of",
"Symfony",
"s",
"CliDumper",
"and",
"HtmlDumper",
"classes",
"in",
"order",
"to",
"be",
"able",
"to",
"run",
"on",
"Google",
"App",
"Engine",
"."
] | 392d09f176b1f37096aae4b98d6be32f43fc631a | https://github.com/shpasser/GaeSupportL5/blob/392d09f176b1f37096aae4b98d6be32f43fc631a/src/Shpasser/GaeSupportL5/Foundation/Application.php#L142-L151 |
188,573 | shpasser/GaeSupportL5 | src/Shpasser/GaeSupportL5/Foundation/Application.php | Application.storagePath | public function storagePath()
{
if ($this->runningOnGae) {
if (! is_null($this->gaeBucketPath)) {
return $this->gaeBucketPath;
}
$buckets = ini_get('google_app_engine.allow_include_gs_buckets');
// Get the first bucket in the list.
... | php | public function storagePath()
{
if ($this->runningOnGae) {
if (! is_null($this->gaeBucketPath)) {
return $this->gaeBucketPath;
}
$buckets = ini_get('google_app_engine.allow_include_gs_buckets');
// Get the first bucket in the list.
... | [
"public",
"function",
"storagePath",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"runningOnGae",
")",
"{",
"if",
"(",
"!",
"is_null",
"(",
"$",
"this",
"->",
"gaeBucketPath",
")",
")",
"{",
"return",
"$",
"this",
"->",
"gaeBucketPath",
";",
"}",
"$"... | Override the storage path
@return string Storage path URL | [
"Override",
"the",
"storage",
"path"
] | 392d09f176b1f37096aae4b98d6be32f43fc631a | https://github.com/shpasser/GaeSupportL5/blob/392d09f176b1f37096aae4b98d6be32f43fc631a/src/Shpasser/GaeSupportL5/Foundation/Application.php#L178-L208 |
188,574 | matvp91/laravel-socket | src/MessageComponent.php | MessageComponent.onOpen | public function onOpen(ConnectionInterface $connection)
{
// Resolve the session upon connection.
$session_manager = new SessionManager($connection);
$session_manager->resolveSession();
// Create the client and add it.
$client = new Client($connection, $session_manager);
... | php | public function onOpen(ConnectionInterface $connection)
{
// Resolve the session upon connection.
$session_manager = new SessionManager($connection);
$session_manager->resolveSession();
// Create the client and add it.
$client = new Client($connection, $session_manager);
... | [
"public",
"function",
"onOpen",
"(",
"ConnectionInterface",
"$",
"connection",
")",
"{",
"// Resolve the session upon connection.",
"$",
"session_manager",
"=",
"new",
"SessionManager",
"(",
"$",
"connection",
")",
";",
"$",
"session_manager",
"->",
"resolveSession",
... | Client connected. | [
"Client",
"connected",
"."
] | 0b087337a867db2eb4863f1f34d6548604819738 | https://github.com/matvp91/laravel-socket/blob/0b087337a867db2eb4863f1f34d6548604819738/src/MessageComponent.php#L47-L61 |
188,575 | matvp91/laravel-socket | src/MessageComponent.php | MessageComponent.onMessage | public function onMessage(ConnectionInterface $from, $message)
{
$incoming_client = $this->clients->findByConnection($from);
if ($incoming_client) {
// Handle session.
// $incoming_client->session_manager->handle();
// Handle message.
$message = new ... | php | public function onMessage(ConnectionInterface $from, $message)
{
$incoming_client = $this->clients->findByConnection($from);
if ($incoming_client) {
// Handle session.
// $incoming_client->session_manager->handle();
// Handle message.
$message = new ... | [
"public",
"function",
"onMessage",
"(",
"ConnectionInterface",
"$",
"from",
",",
"$",
"message",
")",
"{",
"$",
"incoming_client",
"=",
"$",
"this",
"->",
"clients",
"->",
"findByConnection",
"(",
"$",
"from",
")",
";",
"if",
"(",
"$",
"incoming_client",
"... | Incoming message. | [
"Incoming",
"message",
"."
] | 0b087337a867db2eb4863f1f34d6548604819738 | https://github.com/matvp91/laravel-socket/blob/0b087337a867db2eb4863f1f34d6548604819738/src/MessageComponent.php#L67-L81 |
188,576 | matvp91/laravel-socket | src/MessageComponent.php | MessageComponent.onClose | public function onClose(ConnectionInterface $connection)
{
$client = $this->clients->findByConnection($connection);
if ($client) {
$this->clients->remove($client);
$this->command->info('Client disconnected');
// Fire the event.
Event::fire(new Clien... | php | public function onClose(ConnectionInterface $connection)
{
$client = $this->clients->findByConnection($connection);
if ($client) {
$this->clients->remove($client);
$this->command->info('Client disconnected');
// Fire the event.
Event::fire(new Clien... | [
"public",
"function",
"onClose",
"(",
"ConnectionInterface",
"$",
"connection",
")",
"{",
"$",
"client",
"=",
"$",
"this",
"->",
"clients",
"->",
"findByConnection",
"(",
"$",
"connection",
")",
";",
"if",
"(",
"$",
"client",
")",
"{",
"$",
"this",
"->",... | Client disconnected. | [
"Client",
"disconnected",
"."
] | 0b087337a867db2eb4863f1f34d6548604819738 | https://github.com/matvp91/laravel-socket/blob/0b087337a867db2eb4863f1f34d6548604819738/src/MessageComponent.php#L87-L99 |
188,577 | matvp91/laravel-socket | src/MessageComponent.php | MessageComponent.onError | public function onError(ConnectionInterface $connection, Exception $e)
{
$this->command->error($e->getMessage());
\Log::error($e);
$connection->close();
} | php | public function onError(ConnectionInterface $connection, Exception $e)
{
$this->command->error($e->getMessage());
\Log::error($e);
$connection->close();
} | [
"public",
"function",
"onError",
"(",
"ConnectionInterface",
"$",
"connection",
",",
"Exception",
"$",
"e",
")",
"{",
"$",
"this",
"->",
"command",
"->",
"error",
"(",
"$",
"e",
"->",
"getMessage",
"(",
")",
")",
";",
"\\",
"Log",
"::",
"error",
"(",
... | Socket error. | [
"Socket",
"error",
"."
] | 0b087337a867db2eb4863f1f34d6548604819738 | https://github.com/matvp91/laravel-socket/blob/0b087337a867db2eb4863f1f34d6548604819738/src/MessageComponent.php#L105-L112 |
188,578 | matvp91/laravel-socket | src/Events/Event.php | Event.allOtherClients | public function allOtherClients()
{
$current_client = $this->client;
$filter = function ($client) use ($current_client) {
return $client !== $current_client;
};
return $this->clients->filter($filter);
} | php | public function allOtherClients()
{
$current_client = $this->client;
$filter = function ($client) use ($current_client) {
return $client !== $current_client;
};
return $this->clients->filter($filter);
} | [
"public",
"function",
"allOtherClients",
"(",
")",
"{",
"$",
"current_client",
"=",
"$",
"this",
"->",
"client",
";",
"$",
"filter",
"=",
"function",
"(",
"$",
"client",
")",
"use",
"(",
"$",
"current_client",
")",
"{",
"return",
"$",
"client",
"!==",
... | Get all users connected.
@var array | [
"Get",
"all",
"users",
"connected",
"."
] | 0b087337a867db2eb4863f1f34d6548604819738 | https://github.com/matvp91/laravel-socket/blob/0b087337a867db2eb4863f1f34d6548604819738/src/Events/Event.php#L52-L61 |
188,579 | zyberspace/php-telegram-cli-client | lib/Zyberspace/Telegram/Cli/RawClient.php | RawClient.exec | public function exec($command)
{
$command = implode(' ', func_get_args());
fwrite($this->_fp, str_replace("\n", '\n', $command) . PHP_EOL);
$answer = fgets($this->_fp); //"ANSWER $bytes" or false if an error occurred
if (is_string($answer)) {
if (substr($answer, 0, 7) =... | php | public function exec($command)
{
$command = implode(' ', func_get_args());
fwrite($this->_fp, str_replace("\n", '\n', $command) . PHP_EOL);
$answer = fgets($this->_fp); //"ANSWER $bytes" or false if an error occurred
if (is_string($answer)) {
if (substr($answer, 0, 7) =... | [
"public",
"function",
"exec",
"(",
"$",
"command",
")",
"{",
"$",
"command",
"=",
"implode",
"(",
"' '",
",",
"func_get_args",
"(",
")",
")",
";",
"fwrite",
"(",
"$",
"this",
"->",
"_fp",
",",
"str_replace",
"(",
"\"\\n\"",
",",
"'\\n'",
",",
"$",
... | Executes a command on the telegram-cli. Line-breaks will be escaped, as telgram-cli does not support them.
@param string $command The command. Command-arguments can be passed as additional method-arguments.
@return object|boolean Returns the answer as a json-object or true on success, false if there was an error. | [
"Executes",
"a",
"command",
"on",
"the",
"telegram",
"-",
"cli",
".",
"Line",
"-",
"breaks",
"will",
"be",
"escaped",
"as",
"telgram",
"-",
"cli",
"does",
"not",
"support",
"them",
"."
] | 560a91aed1f3185ef8c62869b812945883daf958 | https://github.com/zyberspace/php-telegram-cli-client/blob/560a91aed1f3185ef8c62869b812945883daf958/lib/Zyberspace/Telegram/Cli/RawClient.php#L69-L113 |
188,580 | matvp91/laravel-socket | src/SessionManager.php | SessionManager.getCookie | private function getCookie($name, $decrypt = false)
{
try {
$cookies = $this->connection->WebSocket->request->getCookies();
if (isset($cookies[$name])) {
$raw = rawurldecode($cookies[$name]);
if (!$decrypt) {
return $raw;
... | php | private function getCookie($name, $decrypt = false)
{
try {
$cookies = $this->connection->WebSocket->request->getCookies();
if (isset($cookies[$name])) {
$raw = rawurldecode($cookies[$name]);
if (!$decrypt) {
return $raw;
... | [
"private",
"function",
"getCookie",
"(",
"$",
"name",
",",
"$",
"decrypt",
"=",
"false",
")",
"{",
"try",
"{",
"$",
"cookies",
"=",
"$",
"this",
"->",
"connection",
"->",
"WebSocket",
"->",
"request",
"->",
"getCookies",
"(",
")",
";",
"if",
"(",
"is... | Gets a cookie by the name and if needed, can decrypt the value.
@return string|null | [
"Gets",
"a",
"cookie",
"by",
"the",
"name",
"and",
"if",
"needed",
"can",
"decrypt",
"the",
"value",
"."
] | 0b087337a867db2eb4863f1f34d6548604819738 | https://github.com/matvp91/laravel-socket/blob/0b087337a867db2eb4863f1f34d6548604819738/src/SessionManager.php#L47-L72 |
188,581 | matvp91/laravel-socket | src/SessionManager.php | SessionManager.resolveSession | public function resolveSession()
{
$cookie_name = Config::get('session.cookie');
$session_id = $this->getCookie($cookie_name, true);
if (!$session_id) {
return null;
}
$this->session->setId($session_id);
return $this->session;
} | php | public function resolveSession()
{
$cookie_name = Config::get('session.cookie');
$session_id = $this->getCookie($cookie_name, true);
if (!$session_id) {
return null;
}
$this->session->setId($session_id);
return $this->session;
} | [
"public",
"function",
"resolveSession",
"(",
")",
"{",
"$",
"cookie_name",
"=",
"Config",
"::",
"get",
"(",
"'session.cookie'",
")",
";",
"$",
"session_id",
"=",
"$",
"this",
"->",
"getCookie",
"(",
"$",
"cookie_name",
",",
"true",
")",
";",
"if",
"(",
... | Resolves the laravel session and sets the session.
@return mixed | [
"Resolves",
"the",
"laravel",
"session",
"and",
"sets",
"the",
"session",
"."
] | 0b087337a867db2eb4863f1f34d6548604819738 | https://github.com/matvp91/laravel-socket/blob/0b087337a867db2eb4863f1f34d6548604819738/src/SessionManager.php#L80-L92 |
188,582 | matvp91/laravel-socket | src/Clients.php | Clients.findByConnection | public function findByConnection($connection)
{
return $this->first(function ($client, $key) use ($connection) {
return $client->connection === $connection;
});
} | php | public function findByConnection($connection)
{
return $this->first(function ($client, $key) use ($connection) {
return $client->connection === $connection;
});
} | [
"public",
"function",
"findByConnection",
"(",
"$",
"connection",
")",
"{",
"return",
"$",
"this",
"->",
"first",
"(",
"function",
"(",
"$",
"client",
",",
"$",
"key",
")",
"use",
"(",
"$",
"connection",
")",
"{",
"return",
"$",
"client",
"->",
"connec... | Find a client by their connection.
@return Codemash\Socket\Client|null | [
"Find",
"a",
"client",
"by",
"their",
"connection",
"."
] | 0b087337a867db2eb4863f1f34d6548604819738 | https://github.com/matvp91/laravel-socket/blob/0b087337a867db2eb4863f1f34d6548604819738/src/Clients.php#L14-L19 |
188,583 | zyberspace/php-telegram-cli-client | lib/Zyberspace/Telegram/Cli/Client.php | Client.broadcast | public function broadcast(array $userList, $msg)
{
return $this->exec('broadcast ' . $this->formatPeerList($userList) . ' '
. $this->escapeStringArgument($msg));
} | php | public function broadcast(array $userList, $msg)
{
return $this->exec('broadcast ' . $this->formatPeerList($userList) . ' '
. $this->escapeStringArgument($msg));
} | [
"public",
"function",
"broadcast",
"(",
"array",
"$",
"userList",
",",
"$",
"msg",
")",
"{",
"return",
"$",
"this",
"->",
"exec",
"(",
"'broadcast '",
".",
"$",
"this",
"->",
"formatPeerList",
"(",
"$",
"userList",
")",
".",
"' '",
".",
"$",
"this",
... | Sends a text message to several users at once.
@param array $userList List of users / contacts that shall receive the message,
gets formated with formatPeerList()
@param string $msg The message to send, gets escaped with escapeStringArgument()
@return boolean true on success, false otherwise | [
"Sends",
"a",
"text",
"message",
"to",
"several",
"users",
"at",
"once",
"."
] | 560a91aed1f3185ef8c62869b812945883daf958 | https://github.com/zyberspace/php-telegram-cli-client/blob/560a91aed1f3185ef8c62869b812945883daf958/lib/Zyberspace/Telegram/Cli/Client.php#L82-L86 |
188,584 | zyberspace/php-telegram-cli-client | lib/Zyberspace/Telegram/Cli/Client.php | Client.renameChat | public function renameChat($chat, $newChatTitle)
{
return $this->exec('rename_chat', $this->escapePeer($chat), $this->escapeStringArgument($newChatTitle));
} | php | public function renameChat($chat, $newChatTitle)
{
return $this->exec('rename_chat', $this->escapePeer($chat), $this->escapeStringArgument($newChatTitle));
} | [
"public",
"function",
"renameChat",
"(",
"$",
"chat",
",",
"$",
"newChatTitle",
")",
"{",
"return",
"$",
"this",
"->",
"exec",
"(",
"'rename_chat'",
",",
"$",
"this",
"->",
"escapePeer",
"(",
"$",
"chat",
")",
",",
"$",
"this",
"->",
"escapeStringArgumen... | Renames a chat. Both, the chat title and the print-name will change.
@param string $chat The name of the chat (not the title). Gets escaped with escapePeer().
@param string $chatTitle The new title of the chat.
@return boolean true on success, false otherwise
@uses exec()
@uses escapePeer()
@uses escapeStringArgumen... | [
"Renames",
"a",
"chat",
".",
"Both",
"the",
"chat",
"title",
"and",
"the",
"print",
"-",
"name",
"will",
"change",
"."
] | 560a91aed1f3185ef8c62869b812945883daf958 | https://github.com/zyberspace/php-telegram-cli-client/blob/560a91aed1f3185ef8c62869b812945883daf958/lib/Zyberspace/Telegram/Cli/Client.php#L138-L141 |
188,585 | zyberspace/php-telegram-cli-client | lib/Zyberspace/Telegram/Cli/Client.php | Client.chatAddUser | public function chatAddUser($chat, $user, $numberOfMessagesToFoward = 100)
{
return $this->exec('chat_add_user', $this->escapePeer($chat), $this->escapePeer($user),
(int) $numberOfMessagesToFoward);
} | php | public function chatAddUser($chat, $user, $numberOfMessagesToFoward = 100)
{
return $this->exec('chat_add_user', $this->escapePeer($chat), $this->escapePeer($user),
(int) $numberOfMessagesToFoward);
} | [
"public",
"function",
"chatAddUser",
"(",
"$",
"chat",
",",
"$",
"user",
",",
"$",
"numberOfMessagesToFoward",
"=",
"100",
")",
"{",
"return",
"$",
"this",
"->",
"exec",
"(",
"'chat_add_user'",
",",
"$",
"this",
"->",
"escapePeer",
"(",
"$",
"chat",
")",... | Adds a user to a chat.
@param string $chat The chat you want the user to add to. Gets escaped with escapePeer().
@param string $user The user you want to add. Gets escaped with escapePeer().
@param int $numberOfMessagesToFoward The number of last messages of the chat, the new user should see.
Default is 100.
@return ... | [
"Adds",
"a",
"user",
"to",
"a",
"chat",
"."
] | 560a91aed1f3185ef8c62869b812945883daf958 | https://github.com/zyberspace/php-telegram-cli-client/blob/560a91aed1f3185ef8c62869b812945883daf958/lib/Zyberspace/Telegram/Cli/Client.php#L156-L160 |
188,586 | zyberspace/php-telegram-cli-client | lib/Zyberspace/Telegram/Cli/Client.php | Client.chatDeleteUser | public function chatDeleteUser($chat, $user)
{
return $this->exec('chat_del_user', $this->escapePeer($chat), $this->escapePeer($user));
} | php | public function chatDeleteUser($chat, $user)
{
return $this->exec('chat_del_user', $this->escapePeer($chat), $this->escapePeer($user));
} | [
"public",
"function",
"chatDeleteUser",
"(",
"$",
"chat",
",",
"$",
"user",
")",
"{",
"return",
"$",
"this",
"->",
"exec",
"(",
"'chat_del_user'",
",",
"$",
"this",
"->",
"escapePeer",
"(",
"$",
"chat",
")",
",",
"$",
"this",
"->",
"escapePeer",
"(",
... | Deletes a user from a chat.
@param string $chat The chat you want the user to delete from. Gets escaped with escapePeer().
@param string $user The user you want to delete. Gets escaped with escapePeer().
@return boolean true on success, false otherwise
@uses exec()
@uses escapePeer() | [
"Deletes",
"a",
"user",
"from",
"a",
"chat",
"."
] | 560a91aed1f3185ef8c62869b812945883daf958 | https://github.com/zyberspace/php-telegram-cli-client/blob/560a91aed1f3185ef8c62869b812945883daf958/lib/Zyberspace/Telegram/Cli/Client.php#L173-L176 |
188,587 | zyberspace/php-telegram-cli-client | lib/Zyberspace/Telegram/Cli/Client.php | Client.setProfileName | public function setProfileName($firstName, $lastName)
{
return $this->exec('set_profile_name ' . $this->escapeStringArgument($firstName) . ' '
. $this->escapeStringArgument($lastName));
} | php | public function setProfileName($firstName, $lastName)
{
return $this->exec('set_profile_name ' . $this->escapeStringArgument($firstName) . ' '
. $this->escapeStringArgument($lastName));
} | [
"public",
"function",
"setProfileName",
"(",
"$",
"firstName",
",",
"$",
"lastName",
")",
"{",
"return",
"$",
"this",
"->",
"exec",
"(",
"'set_profile_name '",
".",
"$",
"this",
"->",
"escapeStringArgument",
"(",
"$",
"firstName",
")",
".",
"' '",
".",
"$"... | Sets the profile name
@param $firstName The first name
@param $lastName The last name
@return object|boolean Your new user-info as an object; false if somethings goes wrong
@uses exec() | [
"Sets",
"the",
"profile",
"name"
] | 560a91aed1f3185ef8c62869b812945883daf958 | https://github.com/zyberspace/php-telegram-cli-client/blob/560a91aed1f3185ef8c62869b812945883daf958/lib/Zyberspace/Telegram/Cli/Client.php#L188-L192 |
188,588 | zyberspace/php-telegram-cli-client | lib/Zyberspace/Telegram/Cli/Client.php | Client.addContact | public function addContact($phoneNumber, $firstName, $lastName)
{
$phoneNumber = preg_replace('%[^0-9]%', '', (string) $phoneNumber);
if (empty($phoneNumber)) {
return false;
}
return $this->exec('add_contact ' . $phoneNumber . ' ' . $this->escapeStringArgument($firstNam... | php | public function addContact($phoneNumber, $firstName, $lastName)
{
$phoneNumber = preg_replace('%[^0-9]%', '', (string) $phoneNumber);
if (empty($phoneNumber)) {
return false;
}
return $this->exec('add_contact ' . $phoneNumber . ' ' . $this->escapeStringArgument($firstNam... | [
"public",
"function",
"addContact",
"(",
"$",
"phoneNumber",
",",
"$",
"firstName",
",",
"$",
"lastName",
")",
"{",
"$",
"phoneNumber",
"=",
"preg_replace",
"(",
"'%[^0-9]%'",
",",
"''",
",",
"(",
"string",
")",
"$",
"phoneNumber",
")",
";",
"if",
"(",
... | Adds a user to the contact list
@param string $phoneNumber The phone-number of the new contact, needs to be a telegram-user.
Every char that is not a number gets deleted, so you don't need to care about spaces,
'+' and so on.
@param string $firstName The first name of the new contact
@param string $lastName The last n... | [
"Adds",
"a",
"user",
"to",
"the",
"contact",
"list"
] | 560a91aed1f3185ef8c62869b812945883daf958 | https://github.com/zyberspace/php-telegram-cli-client/blob/560a91aed1f3185ef8c62869b812945883daf958/lib/Zyberspace/Telegram/Cli/Client.php#L208-L217 |
188,589 | zyberspace/php-telegram-cli-client | lib/Zyberspace/Telegram/Cli/Client.php | Client.renameContact | public function renameContact($contact, $firstName, $lastName)
{
return $this->exec('rename_contact ' . $this->escapePeer($contact)
. ' ' . $this->escapeStringArgument($firstName) . ' ' . $this->escapeStringArgument($lastName));
} | php | public function renameContact($contact, $firstName, $lastName)
{
return $this->exec('rename_contact ' . $this->escapePeer($contact)
. ' ' . $this->escapeStringArgument($firstName) . ' ' . $this->escapeStringArgument($lastName));
} | [
"public",
"function",
"renameContact",
"(",
"$",
"contact",
",",
"$",
"firstName",
",",
"$",
"lastName",
")",
"{",
"return",
"$",
"this",
"->",
"exec",
"(",
"'rename_contact '",
".",
"$",
"this",
"->",
"escapePeer",
"(",
"$",
"contact",
")",
".",
"' '",
... | Renames a user in the contact list
@param string $contact The contact, gets escaped with escapePeer()
@param string $firstName The new first name for the contact
@param string $lastName The new last name for the contact
@return object|boolean The new contact-info as an object; false if somethings goes wrong
@uses ex... | [
"Renames",
"a",
"user",
"in",
"the",
"contact",
"list"
] | 560a91aed1f3185ef8c62869b812945883daf958 | https://github.com/zyberspace/php-telegram-cli-client/blob/560a91aed1f3185ef8c62869b812945883daf958/lib/Zyberspace/Telegram/Cli/Client.php#L231-L235 |
188,590 | zyberspace/php-telegram-cli-client | lib/Zyberspace/Telegram/Cli/Client.php | Client.sendPicture | public function sendPicture($peer, $path)
{
$peer = $this->escapePeer($peer);
$formattedPath = $this->formatFileName($path);
return $this->exec('send_photo ' . $peer . ' ' . $formattedPath);
} | php | public function sendPicture($peer, $path)
{
$peer = $this->escapePeer($peer);
$formattedPath = $this->formatFileName($path);
return $this->exec('send_photo ' . $peer . ' ' . $formattedPath);
} | [
"public",
"function",
"sendPicture",
"(",
"$",
"peer",
",",
"$",
"path",
")",
"{",
"$",
"peer",
"=",
"$",
"this",
"->",
"escapePeer",
"(",
"$",
"peer",
")",
";",
"$",
"formattedPath",
"=",
"$",
"this",
"->",
"formatFileName",
"(",
"$",
"path",
")",
... | Send picture to peer
@param string $peer The peer, gets escaped with escapePeer()
@param string $path The picture path, gets formatted with formatFileName()
@return boolean
@uses exec()
@uses escapePeer()
@uses formatFileName() | [
"Send",
"picture",
"to",
"peer"
] | 560a91aed1f3185ef8c62869b812945883daf958 | https://github.com/zyberspace/php-telegram-cli-client/blob/560a91aed1f3185ef8c62869b812945883daf958/lib/Zyberspace/Telegram/Cli/Client.php#L387-L393 |
188,591 | zyberspace/php-telegram-cli-client | lib/Zyberspace/Telegram/Cli/Client.php | Client.sendFile | public function sendFile($peer, $path)
{
$peer = $this->escapePeer($peer);
$formattedPath = $this->formatFileName($path);
return $this->exec('send_file ' . $peer . ' ' . $formattedPath);
} | php | public function sendFile($peer, $path)
{
$peer = $this->escapePeer($peer);
$formattedPath = $this->formatFileName($path);
return $this->exec('send_file ' . $peer . ' ' . $formattedPath);
} | [
"public",
"function",
"sendFile",
"(",
"$",
"peer",
",",
"$",
"path",
")",
"{",
"$",
"peer",
"=",
"$",
"this",
"->",
"escapePeer",
"(",
"$",
"peer",
")",
";",
"$",
"formattedPath",
"=",
"$",
"this",
"->",
"formatFileName",
"(",
"$",
"path",
")",
";... | Send file to peer
@param string $peer The peer, gets escaped with escapePeer()
@param string $path The file path, gets formatted with formatFileName()
@return boolean
@uses exec()
@uses escapePeer()
@uses formatFileName() | [
"Send",
"file",
"to",
"peer"
] | 560a91aed1f3185ef8c62869b812945883daf958 | https://github.com/zyberspace/php-telegram-cli-client/blob/560a91aed1f3185ef8c62869b812945883daf958/lib/Zyberspace/Telegram/Cli/Client.php#L406-L412 |
188,592 | matvp91/laravel-socket | src/Client.php | Client.send | public function send($command, $data)
{
$message = new Message;
$message->command = $command;
$message->data = $data;
$this->connection->send($message->serialize());
} | php | public function send($command, $data)
{
$message = new Message;
$message->command = $command;
$message->data = $data;
$this->connection->send($message->serialize());
} | [
"public",
"function",
"send",
"(",
"$",
"command",
",",
"$",
"data",
")",
"{",
"$",
"message",
"=",
"new",
"Message",
";",
"$",
"message",
"->",
"command",
"=",
"$",
"command",
";",
"$",
"message",
"->",
"data",
"=",
"$",
"data",
";",
"$",
"this",
... | Sends a message to this client.
@return void | [
"Sends",
"a",
"message",
"to",
"this",
"client",
"."
] | 0b087337a867db2eb4863f1f34d6548604819738 | https://github.com/matvp91/laravel-socket/blob/0b087337a867db2eb4863f1f34d6548604819738/src/Client.php#L125-L133 |
188,593 | matvp91/laravel-socket | src/Client.php | Client.getUser | public function getUser() {
$session = $this->session_manager->session;
if ($session && !$this->user) {
$user_id = $session->get(Auth::getName());
if ($user_id && is_null($this->user)) {
$user_model = Config::get('auth.providers.users.model');
i... | php | public function getUser() {
$session = $this->session_manager->session;
if ($session && !$this->user) {
$user_id = $session->get(Auth::getName());
if ($user_id && is_null($this->user)) {
$user_model = Config::get('auth.providers.users.model');
i... | [
"public",
"function",
"getUser",
"(",
")",
"{",
"$",
"session",
"=",
"$",
"this",
"->",
"session_manager",
"->",
"session",
";",
"if",
"(",
"$",
"session",
"&&",
"!",
"$",
"this",
"->",
"user",
")",
"{",
"$",
"user_id",
"=",
"$",
"session",
"->",
"... | Hooks in the user getter.
@return mixed | [
"Hooks",
"in",
"the",
"user",
"getter",
"."
] | 0b087337a867db2eb4863f1f34d6548604819738 | https://github.com/matvp91/laravel-socket/blob/0b087337a867db2eb4863f1f34d6548604819738/src/Client.php#L141-L159 |
188,594 | matvp91/laravel-socket | src/Server.php | Server.getUrl | public function getUrl($include_scheme = true)
{
$parts = parse_url(url('/'));
$scheme = '';
if ($include_scheme) {
$scheme = 'ws://';
}
return $scheme . $parts['host'] . ':' . $this->port;
} | php | public function getUrl($include_scheme = true)
{
$parts = parse_url(url('/'));
$scheme = '';
if ($include_scheme) {
$scheme = 'ws://';
}
return $scheme . $parts['host'] . ':' . $this->port;
} | [
"public",
"function",
"getUrl",
"(",
"$",
"include_scheme",
"=",
"true",
")",
"{",
"$",
"parts",
"=",
"parse_url",
"(",
"url",
"(",
"'/'",
")",
")",
";",
"$",
"scheme",
"=",
"''",
";",
"if",
"(",
"$",
"include_scheme",
")",
"{",
"$",
"scheme",
"=",... | Constructs and gets the endpoint URL.
@return string | [
"Constructs",
"and",
"gets",
"the",
"endpoint",
"URL",
"."
] | 0b087337a867db2eb4863f1f34d6548604819738 | https://github.com/matvp91/laravel-socket/blob/0b087337a867db2eb4863f1f34d6548604819738/src/Server.php#L96-L104 |
188,595 | matvp91/laravel-socket | src/Socket.php | Socket.javascript | public function javascript($url = null)
{
if (!$url) {
$parts = parse_url(url('/'));
if (!isset($parts['port'])) {
$parts['port'] = Config::get('socket.default_port');
}
$url = 'ws://' . $parts['host'] . ':' . $parts['port'];
}
... | php | public function javascript($url = null)
{
if (!$url) {
$parts = parse_url(url('/'));
if (!isset($parts['port'])) {
$parts['port'] = Config::get('socket.default_port');
}
$url = 'ws://' . $parts['host'] . ':' . $parts['port'];
}
... | [
"public",
"function",
"javascript",
"(",
"$",
"url",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"$",
"url",
")",
"{",
"$",
"parts",
"=",
"parse_url",
"(",
"url",
"(",
"'/'",
")",
")",
";",
"if",
"(",
"!",
"isset",
"(",
"$",
"parts",
"[",
"'port'",
... | Includes the javascript file and initializes the Socket javascript object.
@return string | [
"Includes",
"the",
"javascript",
"file",
"and",
"initializes",
"the",
"Socket",
"javascript",
"object",
"."
] | 0b087337a867db2eb4863f1f34d6548604819738 | https://github.com/matvp91/laravel-socket/blob/0b087337a867db2eb4863f1f34d6548604819738/src/Socket.php#L14-L28 |
188,596 | mailjet/mailjetBundle | src/Manager/CampaignDraftManager.php | CampaignDraftManager.findByCampaignDraftId | public function findByCampaignDraftId($CampaignId)
{
$response = $this->mailjet->get(Resources::$Campaigndraft,
['id' => $CampaignId]);
if (!$response->success()) {
$this->throwError("CampaignDraftManager:findByCampaignDraftId() failed",
$response);
}
... | php | public function findByCampaignDraftId($CampaignId)
{
$response = $this->mailjet->get(Resources::$Campaigndraft,
['id' => $CampaignId]);
if (!$response->success()) {
$this->throwError("CampaignDraftManager:findByCampaignDraftId() failed",
$response);
}
... | [
"public",
"function",
"findByCampaignDraftId",
"(",
"$",
"CampaignId",
")",
"{",
"$",
"response",
"=",
"$",
"this",
"->",
"mailjet",
"->",
"get",
"(",
"Resources",
"::",
"$",
"Campaigndraft",
",",
"[",
"'id'",
"=>",
"$",
"CampaignId",
"]",
")",
";",
"if"... | Access a given campaigndraft resource
@param string $CampaignId
@return array | [
"Access",
"a",
"given",
"campaigndraft",
"resource"
] | b733f4c28cf53ab7ee59f62764736d263881d739 | https://github.com/mailjet/mailjetBundle/blob/b733f4c28cf53ab7ee59f62764736d263881d739/src/Manager/CampaignDraftManager.php#L49-L59 |
188,597 | mailjet/mailjetBundle | src/Manager/CampaignDraftManager.php | CampaignDraftManager.create | public function create(CampaignDraft $campaignDraft)
{
$response = $this->mailjet->post(Resources::$Campaigndraft,
['body' => $campaignDraft->format()]);
if (!$response->success()) {
$this->throwError("CampaignDraftManager:create() failed", $response);
}
retu... | php | public function create(CampaignDraft $campaignDraft)
{
$response = $this->mailjet->post(Resources::$Campaigndraft,
['body' => $campaignDraft->format()]);
if (!$response->success()) {
$this->throwError("CampaignDraftManager:create() failed", $response);
}
retu... | [
"public",
"function",
"create",
"(",
"CampaignDraft",
"$",
"campaignDraft",
")",
"{",
"$",
"response",
"=",
"$",
"this",
"->",
"mailjet",
"->",
"post",
"(",
"Resources",
"::",
"$",
"Campaigndraft",
",",
"[",
"'body'",
"=>",
"$",
"campaignDraft",
"->",
"for... | create a new fresh CampaignDraft
@param Campaigndraft $campaignDraft | [
"create",
"a",
"new",
"fresh",
"CampaignDraft"
] | b733f4c28cf53ab7ee59f62764736d263881d739 | https://github.com/mailjet/mailjetBundle/blob/b733f4c28cf53ab7ee59f62764736d263881d739/src/Manager/CampaignDraftManager.php#L65-L74 |
188,598 | mailjet/mailjetBundle | src/Manager/CampaignDraftManager.php | CampaignDraftManager.update | public function update($CampaignId, CampaignDraft $campaignDraft)
{
$response = $this->mailjet->put(Resources::$Campaigndraft,
['id' => $CampaignId, 'body' => $campaignDraft->format()]);
if (!$response->success()) {
$this->throwError("CampaignDraftManager:update() failed", $r... | php | public function update($CampaignId, CampaignDraft $campaignDraft)
{
$response = $this->mailjet->put(Resources::$Campaigndraft,
['id' => $CampaignId, 'body' => $campaignDraft->format()]);
if (!$response->success()) {
$this->throwError("CampaignDraftManager:update() failed", $r... | [
"public",
"function",
"update",
"(",
"$",
"CampaignId",
",",
"CampaignDraft",
"$",
"campaignDraft",
")",
"{",
"$",
"response",
"=",
"$",
"this",
"->",
"mailjet",
"->",
"put",
"(",
"Resources",
"::",
"$",
"Campaigndraft",
",",
"[",
"'id'",
"=>",
"$",
"Cam... | Update one specific campaigndraft resource
@param int $id
@param Campaigndraft $campaignDraft | [
"Update",
"one",
"specific",
"campaigndraft",
"resource"
] | b733f4c28cf53ab7ee59f62764736d263881d739 | https://github.com/mailjet/mailjetBundle/blob/b733f4c28cf53ab7ee59f62764736d263881d739/src/Manager/CampaignDraftManager.php#L81-L90 |
188,599 | mailjet/mailjetBundle | src/Manager/CampaignDraftManager.php | CampaignDraftManager.removeSchedule | public function removeSchedule($CampaignId)
{
$response = $this->mailjet->delete(Resources::$CampaigndraftSchedule,
['id' => $CampaignId]);
if (!$response->success()) {
$this->throwError("CampaignDraftManager:removeSchedule failed",
$response);
}
... | php | public function removeSchedule($CampaignId)
{
$response = $this->mailjet->delete(Resources::$CampaigndraftSchedule,
['id' => $CampaignId]);
if (!$response->success()) {
$this->throwError("CampaignDraftManager:removeSchedule failed",
$response);
}
... | [
"public",
"function",
"removeSchedule",
"(",
"$",
"CampaignId",
")",
"{",
"$",
"response",
"=",
"$",
"this",
"->",
"mailjet",
"->",
"delete",
"(",
"Resources",
"::",
"$",
"CampaigndraftSchedule",
",",
"[",
"'id'",
"=>",
"$",
"CampaignId",
"]",
")",
";",
... | Cancel a future sending
@param string Campaign $id
@return array | [
"Cancel",
"a",
"future",
"sending"
] | b733f4c28cf53ab7ee59f62764736d263881d739 | https://github.com/mailjet/mailjetBundle/blob/b733f4c28cf53ab7ee59f62764736d263881d739/src/Manager/CampaignDraftManager.php#L184-L194 |
Subsets and Splits
Yii Code Samples
Gathers all records from test, train, and validation sets that contain the word 'yii', providing a basic filtered view of the dataset relevant to Yii-related content.