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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
190,600 | taq/torm | src/Scopes.php | Scopes.resolveScope | public static function resolveScope($name, $args=null, $cls=null)
{
$conditions = self::getScope($name, $cls);
if (!$conditions) {
return null;
}
if (is_callable($conditions)) {
$conditions = $conditions($args);
}
return self::where($condition... | php | public static function resolveScope($name, $args=null, $cls=null)
{
$conditions = self::getScope($name, $cls);
if (!$conditions) {
return null;
}
if (is_callable($conditions)) {
$conditions = $conditions($args);
}
return self::where($condition... | [
"public",
"static",
"function",
"resolveScope",
"(",
"$",
"name",
",",
"$",
"args",
"=",
"null",
",",
"$",
"cls",
"=",
"null",
")",
"{",
"$",
"conditions",
"=",
"self",
"::",
"getScope",
"(",
"$",
"name",
",",
"$",
"cls",
")",
";",
"if",
"(",
"!"... | Resolve a scope, returning a collection
@param string $name of scope
@param mixed $args arguments to use on callable scopes
@param string $cls class of scope
@return mixed collection | [
"Resolve",
"a",
"scope",
"returning",
"a",
"collection"
] | 9db401ffd313af1b54e769cae90c00d6fce8dc81 | https://github.com/taq/torm/blob/9db401ffd313af1b54e769cae90c00d6fce8dc81/src/Scopes.php#L74-L85 |
190,601 | clickalicious/memcached-php | src/Clickalicious/Memcached/Client.php | Client.connect | public function connect($host, $port, $timeout = null)
{
$uuid = $this->uuid($host, $port);
if ($timeout === null) {
$timeout = $this->getTimeout();
}
// The error variables
$errorNumber = null;
$errorString = 'n.a.';
if (isset(self::$connection... | php | public function connect($host, $port, $timeout = null)
{
$uuid = $this->uuid($host, $port);
if ($timeout === null) {
$timeout = $this->getTimeout();
}
// The error variables
$errorNumber = null;
$errorString = 'n.a.';
if (isset(self::$connection... | [
"public",
"function",
"connect",
"(",
"$",
"host",
",",
"$",
"port",
",",
"$",
"timeout",
"=",
"null",
")",
"{",
"$",
"uuid",
"=",
"$",
"this",
"->",
"uuid",
"(",
"$",
"host",
",",
"$",
"port",
")",
";",
"if",
"(",
"$",
"timeout",
"===",
"null"... | Connects to a Memcached host.
@param string $host The host to connect to
@param int $port The port the Memcached daemon is listening on
@param int|null $timeout Timeout in seconds
@author Benjamin Carl <opensource@clickalicious.de>
@return resource|null The resource (socket) on success, otherwise NULL
@a... | [
"Connects",
"to",
"a",
"Memcached",
"host",
"."
] | f2aace26abb04f7fc229c80915ee4f3dbe2d1261 | https://github.com/clickalicious/memcached-php/blob/f2aace26abb04f7fc229c80915ee4f3dbe2d1261/src/Clickalicious/Memcached/Client.php#L934-L986 |
190,602 | clickalicious/memcached-php | src/Clickalicious/Memcached/Client.php | Client.send | public function send($command, $data = '')
{
// Reset state - ensure clean start.
$this->reset();
// Check if command is allowed
if (in_array($command, $this->allowedCommands) === false) {
throw new Exception(
sprintf('The command "%s" is not allowed!', $... | php | public function send($command, $data = '')
{
// Reset state - ensure clean start.
$this->reset();
// Check if command is allowed
if (in_array($command, $this->allowedCommands) === false) {
throw new Exception(
sprintf('The command "%s" is not allowed!', $... | [
"public",
"function",
"send",
"(",
"$",
"command",
",",
"$",
"data",
"=",
"''",
")",
"{",
"// Reset state - ensure clean start.",
"$",
"this",
"->",
"reset",
"(",
")",
";",
"// Check if command is allowed",
"if",
"(",
"in_array",
"(",
"$",
"command",
",",
"$... | Sends a command to a Memcached instance and returns the parsed result.
@param string $command The command to send to Memcached daemon
@param string $data The data to pass with command
@author Benjamin Carl <opensource@clickalicious.de>
@return mixed|array The result from Memcached daemon
@access public
@throws \Cl... | [
"Sends",
"a",
"command",
"to",
"a",
"Memcached",
"instance",
"and",
"returns",
"the",
"parsed",
"result",
"."
] | f2aace26abb04f7fc229c80915ee4f3dbe2d1261 | https://github.com/clickalicious/memcached-php/blob/f2aace26abb04f7fc229c80915ee4f3dbe2d1261/src/Clickalicious/Memcached/Client.php#L999-L1052 |
190,603 | clickalicious/memcached-php | src/Clickalicious/Memcached/Client.php | Client.touch | public function touch($key, $expiration)
{
/**
* touch <key> <exptime> [noreply]\r\n
*/
// Build packet to send ...
$data = self::COMMAND_TOUCH . self::COMMAND_SEPARATOR .
$key . self::COMMAND_SEPARATOR .
$expiration ... | php | public function touch($key, $expiration)
{
/**
* touch <key> <exptime> [noreply]\r\n
*/
// Build packet to send ...
$data = self::COMMAND_TOUCH . self::COMMAND_SEPARATOR .
$key . self::COMMAND_SEPARATOR .
$expiration ... | [
"public",
"function",
"touch",
"(",
"$",
"key",
",",
"$",
"expiration",
")",
"{",
"/**\n * touch <key> <exptime> [noreply]\\r\\n\n */",
"// Build packet to send ...",
"$",
"data",
"=",
"self",
"::",
"COMMAND_TOUCH",
".",
"self",
"::",
"COMMAND_SEPARATOR",
... | Touch an existing key by offset.
@param string $key The key to touch
@param int $expiration When to expire
@author Benjamin Carl <opensource@clickalicious.de>
@return string The result of operation
@access public
@codeCoverageIgnore | [
"Touch",
"an",
"existing",
"key",
"by",
"offset",
"."
] | f2aace26abb04f7fc229c80915ee4f3dbe2d1261 | https://github.com/clickalicious/memcached-php/blob/f2aace26abb04f7fc229c80915ee4f3dbe2d1261/src/Clickalicious/Memcached/Client.php#L1065-L1077 |
190,604 | clickalicious/memcached-php | src/Clickalicious/Memcached/Client.php | Client.incr | public function incr($key, $offset = 1)
{
/**
* incr <key> <value> [noreply]\r\n
*/
// Build packet to send ...
$data = self::COMMAND_INCR . self::COMMAND_SEPARATOR .
$key . self::COMMAND_SEPARATOR .
$offset ... | php | public function incr($key, $offset = 1)
{
/**
* incr <key> <value> [noreply]\r\n
*/
// Build packet to send ...
$data = self::COMMAND_INCR . self::COMMAND_SEPARATOR .
$key . self::COMMAND_SEPARATOR .
$offset ... | [
"public",
"function",
"incr",
"(",
"$",
"key",
",",
"$",
"offset",
"=",
"1",
")",
"{",
"/**\n * incr <key> <value> [noreply]\\r\\n\n */",
"// Build packet to send ...",
"$",
"data",
"=",
"self",
"::",
"COMMAND_INCR",
".",
"self",
"::",
"COMMAND_SEPARAT... | Increments an existing key by offset.
Does currently not support the creation of not existing keys.
@param string $key The key to increment
@param int $offset How much to increment
@author Benjamin Carl <opensource@clickalicious.de>
@return string The result of operation
@access public | [
"Increments",
"an",
"existing",
"key",
"by",
"offset",
".",
"Does",
"currently",
"not",
"support",
"the",
"creation",
"of",
"not",
"existing",
"keys",
"."
] | f2aace26abb04f7fc229c80915ee4f3dbe2d1261 | https://github.com/clickalicious/memcached-php/blob/f2aace26abb04f7fc229c80915ee4f3dbe2d1261/src/Clickalicious/Memcached/Client.php#L1105-L1117 |
190,605 | clickalicious/memcached-php | src/Clickalicious/Memcached/Client.php | Client.decr | public function decr($key, $offset = 1)
{
/**
* decr <key> <value> [noreply]\r\n
*/
// Build packet to send ...
$data = self::COMMAND_DECR . self::COMMAND_SEPARATOR .
$key . self::COMMAND_SEPARATOR .
$offset ... | php | public function decr($key, $offset = 1)
{
/**
* decr <key> <value> [noreply]\r\n
*/
// Build packet to send ...
$data = self::COMMAND_DECR . self::COMMAND_SEPARATOR .
$key . self::COMMAND_SEPARATOR .
$offset ... | [
"public",
"function",
"decr",
"(",
"$",
"key",
",",
"$",
"offset",
"=",
"1",
")",
"{",
"/**\n * decr <key> <value> [noreply]\\r\\n\n */",
"// Build packet to send ...",
"$",
"data",
"=",
"self",
"::",
"COMMAND_DECR",
".",
"self",
"::",
"COMMAND_SEPARAT... | Decrements an existing key by offset.
Does currently not support the creation of not existing keys.
@param string $key The key to decrement
@param int $offset How much to decrement
@author Benjamin Carl <opensource@clickalicious.de>
@return string The result of operation
@access public | [
"Decrements",
"an",
"existing",
"key",
"by",
"offset",
".",
"Does",
"currently",
"not",
"support",
"the",
"creation",
"of",
"not",
"existing",
"keys",
"."
] | f2aace26abb04f7fc229c80915ee4f3dbe2d1261 | https://github.com/clickalicious/memcached-php/blob/f2aace26abb04f7fc229c80915ee4f3dbe2d1261/src/Clickalicious/Memcached/Client.php#L1145-L1157 |
190,606 | clickalicious/memcached-php | src/Clickalicious/Memcached/Client.php | Client.set | public function set($key, $value, $expiration = 0, $flags = 0, $bytes = null)
{
/**
* set <key> <flags> <exptime> <bytes> [noreply]\r\n
* <value>\r\n
*/
// Run through our serializer
$serialized = $this->serializeValue($value);
$value = $serialized['value... | php | public function set($key, $value, $expiration = 0, $flags = 0, $bytes = null)
{
/**
* set <key> <flags> <exptime> <bytes> [noreply]\r\n
* <value>\r\n
*/
// Run through our serializer
$serialized = $this->serializeValue($value);
$value = $serialized['value... | [
"public",
"function",
"set",
"(",
"$",
"key",
",",
"$",
"value",
",",
"$",
"expiration",
"=",
"0",
",",
"$",
"flags",
"=",
"0",
",",
"$",
"bytes",
"=",
"null",
")",
"{",
"/**\n * set <key> <flags> <exptime> <bytes> [noreply]\\r\\n\n * <value>\\r\\n... | Sets a key with value and the passed metadata on Memcached instance.
"set" means "store this data".
@param string $key The key to set
@param mixed $value The value to set
@param int $expiration The expire time as seconds from now (must be < 30 days) OR a timestamp
@param int $flags The ... | [
"Sets",
"a",
"key",
"with",
"value",
"and",
"the",
"passed",
"metadata",
"on",
"Memcached",
"instance",
".",
"set",
"means",
"store",
"this",
"data",
"."
] | f2aace26abb04f7fc229c80915ee4f3dbe2d1261 | https://github.com/clickalicious/memcached-php/blob/f2aace26abb04f7fc229c80915ee4f3dbe2d1261/src/Clickalicious/Memcached/Client.php#L1173-L1199 |
190,607 | clickalicious/memcached-php | src/Clickalicious/Memcached/Client.php | Client.append | public function append($key, $value, $expiration = 0, $flags = self::FLAG_DEFAULT, $bytes = null)
{
/**
* replace <key> <flags> <exptime> <bytes> [noreply]\r\n
* <value>\r\n
*/
// Calculate bytes if not precalculated
$bytes = ($bytes !== null) ? $bytes : strlen($v... | php | public function append($key, $value, $expiration = 0, $flags = self::FLAG_DEFAULT, $bytes = null)
{
/**
* replace <key> <flags> <exptime> <bytes> [noreply]\r\n
* <value>\r\n
*/
// Calculate bytes if not precalculated
$bytes = ($bytes !== null) ? $bytes : strlen($v... | [
"public",
"function",
"append",
"(",
"$",
"key",
",",
"$",
"value",
",",
"$",
"expiration",
"=",
"0",
",",
"$",
"flags",
"=",
"self",
"::",
"FLAG_DEFAULT",
",",
"$",
"bytes",
"=",
"null",
")",
"{",
"/**\n * replace <key> <flags> <exptime> <bytes> [nore... | Appends a key with value and the passed metadata on Memcached instance.
"append" means "add this data to an existing key after existing data".
@param string $key The key to set
@param mixed $value The value to set
@param int $expiration The expire time as seconds from now (must be < 30 days) OR a... | [
"Appends",
"a",
"key",
"with",
"value",
"and",
"the",
"passed",
"metadata",
"on",
"Memcached",
"instance",
".",
"append",
"means",
"add",
"this",
"data",
"to",
"an",
"existing",
"key",
"after",
"existing",
"data",
"."
] | f2aace26abb04f7fc229c80915ee4f3dbe2d1261 | https://github.com/clickalicious/memcached-php/blob/f2aace26abb04f7fc229c80915ee4f3dbe2d1261/src/Clickalicious/Memcached/Client.php#L1301-L1320 |
190,608 | clickalicious/memcached-php | src/Clickalicious/Memcached/Client.php | Client.prepend | public function prepend($key, $value, $expiration = 0, $flags = self::FLAG_DEFAULT, $bytes = null)
{
/**
* replace <key> <flags> <exptime> <bytes> [noreply]\r\n
* <value>\r\n
*/
// Calculate bytes if not precalculated
$bytes = ($bytes !== null) ? $bytes : strlen($... | php | public function prepend($key, $value, $expiration = 0, $flags = self::FLAG_DEFAULT, $bytes = null)
{
/**
* replace <key> <flags> <exptime> <bytes> [noreply]\r\n
* <value>\r\n
*/
// Calculate bytes if not precalculated
$bytes = ($bytes !== null) ? $bytes : strlen($... | [
"public",
"function",
"prepend",
"(",
"$",
"key",
",",
"$",
"value",
",",
"$",
"expiration",
"=",
"0",
",",
"$",
"flags",
"=",
"self",
"::",
"FLAG_DEFAULT",
",",
"$",
"bytes",
"=",
"null",
")",
"{",
"/**\n * replace <key> <flags> <exptime> <bytes> [nor... | Prepends data to an existing key before existing data.
"prepend" means "add this data to an existing key before existing data".
@param string $key The key to set
@param mixed $value The value to set
@param int $expiration The expire time as seconds from now (must be < 30 days) OR a timestamp
@par... | [
"Prepends",
"data",
"to",
"an",
"existing",
"key",
"before",
"existing",
"data",
".",
"prepend",
"means",
"add",
"this",
"data",
"to",
"an",
"existing",
"key",
"before",
"existing",
"data",
"."
] | f2aace26abb04f7fc229c80915ee4f3dbe2d1261 | https://github.com/clickalicious/memcached-php/blob/f2aace26abb04f7fc229c80915ee4f3dbe2d1261/src/Clickalicious/Memcached/Client.php#L1336-L1355 |
190,609 | clickalicious/memcached-php | src/Clickalicious/Memcached/Client.php | Client.cas | public function cas($token, $key, $value, $expiration = 0, $flags = self::FLAG_DEFAULT, $bytes = null)
{
/**
* cas <key> <flags> <exptime> <bytes> <cas unique> [noreply]\r\n
* <value>\r\n
*/
// Run through our serializer
$serialized = $this->serializeValue($value)... | php | public function cas($token, $key, $value, $expiration = 0, $flags = self::FLAG_DEFAULT, $bytes = null)
{
/**
* cas <key> <flags> <exptime> <bytes> <cas unique> [noreply]\r\n
* <value>\r\n
*/
// Run through our serializer
$serialized = $this->serializeValue($value)... | [
"public",
"function",
"cas",
"(",
"$",
"token",
",",
"$",
"key",
",",
"$",
"value",
",",
"$",
"expiration",
"=",
"0",
",",
"$",
"flags",
"=",
"self",
"::",
"FLAG_DEFAULT",
",",
"$",
"bytes",
"=",
"null",
")",
"{",
"/**\n * cas <key> <flags> <expt... | Tries to set a key value pair by using a cas token.
If value was updated between the moment when retrieving the cas-value and the
moment now calling this method the cas has changed and update will fail.
@param string $token a unique 64-bit value of an existing entry.
Clients should use the value returned from t... | [
"Tries",
"to",
"set",
"a",
"key",
"value",
"pair",
"by",
"using",
"a",
"cas",
"token",
".",
"If",
"value",
"was",
"updated",
"between",
"the",
"moment",
"when",
"retrieving",
"the",
"cas",
"-",
"value",
"and",
"the",
"moment",
"now",
"calling",
"this",
... | f2aace26abb04f7fc229c80915ee4f3dbe2d1261 | https://github.com/clickalicious/memcached-php/blob/f2aace26abb04f7fc229c80915ee4f3dbe2d1261/src/Clickalicious/Memcached/Client.php#L1375-L1402 |
190,610 | clickalicious/memcached-php | src/Clickalicious/Memcached/Client.php | Client.get | public function get($key, $metadata = false)
{
/**
* get <key>*\r\n
*/
// Build packet to send ...
$data = self::COMMAND_GET . self::COMMAND_SEPARATOR .
$key . self::COMMAND_TERMINATOR;
$result = $this->send(self::COMMAND_GET, $data)... | php | public function get($key, $metadata = false)
{
/**
* get <key>*\r\n
*/
// Build packet to send ...
$data = self::COMMAND_GET . self::COMMAND_SEPARATOR .
$key . self::COMMAND_TERMINATOR;
$result = $this->send(self::COMMAND_GET, $data)... | [
"public",
"function",
"get",
"(",
"$",
"key",
",",
"$",
"metadata",
"=",
"false",
")",
"{",
"/**\n * get <key>*\\r\\n\n */",
"// Build packet to send ...",
"$",
"data",
"=",
"self",
"::",
"COMMAND_GET",
".",
"self",
"::",
"COMMAND_SEPARATOR",
".",
... | Returns the response for passed key.
@param string $key The key to return response for.
@param bool $metadata TRUE to return metadata like lifetime ... as well, FALSE to return value only
@author Benjamin Carl <opensource@clickalicious.de>
@return mixed The response for command get
@access public | [
"Returns",
"the",
"response",
"for",
"passed",
"key",
"."
] | f2aace26abb04f7fc229c80915ee4f3dbe2d1261 | https://github.com/clickalicious/memcached-php/blob/f2aace26abb04f7fc229c80915ee4f3dbe2d1261/src/Clickalicious/Memcached/Client.php#L1414-L1433 |
190,611 | clickalicious/memcached-php | src/Clickalicious/Memcached/Client.php | Client.gets | public function gets(array $keys, $metadata = false)
{
/**
* gets <key>*\r\n
*/
// Build key request string
$keys = implode(self::COMMAND_SEPARATOR, $keys);
// Build packet to send ...
$data = self::COMMAND_GETS . self::COMMAND_SEPARATOR .
$k... | php | public function gets(array $keys, $metadata = false)
{
/**
* gets <key>*\r\n
*/
// Build key request string
$keys = implode(self::COMMAND_SEPARATOR, $keys);
// Build packet to send ...
$data = self::COMMAND_GETS . self::COMMAND_SEPARATOR .
$k... | [
"public",
"function",
"gets",
"(",
"array",
"$",
"keys",
",",
"$",
"metadata",
"=",
"false",
")",
"{",
"/**\n * gets <key>*\\r\\n\n */",
"// Build key request string",
"$",
"keys",
"=",
"implode",
"(",
"self",
"::",
"COMMAND_SEPARATOR",
",",
"$",
"... | Returns the response for passed keys.
@param array $keys The keys to return response for.
@param bool $metadata TRUE to return metadata like lifetime ... as well, FALSE to return value only
@author Benjamin Carl <opensource@clickalicious.de>
@return mixed The response for command get
@access public | [
"Returns",
"the",
"response",
"for",
"passed",
"keys",
"."
] | f2aace26abb04f7fc229c80915ee4f3dbe2d1261 | https://github.com/clickalicious/memcached-php/blob/f2aace26abb04f7fc229c80915ee4f3dbe2d1261/src/Clickalicious/Memcached/Client.php#L1445-L1466 |
190,612 | clickalicious/memcached-php | src/Clickalicious/Memcached/Client.php | Client.stats | public function stats($type = '', $argument1 = '', $argument2 = '')
{
/**
* stats <type> [noreply]\r\n
* [TYPES <reset, malloc, maps, cachedump, slabs, items, sizes>]
*/
if ($type !== '') {
$type = self::COMMAND_SEPARATOR . $type;
}
if ($argum... | php | public function stats($type = '', $argument1 = '', $argument2 = '')
{
/**
* stats <type> [noreply]\r\n
* [TYPES <reset, malloc, maps, cachedump, slabs, items, sizes>]
*/
if ($type !== '') {
$type = self::COMMAND_SEPARATOR . $type;
}
if ($argum... | [
"public",
"function",
"stats",
"(",
"$",
"type",
"=",
"''",
",",
"$",
"argument1",
"=",
"''",
",",
"$",
"argument2",
"=",
"''",
")",
"{",
"/**\n * stats <type> [noreply]\\r\\n\n * [TYPES <reset, malloc, maps, cachedump, slabs, items, sizes>]\n */",
"... | Stats - sends the stats command with default or custom type to Memcached instance.
@param string $type The type to send to Memcached instance.
@param string $argument1 Optional additional argument.
@param string $argument2 Optional additional argument.
@author Benjamin Carl <opensource@clickalicious.de>
@return ... | [
"Stats",
"-",
"sends",
"the",
"stats",
"command",
"with",
"default",
"or",
"custom",
"type",
"to",
"Memcached",
"instance",
"."
] | f2aace26abb04f7fc229c80915ee4f3dbe2d1261 | https://github.com/clickalicious/memcached-php/blob/f2aace26abb04f7fc229c80915ee4f3dbe2d1261/src/Clickalicious/Memcached/Client.php#L1501-L1589 |
190,613 | clickalicious/memcached-php | src/Clickalicious/Memcached/Client.php | Client.version | public function version()
{
/**
* version\r\n
*/
// Build packet to send ...
$data = self::COMMAND_VERSION . self::COMMAND_TERMINATOR;
return $this->send(self::COMMAND_VERSION, $data);
} | php | public function version()
{
/**
* version\r\n
*/
// Build packet to send ...
$data = self::COMMAND_VERSION . self::COMMAND_TERMINATOR;
return $this->send(self::COMMAND_VERSION, $data);
} | [
"public",
"function",
"version",
"(",
")",
"{",
"/**\n * version\\r\\n\n */",
"// Build packet to send ...",
"$",
"data",
"=",
"self",
"::",
"COMMAND_VERSION",
".",
"self",
"::",
"COMMAND_TERMINATOR",
";",
"return",
"$",
"this",
"->",
"send",
"(",
"s... | Version - sends the version command to Memcached instance and returns the result.
@author Benjamin Carl <opensource@clickalicious.de>
@return mixed The response for command version
@access public | [
"Version",
"-",
"sends",
"the",
"version",
"command",
"to",
"Memcached",
"instance",
"and",
"returns",
"the",
"result",
"."
] | f2aace26abb04f7fc229c80915ee4f3dbe2d1261 | https://github.com/clickalicious/memcached-php/blob/f2aace26abb04f7fc229c80915ee4f3dbe2d1261/src/Clickalicious/Memcached/Client.php#L1598-L1608 |
190,614 | clickalicious/memcached-php | src/Clickalicious/Memcached/Client.php | Client.flush_all | public function flush_all()
{
/**
* flush_all\r\n
*/
// Build packet to send ...
$data = self::COMMAND_FLUSH_ALL . self::COMMAND_TERMINATOR;
return $this->send(self::COMMAND_FLUSH_ALL, $data);
} | php | public function flush_all()
{
/**
* flush_all\r\n
*/
// Build packet to send ...
$data = self::COMMAND_FLUSH_ALL . self::COMMAND_TERMINATOR;
return $this->send(self::COMMAND_FLUSH_ALL, $data);
} | [
"public",
"function",
"flush_all",
"(",
")",
"{",
"/**\n * flush_all\\r\\n\n */",
"// Build packet to send ...",
"$",
"data",
"=",
"self",
"::",
"COMMAND_FLUSH_ALL",
".",
"self",
"::",
"COMMAND_TERMINATOR",
";",
"return",
"$",
"this",
"->",
"send",
"("... | Flush - sends the flush_all command to Memcached instance and returns the result.
@author Benjamin Carl <opensource@clickalicious.de>
@return mixed The response for command version
@access public | [
"Flush",
"-",
"sends",
"the",
"flush_all",
"command",
"to",
"Memcached",
"instance",
"and",
"returns",
"the",
"result",
"."
] | f2aace26abb04f7fc229c80915ee4f3dbe2d1261 | https://github.com/clickalicious/memcached-php/blob/f2aace26abb04f7fc229c80915ee4f3dbe2d1261/src/Clickalicious/Memcached/Client.php#L1629-L1639 |
190,615 | clickalicious/memcached-php | src/Clickalicious/Memcached/Client.php | Client.parseVersionResponse | protected function parseVersionResponse(array $lines)
{
// Extract meta data
$metaData = explode(self::COMMAND_SEPARATOR, $lines[0]);
// If Version response valid
if ($metaData[0] === strtoupper(self::COMMAND_VERSION)) {
$result = $metaData[1];
} else {
... | php | protected function parseVersionResponse(array $lines)
{
// Extract meta data
$metaData = explode(self::COMMAND_SEPARATOR, $lines[0]);
// If Version response valid
if ($metaData[0] === strtoupper(self::COMMAND_VERSION)) {
$result = $metaData[1];
} else {
... | [
"protected",
"function",
"parseVersionResponse",
"(",
"array",
"$",
"lines",
")",
"{",
"// Extract meta data",
"$",
"metaData",
"=",
"explode",
"(",
"self",
"::",
"COMMAND_SEPARATOR",
",",
"$",
"lines",
"[",
"0",
"]",
")",
";",
"// If Version response valid",
"i... | Parser for response of version request.
SUCCESS = RESPONSE = "\r\n"
FAILED = RESPONSE = "???"
@param array $lines Response split into single lines
@author Benjamin Carl <opensource@clickalicious.de>
@return string|bool The version as string if valid, otherwise FALSE
@access protected | [
"Parser",
"for",
"response",
"of",
"version",
"request",
"."
] | f2aace26abb04f7fc229c80915ee4f3dbe2d1261 | https://github.com/clickalicious/memcached-php/blob/f2aace26abb04f7fc229c80915ee4f3dbe2d1261/src/Clickalicious/Memcached/Client.php#L2118-L2132 |
190,616 | clickalicious/memcached-php | src/Clickalicious/Memcached/Client.php | Client.parseArithmeticResponse | protected function parseArithmeticResponse($buffer, array $lines)
{
// Extract meta-data
$metaData = explode(self::COMMAND_SEPARATOR, $lines[0]);
// Check buffer for failure response
if ($buffer === self::RESPONSE_NOT_FOUND . self::COMMAND_TERMINATOR) {
$result = $this->... | php | protected function parseArithmeticResponse($buffer, array $lines)
{
// Extract meta-data
$metaData = explode(self::COMMAND_SEPARATOR, $lines[0]);
// Check buffer for failure response
if ($buffer === self::RESPONSE_NOT_FOUND . self::COMMAND_TERMINATOR) {
$result = $this->... | [
"protected",
"function",
"parseArithmeticResponse",
"(",
"$",
"buffer",
",",
"array",
"$",
"lines",
")",
"{",
"// Extract meta-data",
"$",
"metaData",
"=",
"explode",
"(",
"self",
"::",
"COMMAND_SEPARATOR",
",",
"$",
"lines",
"[",
"0",
"]",
")",
";",
"// Che... | Parser for response of arithmetic request.
SUCCESS = RESPONSE = "NEW VALUE AFTER OPERATION [2 will incr to X] OR [1 will decr to Y] ..."
FAILED = RESPONSE = "NOT_FOUND"
@param string $buffer The buffer to parse
@param array $lines Response split into single lines
@author Benjamin Carl <opensource@clickalicious.de... | [
"Parser",
"for",
"response",
"of",
"arithmetic",
"request",
"."
] | f2aace26abb04f7fc229c80915ee4f3dbe2d1261 | https://github.com/clickalicious/memcached-php/blob/f2aace26abb04f7fc229c80915ee4f3dbe2d1261/src/Clickalicious/Memcached/Client.php#L2147-L2162 |
190,617 | clickalicious/memcached-php | src/Clickalicious/Memcached/Client.php | Client.checkResponse | protected function checkResponse($buffer)
{
// Check for HARD errors. Not an unsuccessful response from command -> here = real errors
if (preg_match('/' . self::ERROR . '(.*)\R/mu', $buffer, $error) > 0) {
// ERROR\r\n
$result = self::MEMCACHED_FAILURE;
} elseif (pre... | php | protected function checkResponse($buffer)
{
// Check for HARD errors. Not an unsuccessful response from command -> here = real errors
if (preg_match('/' . self::ERROR . '(.*)\R/mu', $buffer, $error) > 0) {
// ERROR\r\n
$result = self::MEMCACHED_FAILURE;
} elseif (pre... | [
"protected",
"function",
"checkResponse",
"(",
"$",
"buffer",
")",
"{",
"// Check for HARD errors. Not an unsuccessful response from command -> here = real errors",
"if",
"(",
"preg_match",
"(",
"'/'",
".",
"self",
"::",
"ERROR",
".",
"'(.*)\\R/mu'",
",",
"$",
"buffer",
... | Checks if a response contains some sort of hard errors or if it is parseable by the further process.
@param string $buffer The buffer to check
@author Benjamin Carl <opensource@clickalicious.de>
@return bool TRUE on success, otherwise FALSE if response contains ERROR(s)
@access protected | [
"Checks",
"if",
"a",
"response",
"contains",
"some",
"sort",
"of",
"hard",
"errors",
"or",
"if",
"it",
"is",
"parseable",
"by",
"the",
"further",
"process",
"."
] | f2aace26abb04f7fc229c80915ee4f3dbe2d1261 | https://github.com/clickalicious/memcached-php/blob/f2aace26abb04f7fc229c80915ee4f3dbe2d1261/src/Clickalicious/Memcached/Client.php#L2173-L2194 |
190,618 | clickalicious/memcached-php | src/Clickalicious/Memcached/Client.php | Client.parseResponse | protected function parseResponse($command, $buffer)
{
// At this point we retrieve a raw response containing at least a trailing terminator - rip it
$response = substr($buffer, 0, strlen($buffer) - strlen(self::COMMAND_TERMINATOR));
$lines = explode(self::COMMAND_TERMINATOR, $response);
... | php | protected function parseResponse($command, $buffer)
{
// At this point we retrieve a raw response containing at least a trailing terminator - rip it
$response = substr($buffer, 0, strlen($buffer) - strlen(self::COMMAND_TERMINATOR));
$lines = explode(self::COMMAND_TERMINATOR, $response);
... | [
"protected",
"function",
"parseResponse",
"(",
"$",
"command",
",",
"$",
"buffer",
")",
"{",
"// At this point we retrieve a raw response containing at least a trailing terminator - rip it",
"$",
"response",
"=",
"substr",
"(",
"$",
"buffer",
",",
"0",
",",
"strlen",
"(... | Parses a response from a Memcached daemon
@param string $command The command which has triggered the buffer response from instance.
@param string $buffer The buffer to parse.
@author Benjamin Carl <opensource@clickalicious.de>
@return bool|mixed FALSE on error, otherwise parsed response
@access protected
@throws \Cl... | [
"Parses",
"a",
"response",
"from",
"a",
"Memcached",
"daemon"
] | f2aace26abb04f7fc229c80915ee4f3dbe2d1261 | https://github.com/clickalicious/memcached-php/blob/f2aace26abb04f7fc229c80915ee4f3dbe2d1261/src/Clickalicious/Memcached/Client.php#L2207-L2264 |
190,619 | clickalicious/memcached-php | src/Clickalicious/Memcached/Client.php | Client.serializeValue | protected function serializeValue($value)
{
if ($this->isSerializable($value) === true) {
// Activate default bit to detect serialization
$value = serialize($value);
$bytes = strlen($value);
$flags = self::FLAG_DECIMAL_SERIALIZED;
} else {
... | php | protected function serializeValue($value)
{
if ($this->isSerializable($value) === true) {
// Activate default bit to detect serialization
$value = serialize($value);
$bytes = strlen($value);
$flags = self::FLAG_DECIMAL_SERIALIZED;
} else {
... | [
"protected",
"function",
"serializeValue",
"(",
"$",
"value",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"isSerializable",
"(",
"$",
"value",
")",
"===",
"true",
")",
"{",
"// Activate default bit to detect serialization",
"$",
"value",
"=",
"serialize",
"(",
"$"... | Serializes a value if it is serializable in our meaning.
@param mixed $value The value to serialize
@author Benjamin Carl <opensource@clickalicious.de>
@return array ...
@access protected
@throws \Clickalicious\Memcached\Exception | [
"Serializes",
"a",
"value",
"if",
"it",
"is",
"serializable",
"in",
"our",
"meaning",
"."
] | f2aace26abb04f7fc229c80915ee4f3dbe2d1261 | https://github.com/clickalicious/memcached-php/blob/f2aace26abb04f7fc229c80915ee4f3dbe2d1261/src/Clickalicious/Memcached/Client.php#L2276-L2314 |
190,620 | phly/conduit | src/FinalHandler.php | FinalHandler.handleError | private function handleError($error, Http\Request $request, Http\Response $response)
{
$response = $response->withStatus(
$this->getStatusCode($error, $response)
);
$message = $response->getReasonPhrase() ?: 'Unknown Error';
if (! isset($this->options['env'])
... | php | private function handleError($error, Http\Request $request, Http\Response $response)
{
$response = $response->withStatus(
$this->getStatusCode($error, $response)
);
$message = $response->getReasonPhrase() ?: 'Unknown Error';
if (! isset($this->options['env'])
... | [
"private",
"function",
"handleError",
"(",
"$",
"error",
",",
"Http",
"\\",
"Request",
"$",
"request",
",",
"Http",
"\\",
"Response",
"$",
"response",
")",
"{",
"$",
"response",
"=",
"$",
"response",
"->",
"withStatus",
"(",
"$",
"this",
"->",
"getStatus... | Handle an error condition
Use the $error to create details for the response.
@param mixed $error
@param Http\Request $request Request instance.
@param Http\Response $response Response instance.
@return Http\Response | [
"Handle",
"an",
"error",
"condition"
] | 29f6e8c87ce2b9a3e95bc5c2c7371f101081853d | https://github.com/phly/conduit/blob/29f6e8c87ce2b9a3e95bc5c2c7371f101081853d/src/FinalHandler.php#L58-L76 |
190,621 | phly/conduit | src/FinalHandler.php | FinalHandler.create404 | private function create404(Http\Request $request, Http\Response $response)
{
$response = $response->withStatus(404);
$originalRequest = $request->getOriginalRequest();
$uri = $originalRequest->getUri();
$escaper = new Escaper();
$message = s... | php | private function create404(Http\Request $request, Http\Response $response)
{
$response = $response->withStatus(404);
$originalRequest = $request->getOriginalRequest();
$uri = $originalRequest->getUri();
$escaper = new Escaper();
$message = s... | [
"private",
"function",
"create404",
"(",
"Http",
"\\",
"Request",
"$",
"request",
",",
"Http",
"\\",
"Response",
"$",
"response",
")",
"{",
"$",
"response",
"=",
"$",
"response",
"->",
"withStatus",
"(",
"404",
")",
";",
"$",
"originalRequest",
"=",
"$",... | Create a 404 status in the response
@param Http\Request $request Request instance.
@param Http\Response $response Response instance.
@return Http\Response | [
"Create",
"a",
"404",
"status",
"in",
"the",
"response"
] | 29f6e8c87ce2b9a3e95bc5c2c7371f101081853d | https://github.com/phly/conduit/blob/29f6e8c87ce2b9a3e95bc5c2c7371f101081853d/src/FinalHandler.php#L85-L97 |
190,622 | phly/conduit | src/FinalHandler.php | FinalHandler.getStatusCode | private function getStatusCode($error, Http\Response $response)
{
if ($error instanceof Exception
&& ($error->getCode() >= 400 && $error->getCode() < 600)
) {
return $error->getCode();
}
$status = $response->getStatusCode();
if (! $status || $status <... | php | private function getStatusCode($error, Http\Response $response)
{
if ($error instanceof Exception
&& ($error->getCode() >= 400 && $error->getCode() < 600)
) {
return $error->getCode();
}
$status = $response->getStatusCode();
if (! $status || $status <... | [
"private",
"function",
"getStatusCode",
"(",
"$",
"error",
",",
"Http",
"\\",
"Response",
"$",
"response",
")",
"{",
"if",
"(",
"$",
"error",
"instanceof",
"Exception",
"&&",
"(",
"$",
"error",
"->",
"getCode",
"(",
")",
">=",
"400",
"&&",
"$",
"error"... | Determine status code
If the error is an exception with a code between 400 and 599, returns
the exception code.
Otherwise, retrieves the code from the response; if not present, or
less than 400 or greater than 599, returns 500; otherwise, returns it.
@param mixed $error
@param Http\Response $response
@return int | [
"Determine",
"status",
"code"
] | 29f6e8c87ce2b9a3e95bc5c2c7371f101081853d | https://github.com/phly/conduit/blob/29f6e8c87ce2b9a3e95bc5c2c7371f101081853d/src/FinalHandler.php#L112-L125 |
190,623 | phly/conduit | src/FinalHandler.php | FinalHandler.triggerError | private function triggerError($error, Http\Request $request, Http\Response $response)
{
if (! isset($this->options['onerror'])
|| ! is_callable($this->options['onerror'])
) {
return;
}
$onError = $this->options['onerror'];
$onError($error, $request, $... | php | private function triggerError($error, Http\Request $request, Http\Response $response)
{
if (! isset($this->options['onerror'])
|| ! is_callable($this->options['onerror'])
) {
return;
}
$onError = $this->options['onerror'];
$onError($error, $request, $... | [
"private",
"function",
"triggerError",
"(",
"$",
"error",
",",
"Http",
"\\",
"Request",
"$",
"request",
",",
"Http",
"\\",
"Response",
"$",
"response",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"options",
"[",
"'onerror'",
"]",
")",
... | Trigger the error listener, if present
@param mixed $error
@param Http\Request $request
@param Http\Response $response | [
"Trigger",
"the",
"error",
"listener",
"if",
"present"
] | 29f6e8c87ce2b9a3e95bc5c2c7371f101081853d | https://github.com/phly/conduit/blob/29f6e8c87ce2b9a3e95bc5c2c7371f101081853d/src/FinalHandler.php#L149-L159 |
190,624 | taq/torm | src/Log.php | Log.log | public static function log($msg)
{
if (!self::$_enabled) {
return;
}
if (is_null(self::$_file)) {
echo "log: $msg\n";
return;
}
return self::_logToFile($msg);
} | php | public static function log($msg)
{
if (!self::$_enabled) {
return;
}
if (is_null(self::$_file)) {
echo "log: $msg\n";
return;
}
return self::_logToFile($msg);
} | [
"public",
"static",
"function",
"log",
"(",
"$",
"msg",
")",
"{",
"if",
"(",
"!",
"self",
"::",
"$",
"_enabled",
")",
"{",
"return",
";",
"}",
"if",
"(",
"is_null",
"(",
"self",
"::",
"$",
"_file",
")",
")",
"{",
"echo",
"\"log: $msg\\n\"",
";",
... | Send a message to log
@param string $msg message
@return null | [
"Send",
"a",
"message",
"to",
"log"
] | 9db401ffd313af1b54e769cae90c00d6fce8dc81 | https://github.com/taq/torm/blob/9db401ffd313af1b54e769cae90c00d6fce8dc81/src/Log.php#L75-L87 |
190,625 | taq/torm | src/Log.php | Log._logToFile | private static function _logToFile($msg)
{
if (is_null(self::$_file) || (is_string(self::$_file) && !self::_openLogFile())) {
return false;
}
return fwrite(self::$_file, "$msg\n");
} | php | private static function _logToFile($msg)
{
if (is_null(self::$_file) || (is_string(self::$_file) && !self::_openLogFile())) {
return false;
}
return fwrite(self::$_file, "$msg\n");
} | [
"private",
"static",
"function",
"_logToFile",
"(",
"$",
"msg",
")",
"{",
"if",
"(",
"is_null",
"(",
"self",
"::",
"$",
"_file",
")",
"||",
"(",
"is_string",
"(",
"self",
"::",
"$",
"_file",
")",
"&&",
"!",
"self",
"::",
"_openLogFile",
"(",
")",
"... | Write a message on file
@param string $msg message
@return true or false | [
"Write",
"a",
"message",
"on",
"file"
] | 9db401ffd313af1b54e769cae90c00d6fce8dc81 | https://github.com/taq/torm/blob/9db401ffd313af1b54e769cae90c00d6fce8dc81/src/Log.php#L96-L102 |
190,626 | taq/torm | src/Factory.php | Factory.define | public static function define($name, $attrs, $options = null)
{
self::$_factories[$name] = $attrs;
self::$_options[$name] = $options;
} | php | public static function define($name, $attrs, $options = null)
{
self::$_factories[$name] = $attrs;
self::$_options[$name] = $options;
} | [
"public",
"static",
"function",
"define",
"(",
"$",
"name",
",",
"$",
"attrs",
",",
"$",
"options",
"=",
"null",
")",
"{",
"self",
"::",
"$",
"_factories",
"[",
"$",
"name",
"]",
"=",
"$",
"attrs",
";",
"self",
"::",
"$",
"_options",
"[",
"$",
"n... | Define a factory
@param string $name factory name
@param mixed $attrs attributes
@param mixed $options options to use
@return null | [
"Define",
"a",
"factory"
] | 9db401ffd313af1b54e769cae90c00d6fce8dc81 | https://github.com/taq/torm/blob/9db401ffd313af1b54e769cae90c00d6fce8dc81/src/Factory.php#L88-L92 |
190,627 | taq/torm | src/Factory.php | Factory.get | public static function get($name)
{
self::load();
if (!array_key_exists($name, self::$_factories)) {
return null;
}
return self::$_factories[$name];
} | php | public static function get($name)
{
self::load();
if (!array_key_exists($name, self::$_factories)) {
return null;
}
return self::$_factories[$name];
} | [
"public",
"static",
"function",
"get",
"(",
"$",
"name",
")",
"{",
"self",
"::",
"load",
"(",
")",
";",
"if",
"(",
"!",
"array_key_exists",
"(",
"$",
"name",
",",
"self",
"::",
"$",
"_factories",
")",
")",
"{",
"return",
"null",
";",
"}",
"return",... | Return a factory
@param string $name factory name
@return mixed factory | [
"Return",
"a",
"factory"
] | 9db401ffd313af1b54e769cae90c00d6fce8dc81 | https://github.com/taq/torm/blob/9db401ffd313af1b54e769cae90c00d6fce8dc81/src/Factory.php#L101-L108 |
190,628 | taq/torm | src/Factory.php | Factory.attributes_for | public static function attributes_for($name)
{
self::load();
$data = self::get($name);
if (!$data) {
return null;
}
return $data;
} | php | public static function attributes_for($name)
{
self::load();
$data = self::get($name);
if (!$data) {
return null;
}
return $data;
} | [
"public",
"static",
"function",
"attributes_for",
"(",
"$",
"name",
")",
"{",
"self",
"::",
"load",
"(",
")",
";",
"$",
"data",
"=",
"self",
"::",
"get",
"(",
"$",
"name",
")",
";",
"if",
"(",
"!",
"$",
"data",
")",
"{",
"return",
"null",
";",
... | Attributes for a factory
@param string $name name of the factory
@return mixed attributes | [
"Attributes",
"for",
"a",
"factory"
] | 9db401ffd313af1b54e769cae90c00d6fce8dc81 | https://github.com/taq/torm/blob/9db401ffd313af1b54e769cae90c00d6fce8dc81/src/Factory.php#L141-L149 |
190,629 | taq/torm | src/Factory.php | Factory.build | public static function build($name, $create = false)
{
self::load();
$data = self::attributes_for($name);
if (!$data) {
return null;
}
// if is a different class ...
if (is_array(self::$_options[$name])
&& array_key_exists("class_name", self:... | php | public static function build($name, $create = false)
{
self::load();
$data = self::attributes_for($name);
if (!$data) {
return null;
}
// if is a different class ...
if (is_array(self::$_options[$name])
&& array_key_exists("class_name", self:... | [
"public",
"static",
"function",
"build",
"(",
"$",
"name",
",",
"$",
"create",
"=",
"false",
")",
"{",
"self",
"::",
"load",
"(",
")",
";",
"$",
"data",
"=",
"self",
"::",
"attributes_for",
"(",
"$",
"name",
")",
";",
"if",
"(",
"!",
"$",
"data",... | Build a factory
@param string $name factory name
@param boolean $create create factory
@return mixed factory | [
"Build",
"a",
"factory"
] | 9db401ffd313af1b54e769cae90c00d6fce8dc81 | https://github.com/taq/torm/blob/9db401ffd313af1b54e769cae90c00d6fce8dc81/src/Factory.php#L171-L202 |
190,630 | taq/torm | src/Finders.php | Finders.find | public static function find($id)
{
self::_checkLoaded();
$pk = self::isIgnoringCase() ? strtolower(self::getPK()) : self::getPK();
$builder = self::_makeBuilder();
$builder->fields = self::extractColumns();
$builder->where = self::_extractWhereCond... | php | public static function find($id)
{
self::_checkLoaded();
$pk = self::isIgnoringCase() ? strtolower(self::getPK()) : self::getPK();
$builder = self::_makeBuilder();
$builder->fields = self::extractColumns();
$builder->where = self::_extractWhereCond... | [
"public",
"static",
"function",
"find",
"(",
"$",
"id",
")",
"{",
"self",
"::",
"_checkLoaded",
"(",
")",
";",
"$",
"pk",
"=",
"self",
"::",
"isIgnoringCase",
"(",
")",
"?",
"strtolower",
"(",
"self",
"::",
"getPK",
"(",
")",
")",
":",
"self",
"::"... | Find an object by its primary key
@param object $id primary key
@return mixed result | [
"Find",
"an",
"object",
"by",
"its",
"primary",
"key"
] | 9db401ffd313af1b54e769cae90c00d6fce8dc81 | https://github.com/taq/torm/blob/9db401ffd313af1b54e769cae90c00d6fce8dc81/src/Finders.php#L24-L42 |
190,631 | taq/torm | src/Finders.php | Finders._getByPosition | private static function _getByPosition($position, $conditions=null)
{
self::_checkLoaded();
$builder = self::_makeBuilder();
$builder->fields = self::extractColumns();
$builder->order = $position=="first" ? self::getOrder() : self::getReversedOrder();
$builder->w... | php | private static function _getByPosition($position, $conditions=null)
{
self::_checkLoaded();
$builder = self::_makeBuilder();
$builder->fields = self::extractColumns();
$builder->order = $position=="first" ? self::getOrder() : self::getReversedOrder();
$builder->w... | [
"private",
"static",
"function",
"_getByPosition",
"(",
"$",
"position",
",",
"$",
"conditions",
"=",
"null",
")",
"{",
"self",
"::",
"_checkLoaded",
"(",
")",
";",
"$",
"builder",
"=",
"self",
"::",
"_makeBuilder",
"(",
")",
";",
"$",
"builder",
"->",
... | Get result by position - first or last
@param string $position "first" or "last"
@param mixed $conditions to extract
@return result or null | [
"Get",
"result",
"by",
"position",
"-",
"first",
"or",
"last"
] | 9db401ffd313af1b54e769cae90c00d6fce8dc81 | https://github.com/taq/torm/blob/9db401ffd313af1b54e769cae90c00d6fce8dc81/src/Finders.php#L92-L110 |
190,632 | geertw/php-ip-anonymizer | src/IpAnonymizer.php | IpAnonymizer.anonymize | public function anonymize($address) {
$packedAddress = inet_pton($address);
if (strlen($packedAddress) == 4) {
return $this->anonymizeIPv4($address);
} elseif (strlen($packedAddress) == 16) {
return $this->anonymizeIPv6($address);
} else {
return "";
... | php | public function anonymize($address) {
$packedAddress = inet_pton($address);
if (strlen($packedAddress) == 4) {
return $this->anonymizeIPv4($address);
} elseif (strlen($packedAddress) == 16) {
return $this->anonymizeIPv6($address);
} else {
return "";
... | [
"public",
"function",
"anonymize",
"(",
"$",
"address",
")",
"{",
"$",
"packedAddress",
"=",
"inet_pton",
"(",
"$",
"address",
")",
";",
"if",
"(",
"strlen",
"(",
"$",
"packedAddress",
")",
"==",
"4",
")",
"{",
"return",
"$",
"this",
"->",
"anonymizeIP... | Anonymize an IPv4 or IPv6 address.
@param $address string IP address that must be anonymized
@return string The anonymized IP address. Returns an empty string when the IP address is invalid. | [
"Anonymize",
"an",
"IPv4",
"or",
"IPv6",
"address",
"."
] | fa82fd9cd9be6ff57be0cea336b65879ea852ebe | https://github.com/geertw/php-ip-anonymizer/blob/fa82fd9cd9be6ff57be0cea336b65879ea852ebe/src/IpAnonymizer.php#L33-L43 |
190,633 | taq/torm | src/Errors.php | Errors._addError | private function _addError($attr, $msg)
{
if (!array_key_exists($attr, $this->errors)) {
$this->errors[$attr] = array();
}
array_push($this->errors[$attr], $msg);
} | php | private function _addError($attr, $msg)
{
if (!array_key_exists($attr, $this->errors)) {
$this->errors[$attr] = array();
}
array_push($this->errors[$attr], $msg);
} | [
"private",
"function",
"_addError",
"(",
"$",
"attr",
",",
"$",
"msg",
")",
"{",
"if",
"(",
"!",
"array_key_exists",
"(",
"$",
"attr",
",",
"$",
"this",
"->",
"errors",
")",
")",
"{",
"$",
"this",
"->",
"errors",
"[",
"$",
"attr",
"]",
"=",
"arra... | Add an error to an attribute
@param string $attr attribute
@param string $msg message
@return null | [
"Add",
"an",
"error",
"to",
"an",
"attribute"
] | 9db401ffd313af1b54e769cae90c00d6fce8dc81 | https://github.com/taq/torm/blob/9db401ffd313af1b54e769cae90c00d6fce8dc81/src/Errors.php#L38-L44 |
190,634 | taq/torm | src/Errors.php | Errors.fullMessages | public function fullMessages($errors=null)
{
if (!function_exists("yaml_parse")
|| is_null(self::$yaml_file)
|| !file_exists(self::$yaml_file)
) {
return array();
}
$rtn = array();
$parsed = yaml_parse(file_get_contents(self::$yaml_f... | php | public function fullMessages($errors=null)
{
if (!function_exists("yaml_parse")
|| is_null(self::$yaml_file)
|| !file_exists(self::$yaml_file)
) {
return array();
}
$rtn = array();
$parsed = yaml_parse(file_get_contents(self::$yaml_f... | [
"public",
"function",
"fullMessages",
"(",
"$",
"errors",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"function_exists",
"(",
"\"yaml_parse\"",
")",
"||",
"is_null",
"(",
"self",
"::",
"$",
"yaml_file",
")",
"||",
"!",
"file_exists",
"(",
"self",
"::",
"$",
... | Return textual and translated error messages
@param mixed $errors found
@return mixed error messages | [
"Return",
"textual",
"and",
"translated",
"error",
"messages"
] | 9db401ffd313af1b54e769cae90c00d6fce8dc81 | https://github.com/taq/torm/blob/9db401ffd313af1b54e769cae90c00d6fce8dc81/src/Errors.php#L81-L117 |
190,635 | taq/torm | src/Callbacks.php | Callbacks._checkCallback | private static function _checkCallback($cls, $callback, $context)
{
self::_initiateCallbacks($cls);
foreach (self::$_callbacks[$cls][$callback] as $func) {
if (!call_user_func(array($context, $func))) {
return false;
}
}
return true;
} | php | private static function _checkCallback($cls, $callback, $context)
{
self::_initiateCallbacks($cls);
foreach (self::$_callbacks[$cls][$callback] as $func) {
if (!call_user_func(array($context, $func))) {
return false;
}
}
return true;
} | [
"private",
"static",
"function",
"_checkCallback",
"(",
"$",
"cls",
",",
"$",
"callback",
",",
"$",
"context",
")",
"{",
"self",
"::",
"_initiateCallbacks",
"(",
"$",
"cls",
")",
";",
"foreach",
"(",
"self",
"::",
"$",
"_callbacks",
"[",
"$",
"cls",
"]... | Check if a callback exists
@param string $cls class
@param string $callback callback
@param mixed $context context (instance)
@return exist or not | [
"Check",
"if",
"a",
"callback",
"exists"
] | 9db401ffd313af1b54e769cae90c00d6fce8dc81 | https://github.com/taq/torm/blob/9db401ffd313af1b54e769cae90c00d6fce8dc81/src/Callbacks.php#L132-L141 |
190,636 | clickalicious/memcached-php | src/Clickalicious/Memcached/Compression/Smaz.php | Smaz.getEncodeBook | protected function getEncodeBook()
{
if (self::$encodeBook === null) {
self::$encodeBook = array_flip(self::$decodeBook);
}
return self::$encodeBook;
} | php | protected function getEncodeBook()
{
if (self::$encodeBook === null) {
self::$encodeBook = array_flip(self::$decodeBook);
}
return self::$encodeBook;
} | [
"protected",
"function",
"getEncodeBook",
"(",
")",
"{",
"if",
"(",
"self",
"::",
"$",
"encodeBook",
"===",
"null",
")",
"{",
"self",
"::",
"$",
"encodeBook",
"=",
"array_flip",
"(",
"self",
"::",
"$",
"decodeBook",
")",
";",
"}",
"return",
"self",
"::... | Returns the book used to encode.
@author Benjamin Carl <opensource@clickalicious.de>
@return array The encode book
@access protected | [
"Returns",
"the",
"book",
"used",
"to",
"encode",
"."
] | f2aace26abb04f7fc229c80915ee4f3dbe2d1261 | https://github.com/clickalicious/memcached-php/blob/f2aace26abb04f7fc229c80915ee4f3dbe2d1261/src/Clickalicious/Memcached/Compression/Smaz.php#L251-L258 |
190,637 | taq/torm | src/Model.php | Model.reload | public function reload()
{
$data = $this->find($this->id)->getData();
$this->_setData($data);
$this->_belongs_cache = array();
} | php | public function reload()
{
$data = $this->find($this->id)->getData();
$this->_setData($data);
$this->_belongs_cache = array();
} | [
"public",
"function",
"reload",
"(",
")",
"{",
"$",
"data",
"=",
"$",
"this",
"->",
"find",
"(",
"$",
"this",
"->",
"id",
")",
"->",
"getData",
"(",
")",
";",
"$",
"this",
"->",
"_setData",
"(",
"$",
"data",
")",
";",
"$",
"this",
"->",
"_belon... | Reload the current object
@return mixed object | [
"Reload",
"the",
"current",
"object"
] | 9db401ffd313af1b54e769cae90c00d6fce8dc81 | https://github.com/taq/torm/blob/9db401ffd313af1b54e769cae90c00d6fce8dc81/src/Model.php#L137-L142 |
190,638 | taq/torm | src/Model.php | Model.isIgnoringCase | public static function isIgnoringCase()
{
$cls = get_called_class();
if (!array_key_exists($cls, self::$_ignorecase)) {
return true;
}
return self::$_ignorecase[$cls];
} | php | public static function isIgnoringCase()
{
$cls = get_called_class();
if (!array_key_exists($cls, self::$_ignorecase)) {
return true;
}
return self::$_ignorecase[$cls];
} | [
"public",
"static",
"function",
"isIgnoringCase",
"(",
")",
"{",
"$",
"cls",
"=",
"get_called_class",
"(",
")",
";",
"if",
"(",
"!",
"array_key_exists",
"(",
"$",
"cls",
",",
"self",
"::",
"$",
"_ignorecase",
")",
")",
"{",
"return",
"true",
";",
"}",
... | Check if is ignoring case
@return boolean ignoring case | [
"Check",
"if",
"is",
"ignoring",
"case"
] | 9db401ffd313af1b54e769cae90c00d6fce8dc81 | https://github.com/taq/torm/blob/9db401ffd313af1b54e769cae90c00d6fce8dc81/src/Model.php#L149-L156 |
190,639 | taq/torm | src/Model.php | Model._loadNullValues | private static function _loadNullValues()
{
$values = array();
$cls = get_called_class();
if (!array_key_exists($cls, self::$_columns)) {
return null;
}
foreach (self::$_columns[$cls] as $column) {
$name = self::isIgnoringCase() ? strtolower($colu... | php | private static function _loadNullValues()
{
$values = array();
$cls = get_called_class();
if (!array_key_exists($cls, self::$_columns)) {
return null;
}
foreach (self::$_columns[$cls] as $column) {
$name = self::isIgnoringCase() ? strtolower($colu... | [
"private",
"static",
"function",
"_loadNullValues",
"(",
")",
"{",
"$",
"values",
"=",
"array",
"(",
")",
";",
"$",
"cls",
"=",
"get_called_class",
"(",
")",
";",
"if",
"(",
"!",
"array_key_exists",
"(",
"$",
"cls",
",",
"self",
"::",
"$",
"_columns",
... | Load null values on row columns. Useful to new objects.
@return null | [
"Load",
"null",
"values",
"on",
"row",
"columns",
".",
"Useful",
"to",
"new",
"objects",
"."
] | 9db401ffd313af1b54e769cae90c00d6fce8dc81 | https://github.com/taq/torm/blob/9db401ffd313af1b54e769cae90c00d6fce8dc81/src/Model.php#L163-L177 |
190,640 | taq/torm | src/Model.php | Model._extractClassName | private static function _extractClassName($cls)
{
$tokens = preg_split("/\\\\/", $cls);
$size = sizeof($tokens);
if ($size < 2) {
return $cls;
}
return $tokens[$size-1];
} | php | private static function _extractClassName($cls)
{
$tokens = preg_split("/\\\\/", $cls);
$size = sizeof($tokens);
if ($size < 2) {
return $cls;
}
return $tokens[$size-1];
} | [
"private",
"static",
"function",
"_extractClassName",
"(",
"$",
"cls",
")",
"{",
"$",
"tokens",
"=",
"preg_split",
"(",
"\"/\\\\\\\\/\"",
",",
"$",
"cls",
")",
";",
"$",
"size",
"=",
"sizeof",
"(",
"$",
"tokens",
")",
";",
"if",
"(",
"$",
"size",
"<"... | Extract namespace from class name
@param string $class class name
@return string $class class name | [
"Extract",
"namespace",
"from",
"class",
"name"
] | 9db401ffd313af1b54e769cae90c00d6fce8dc81 | https://github.com/taq/torm/blob/9db401ffd313af1b54e769cae90c00d6fce8dc81/src/Model.php#L199-L207 |
190,641 | taq/torm | src/Model.php | Model.getTableName | public static function getTableName($cls=null)
{
$fullcls = $cls ? $cls : get_called_class();
if (array_key_exists($fullcls, self::$_table_name)) {
return self::$_table_name[$fullcls];
}
$cls = self::_extractClassName($fullcls);
$name = Inflections::pluralize($... | php | public static function getTableName($cls=null)
{
$fullcls = $cls ? $cls : get_called_class();
if (array_key_exists($fullcls, self::$_table_name)) {
return self::$_table_name[$fullcls];
}
$cls = self::_extractClassName($fullcls);
$name = Inflections::pluralize($... | [
"public",
"static",
"function",
"getTableName",
"(",
"$",
"cls",
"=",
"null",
")",
"{",
"$",
"fullcls",
"=",
"$",
"cls",
"?",
"$",
"cls",
":",
"get_called_class",
"(",
")",
";",
"if",
"(",
"array_key_exists",
"(",
"$",
"fullcls",
",",
"self",
"::",
"... | Returns the table name.
If not specified one, get the current class name and pluralize it.
@param string $cls class name
@return string table name | [
"Returns",
"the",
"table",
"name",
".",
"If",
"not",
"specified",
"one",
"get",
"the",
"current",
"class",
"name",
"and",
"pluralize",
"it",
"."
] | 9db401ffd313af1b54e769cae90c00d6fce8dc81 | https://github.com/taq/torm/blob/9db401ffd313af1b54e769cae90c00d6fce8dc81/src/Model.php#L217-L232 |
190,642 | taq/torm | src/Model.php | Model.getPK | public static function getPK()
{
$cls = get_called_class();
return array_key_exists($cls, self::$_pk) ? self::$_pk[$cls] : "id";
} | php | public static function getPK()
{
$cls = get_called_class();
return array_key_exists($cls, self::$_pk) ? self::$_pk[$cls] : "id";
} | [
"public",
"static",
"function",
"getPK",
"(",
")",
"{",
"$",
"cls",
"=",
"get_called_class",
"(",
")",
";",
"return",
"array_key_exists",
"(",
"$",
"cls",
",",
"self",
"::",
"$",
"_pk",
")",
"?",
"self",
"::",
"$",
"_pk",
"[",
"$",
"cls",
"]",
":",... | Returns the primary key column.
@return string primary key | [
"Returns",
"the",
"primary",
"key",
"column",
"."
] | 9db401ffd313af1b54e769cae90c00d6fce8dc81 | https://github.com/taq/torm/blob/9db401ffd313af1b54e769cae90c00d6fce8dc81/src/Model.php#L252-L256 |
190,643 | taq/torm | src/Model.php | Model.getOrder | public static function getOrder()
{
$cls = get_called_class();
return array_key_exists($cls, self::$_order) ? self::$_order[$cls] : "";
} | php | public static function getOrder()
{
$cls = get_called_class();
return array_key_exists($cls, self::$_order) ? self::$_order[$cls] : "";
} | [
"public",
"static",
"function",
"getOrder",
"(",
")",
"{",
"$",
"cls",
"=",
"get_called_class",
"(",
")",
";",
"return",
"array_key_exists",
"(",
"$",
"cls",
",",
"self",
"::",
"$",
"_order",
")",
"?",
"self",
"::",
"$",
"_order",
"[",
"$",
"cls",
"]... | Returns the default order.
If not specified, returns an empty string.
@return string order | [
"Returns",
"the",
"default",
"order",
".",
"If",
"not",
"specified",
"returns",
"an",
"empty",
"string",
"."
] | 9db401ffd313af1b54e769cae90c00d6fce8dc81 | https://github.com/taq/torm/blob/9db401ffd313af1b54e769cae90c00d6fce8dc81/src/Model.php#L277-L281 |
190,644 | taq/torm | src/Model.php | Model.getReversedOrder | public static function getReversedOrder()
{
$sort = preg_match("/desc/i", self::getOrder());
$sort = $sort ? " ASC " : " DESC ";
return self::getOrder() ? self::getOrder()." $sort" : "";
} | php | public static function getReversedOrder()
{
$sort = preg_match("/desc/i", self::getOrder());
$sort = $sort ? " ASC " : " DESC ";
return self::getOrder() ? self::getOrder()." $sort" : "";
} | [
"public",
"static",
"function",
"getReversedOrder",
"(",
")",
"{",
"$",
"sort",
"=",
"preg_match",
"(",
"\"/desc/i\"",
",",
"self",
"::",
"getOrder",
"(",
")",
")",
";",
"$",
"sort",
"=",
"$",
"sort",
"?",
"\" ASC \"",
":",
"\" DESC \"",
";",
"return",
... | Returns the inverse order.
If DESC is specified, returns ASC.
@return string order | [
"Returns",
"the",
"inverse",
"order",
".",
"If",
"DESC",
"is",
"specified",
"returns",
"ASC",
"."
] | 9db401ffd313af1b54e769cae90c00d6fce8dc81 | https://github.com/taq/torm/blob/9db401ffd313af1b54e769cae90c00d6fce8dc81/src/Model.php#L289-L294 |
190,645 | taq/torm | src/Model.php | Model.setConnection | public static function setConnection($con, $env="development")
{
$cls = get_called_class();
if (!array_key_exists($cls, self::$_connections)) {
self::$_connections[$cls] = array();
}
self::$_connections[$cls][$env] = $con;
} | php | public static function setConnection($con, $env="development")
{
$cls = get_called_class();
if (!array_key_exists($cls, self::$_connections)) {
self::$_connections[$cls] = array();
}
self::$_connections[$cls][$env] = $con;
} | [
"public",
"static",
"function",
"setConnection",
"(",
"$",
"con",
",",
"$",
"env",
"=",
"\"development\"",
")",
"{",
"$",
"cls",
"=",
"get_called_class",
"(",
")",
";",
"if",
"(",
"!",
"array_key_exists",
"(",
"$",
"cls",
",",
"self",
"::",
"$",
"_conn... | Sets a specific connection for the current model
@param mixed $con PDO connection
@param string $env enviroment
@return null | [
"Sets",
"a",
"specific",
"connection",
"for",
"the",
"current",
"model"
] | 9db401ffd313af1b54e769cae90c00d6fce8dc81 | https://github.com/taq/torm/blob/9db401ffd313af1b54e769cae90c00d6fce8dc81/src/Model.php#L304-L311 |
190,646 | taq/torm | src/Model.php | Model.resolveConnection | public static function resolveConnection()
{
$cls = get_called_class();
$env = Connection::selectEnvironment();
if (array_key_exists($cls, self::$_connections)
&& array_key_exists($env, self::$_connections[$cls])
) {
return self::$_connections[$cls][$en... | php | public static function resolveConnection()
{
$cls = get_called_class();
$env = Connection::selectEnvironment();
if (array_key_exists($cls, self::$_connections)
&& array_key_exists($env, self::$_connections[$cls])
) {
return self::$_connections[$cls][$en... | [
"public",
"static",
"function",
"resolveConnection",
"(",
")",
"{",
"$",
"cls",
"=",
"get_called_class",
"(",
")",
";",
"$",
"env",
"=",
"Connection",
"::",
"selectEnvironment",
"(",
")",
";",
"if",
"(",
"array_key_exists",
"(",
"$",
"cls",
",",
"self",
... | Resolve the current connection handle.
Get it from PDO or from the current class.
@return object connection | [
"Resolve",
"the",
"current",
"connection",
"handle",
".",
"Get",
"it",
"from",
"PDO",
"or",
"from",
"the",
"current",
"class",
"."
] | 9db401ffd313af1b54e769cae90c00d6fce8dc81 | https://github.com/taq/torm/blob/9db401ffd313af1b54e769cae90c00d6fce8dc81/src/Model.php#L319-L330 |
190,647 | taq/torm | src/Model.php | Model._loadColumns | private static function _loadColumns()
{
if (!self::resolveConnection()) {
return;
}
$cls = get_called_class();
self::$_columns[$cls] = array();
$escape = Driver::$escape_char;
// try to create the TORM info table
$type = Driver::$numeric_column... | php | private static function _loadColumns()
{
if (!self::resolveConnection()) {
return;
}
$cls = get_called_class();
self::$_columns[$cls] = array();
$escape = Driver::$escape_char;
// try to create the TORM info table
$type = Driver::$numeric_column... | [
"private",
"static",
"function",
"_loadColumns",
"(",
")",
"{",
"if",
"(",
"!",
"self",
"::",
"resolveConnection",
"(",
")",
")",
"{",
"return",
";",
"}",
"$",
"cls",
"=",
"get_called_class",
"(",
")",
";",
"self",
"::",
"$",
"_columns",
"[",
"$",
"c... | Load column info
@return null | [
"Load",
"column",
"info"
] | 9db401ffd313af1b54e769cae90c00d6fce8dc81 | https://github.com/taq/torm/blob/9db401ffd313af1b54e769cae90c00d6fce8dc81/src/Model.php#L337-L389 |
190,648 | taq/torm | src/Model.php | Model.extractColumns | public static function extractColumns()
{
self::_checkLoaded();
$cls = get_called_class();
$temp_columns = "";
$escape = Driver::$escape_char;
foreach (self::$_columns[$cls] as $column) {
$temp_columns .= "$escape".self::getTableName()."$escape.$escape".self::$_m... | php | public static function extractColumns()
{
self::_checkLoaded();
$cls = get_called_class();
$temp_columns = "";
$escape = Driver::$escape_char;
foreach (self::$_columns[$cls] as $column) {
$temp_columns .= "$escape".self::getTableName()."$escape.$escape".self::$_m... | [
"public",
"static",
"function",
"extractColumns",
"(",
")",
"{",
"self",
"::",
"_checkLoaded",
"(",
")",
";",
"$",
"cls",
"=",
"get_called_class",
"(",
")",
";",
"$",
"temp_columns",
"=",
"\"\"",
";",
"$",
"escape",
"=",
"Driver",
"::",
"$",
"escape_char... | Extract table columns string
@return string columns | [
"Extract",
"table",
"columns",
"string"
] | 9db401ffd313af1b54e769cae90c00d6fce8dc81 | https://github.com/taq/torm/blob/9db401ffd313af1b54e769cae90c00d6fce8dc81/src/Model.php#L396-L406 |
190,649 | taq/torm | src/Model.php | Model.extractUpdateColumns | public static function extractUpdateColumns($values)
{
$cls = get_called_class();
$temp_columns = "";
$escape = Driver::$escape_char;
foreach ($values as $key => $value) {
$temp_columns .= "$escape".self::$_mapping[$cls][$key]."$escape=?,";
}
return substr... | php | public static function extractUpdateColumns($values)
{
$cls = get_called_class();
$temp_columns = "";
$escape = Driver::$escape_char;
foreach ($values as $key => $value) {
$temp_columns .= "$escape".self::$_mapping[$cls][$key]."$escape=?,";
}
return substr... | [
"public",
"static",
"function",
"extractUpdateColumns",
"(",
"$",
"values",
")",
"{",
"$",
"cls",
"=",
"get_called_class",
"(",
")",
";",
"$",
"temp_columns",
"=",
"\"\"",
";",
"$",
"escape",
"=",
"Driver",
"::",
"$",
"escape_char",
";",
"foreach",
"(",
... | Extract update columns string
@param mixed $values to set columns
@return string columns | [
"Extract",
"update",
"columns",
"string"
] | 9db401ffd313af1b54e769cae90c00d6fce8dc81 | https://github.com/taq/torm/blob/9db401ffd313af1b54e769cae90c00d6fce8dc81/src/Model.php#L415-L424 |
190,650 | taq/torm | src/Model.php | Model._extractWhereConditions | private static function _extractWhereConditions($conditions)
{
if (!$conditions) {
return "";
}
$cls = get_called_class();
$escape = Driver::$escape_char;
if (is_array($conditions)) {
// check if is a regular array or an associative one
... | php | private static function _extractWhereConditions($conditions)
{
if (!$conditions) {
return "";
}
$cls = get_called_class();
$escape = Driver::$escape_char;
if (is_array($conditions)) {
// check if is a regular array or an associative one
... | [
"private",
"static",
"function",
"_extractWhereConditions",
"(",
"$",
"conditions",
")",
"{",
"if",
"(",
"!",
"$",
"conditions",
")",
"{",
"return",
"\"\"",
";",
"}",
"$",
"cls",
"=",
"get_called_class",
"(",
")",
";",
"$",
"escape",
"=",
"Driver",
"::",... | Extract where conditions string
@param mixed $conditions to extract
@return string where conditions | [
"Extract",
"where",
"conditions",
"string"
] | 9db401ffd313af1b54e769cae90c00d6fce8dc81 | https://github.com/taq/torm/blob/9db401ffd313af1b54e769cae90c00d6fce8dc81/src/Model.php#L447-L465 |
190,651 | taq/torm | src/Model.php | Model._extractWhereAssociativeConditions | private static function _extractWhereAssociativeConditions($conditions, $cls, $escape)
{
$temp_cond = "";
foreach ($conditions as $key => $value) {
$temp_cond .= "$escape".self::getTableName()."$escape.$escape".self::$_mapping[$cls][$key]."$escape=? and ";
}
return substr... | php | private static function _extractWhereAssociativeConditions($conditions, $cls, $escape)
{
$temp_cond = "";
foreach ($conditions as $key => $value) {
$temp_cond .= "$escape".self::getTableName()."$escape.$escape".self::$_mapping[$cls][$key]."$escape=? and ";
}
return substr... | [
"private",
"static",
"function",
"_extractWhereAssociativeConditions",
"(",
"$",
"conditions",
",",
"$",
"cls",
",",
"$",
"escape",
")",
"{",
"$",
"temp_cond",
"=",
"\"\"",
";",
"foreach",
"(",
"$",
"conditions",
"as",
"$",
"key",
"=>",
"$",
"value",
")",
... | Extract where conditions string, from an associative array
@param mixed $conditions to extract
@param string $cls class
@param string $escape escape char
@return string where conditions | [
"Extract",
"where",
"conditions",
"string",
"from",
"an",
"associative",
"array"
] | 9db401ffd313af1b54e769cae90c00d6fce8dc81 | https://github.com/taq/torm/blob/9db401ffd313af1b54e769cae90c00d6fce8dc81/src/Model.php#L476-L483 |
190,652 | taq/torm | src/Model.php | Model.extractWhereValues | public static function extractWhereValues($conditions)
{
$values = array();
if (!$conditions) {
return $values;
}
if (is_array($conditions)) {
if (array_values($conditions) !== $conditions) {
$values = self::_extractWhereAssociativeValues($co... | php | public static function extractWhereValues($conditions)
{
$values = array();
if (!$conditions) {
return $values;
}
if (is_array($conditions)) {
if (array_values($conditions) !== $conditions) {
$values = self::_extractWhereAssociativeValues($co... | [
"public",
"static",
"function",
"extractWhereValues",
"(",
"$",
"conditions",
")",
"{",
"$",
"values",
"=",
"array",
"(",
")",
";",
"if",
"(",
"!",
"$",
"conditions",
")",
"{",
"return",
"$",
"values",
";",
"}",
"if",
"(",
"is_array",
"(",
"$",
"cond... | Extract where values from conditions
@param mixed $conditions to extract values
@return mixed $values | [
"Extract",
"where",
"values",
"from",
"conditions"
] | 9db401ffd313af1b54e769cae90c00d6fce8dc81 | https://github.com/taq/torm/blob/9db401ffd313af1b54e769cae90c00d6fce8dc81/src/Model.php#L507-L522 |
190,653 | taq/torm | src/Model.php | Model._extractWhereAssociativeValues | private static function _extractWhereAssociativeValues($conditions)
{
$values = array();
foreach ($conditions as $key => $value) {
array_push($values, $value);
}
return $values;
} | php | private static function _extractWhereAssociativeValues($conditions)
{
$values = array();
foreach ($conditions as $key => $value) {
array_push($values, $value);
}
return $values;
} | [
"private",
"static",
"function",
"_extractWhereAssociativeValues",
"(",
"$",
"conditions",
")",
"{",
"$",
"values",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"conditions",
"as",
"$",
"key",
"=>",
"$",
"value",
")",
"{",
"array_push",
"(",
"$",
"v... | Extract values from an associative array
@param mixed $conditions conditions
@return mixed values | [
"Extract",
"values",
"from",
"an",
"associative",
"array"
] | 9db401ffd313af1b54e769cae90c00d6fce8dc81 | https://github.com/taq/torm/blob/9db401ffd313af1b54e769cae90c00d6fce8dc81/src/Model.php#L531-L538 |
190,654 | taq/torm | src/Model.php | Model._makeBuilder | private static function _makeBuilder()
{
$builder = new Builder();
$builder->table = self::getTableName();
$builder->order = self::getOrder();
$builder->cls = get_called_class();
return $builder;
} | php | private static function _makeBuilder()
{
$builder = new Builder();
$builder->table = self::getTableName();
$builder->order = self::getOrder();
$builder->cls = get_called_class();
return $builder;
} | [
"private",
"static",
"function",
"_makeBuilder",
"(",
")",
"{",
"$",
"builder",
"=",
"new",
"Builder",
"(",
")",
";",
"$",
"builder",
"->",
"table",
"=",
"self",
"::",
"getTableName",
"(",
")",
";",
"$",
"builder",
"->",
"order",
"=",
"self",
"::",
"... | Create a query builder
@return mixed $builder | [
"Create",
"a",
"query",
"builder"
] | 9db401ffd313af1b54e769cae90c00d6fce8dc81 | https://github.com/taq/torm/blob/9db401ffd313af1b54e769cae90c00d6fce8dc81/src/Model.php#L557-L564 |
190,655 | taq/torm | src/Model.php | Model._checkLoaded | private static function _checkLoaded()
{
$cls = get_called_class();
if (!array_key_exists($cls, self::$_loaded)) {
self::$_loaded[$cls] = false;
}
if (!self::$_loaded[$cls]) {
self::_loadColumns();
}
} | php | private static function _checkLoaded()
{
$cls = get_called_class();
if (!array_key_exists($cls, self::$_loaded)) {
self::$_loaded[$cls] = false;
}
if (!self::$_loaded[$cls]) {
self::_loadColumns();
}
} | [
"private",
"static",
"function",
"_checkLoaded",
"(",
")",
"{",
"$",
"cls",
"=",
"get_called_class",
"(",
")",
";",
"if",
"(",
"!",
"array_key_exists",
"(",
"$",
"cls",
",",
"self",
"::",
"$",
"_loaded",
")",
")",
"{",
"self",
"::",
"$",
"_loaded",
"... | Check if the object columns were loaded
@return boolean loaded or not | [
"Check",
"if",
"the",
"object",
"columns",
"were",
"loaded"
] | 9db401ffd313af1b54e769cae90c00d6fce8dc81 | https://github.com/taq/torm/blob/9db401ffd313af1b54e769cae90c00d6fce8dc81/src/Model.php#L581-L590 |
190,656 | taq/torm | src/Model.php | Model.executePrepared | public static function executePrepared($obj, $values=array())
{
if (!self::$_loaded) {
self::_loadColumns();
}
// convert a builder to string
if (!is_string($obj) && get_class($obj) == "TORM\Builder") {
$sql = $obj->toString();
}
if (is_strin... | php | public static function executePrepared($obj, $values=array())
{
if (!self::$_loaded) {
self::_loadColumns();
}
// convert a builder to string
if (!is_string($obj) && get_class($obj) == "TORM\Builder") {
$sql = $obj->toString();
}
if (is_strin... | [
"public",
"static",
"function",
"executePrepared",
"(",
"$",
"obj",
",",
"$",
"values",
"=",
"array",
"(",
")",
")",
"{",
"if",
"(",
"!",
"self",
"::",
"$",
"_loaded",
")",
"{",
"self",
"::",
"_loadColumns",
"(",
")",
";",
"}",
"// convert a builder to... | Execute a prepared statement, trying to get it from cache.
@param mixed $obj object
@param mixed $values to use
@return object statement | [
"Execute",
"a",
"prepared",
"statement",
"trying",
"to",
"get",
"it",
"from",
"cache",
"."
] | 9db401ffd313af1b54e769cae90c00d6fce8dc81 | https://github.com/taq/torm/blob/9db401ffd313af1b54e769cae90c00d6fce8dc81/src/Model.php#L624-L653 |
190,657 | taq/torm | src/Model.php | Model.get | public function get($attr,$current=true)
{
if (!$this->_data || !array_key_exists($attr, $this->_data)) {
return null;
}
return Connection::convertToEncoding($current ? $this->_data[$attr] : $this->_prev_data[$attr]);
} | php | public function get($attr,$current=true)
{
if (!$this->_data || !array_key_exists($attr, $this->_data)) {
return null;
}
return Connection::convertToEncoding($current ? $this->_data[$attr] : $this->_prev_data[$attr]);
} | [
"public",
"function",
"get",
"(",
"$",
"attr",
",",
"$",
"current",
"=",
"true",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"_data",
"||",
"!",
"array_key_exists",
"(",
"$",
"attr",
",",
"$",
"this",
"->",
"_data",
")",
")",
"{",
"return",
"nul... | Get an attribute value
@param string $attr attribute
@param boolean $current current value
@return mixed attribute value | [
"Get",
"an",
"attribute",
"value"
] | 9db401ffd313af1b54e769cae90c00d6fce8dc81 | https://github.com/taq/torm/blob/9db401ffd313af1b54e769cae90c00d6fce8dc81/src/Model.php#L676-L682 |
190,658 | taq/torm | src/Model.php | Model.set | public function set($attr, $value)
{
$pk = self::getPK();
// can't change the primary key of an existing record
if (!$this->_new_rec && $attr == $pk) {
return;
}
$this->_data[$attr] = $value;
} | php | public function set($attr, $value)
{
$pk = self::getPK();
// can't change the primary key of an existing record
if (!$this->_new_rec && $attr == $pk) {
return;
}
$this->_data[$attr] = $value;
} | [
"public",
"function",
"set",
"(",
"$",
"attr",
",",
"$",
"value",
")",
"{",
"$",
"pk",
"=",
"self",
"::",
"getPK",
"(",
")",
";",
"// can't change the primary key of an existing record",
"if",
"(",
"!",
"$",
"this",
"->",
"_new_rec",
"&&",
"$",
"attr",
"... | Set an attribute value
@param string $attr attribute
@param mixed $value value
@return null | [
"Set",
"an",
"attribute",
"value"
] | 9db401ffd313af1b54e769cae90c00d6fce8dc81 | https://github.com/taq/torm/blob/9db401ffd313af1b54e769cae90c00d6fce8dc81/src/Model.php#L692-L700 |
190,659 | taq/torm | src/Model.php | Model._resolveRelations | private function _resolveRelations($attr)
{
$many = self::_checkAndReturnMany($attr, $this->_data[self::getPK()]);
if ($many) {
return $many;
}
$belongs = $this->_checkAndReturnBelongs($attr, $this->_data);
if ($belongs) {
return $belongs;
}
... | php | private function _resolveRelations($attr)
{
$many = self::_checkAndReturnMany($attr, $this->_data[self::getPK()]);
if ($many) {
return $many;
}
$belongs = $this->_checkAndReturnBelongs($attr, $this->_data);
if ($belongs) {
return $belongs;
}
... | [
"private",
"function",
"_resolveRelations",
"(",
"$",
"attr",
")",
"{",
"$",
"many",
"=",
"self",
"::",
"_checkAndReturnMany",
"(",
"$",
"attr",
",",
"$",
"this",
"->",
"_data",
"[",
"self",
"::",
"getPK",
"(",
")",
"]",
")",
";",
"if",
"(",
"$",
"... | Resolve relations on an attribute, if present
@param string $attr attribute
@return null | [
"Resolve",
"relations",
"on",
"an",
"attribute",
"if",
"present"
] | 9db401ffd313af1b54e769cae90c00d6fce8dc81 | https://github.com/taq/torm/blob/9db401ffd313af1b54e769cae90c00d6fce8dc81/src/Model.php#L709-L726 |
190,660 | taq/torm | src/HasOne.php | HasOne.hasOne | public static function hasOne($attr, $options=null)
{
$cls = get_called_class();
if (!array_key_exists($cls, self::$_has_one)) {
self::$_has_one[$cls] = array();
}
self::$_has_one[$cls][$attr] = $options ? $options : false;
} | php | public static function hasOne($attr, $options=null)
{
$cls = get_called_class();
if (!array_key_exists($cls, self::$_has_one)) {
self::$_has_one[$cls] = array();
}
self::$_has_one[$cls][$attr] = $options ? $options : false;
} | [
"public",
"static",
"function",
"hasOne",
"(",
"$",
"attr",
",",
"$",
"options",
"=",
"null",
")",
"{",
"$",
"cls",
"=",
"get_called_class",
"(",
")",
";",
"if",
"(",
"!",
"array_key_exists",
"(",
"$",
"cls",
",",
"self",
"::",
"$",
"_has_one",
")",
... | Create a has one association
@param string $attr attribute
@param mixed $options options to use
@return null | [
"Create",
"a",
"has",
"one",
"association"
] | 9db401ffd313af1b54e769cae90c00d6fce8dc81 | https://github.com/taq/torm/blob/9db401ffd313af1b54e769cae90c00d6fce8dc81/src/HasOne.php#L28-L35 |
190,661 | taq/torm | src/HasOne.php | HasOne._resolveHasOne | private function _resolveHasOne($attr, $value)
{
$cls = get_called_class();
if (!array_key_exists($cls, self::$_has_one)
|| !array_key_exists($attr, self::$_has_one[$cls])
) {
return null;
}
if (array_key_exists($attr, $this->_has_one_cache) && $this-... | php | private function _resolveHasOne($attr, $value)
{
$cls = get_called_class();
if (!array_key_exists($cls, self::$_has_one)
|| !array_key_exists($attr, self::$_has_one[$cls])
) {
return null;
}
if (array_key_exists($attr, $this->_has_one_cache) && $this-... | [
"private",
"function",
"_resolveHasOne",
"(",
"$",
"attr",
",",
"$",
"value",
")",
"{",
"$",
"cls",
"=",
"get_called_class",
"(",
")",
";",
"if",
"(",
"!",
"array_key_exists",
"(",
"$",
"cls",
",",
"self",
"::",
"$",
"_has_one",
")",
"||",
"!",
"arra... | Resolve the has one association and returns the object
@param string $attr name
@param mixed $value to use
@return collection | [
"Resolve",
"the",
"has",
"one",
"association",
"and",
"returns",
"the",
"object"
] | 9db401ffd313af1b54e769cae90c00d6fce8dc81 | https://github.com/taq/torm/blob/9db401ffd313af1b54e769cae90c00d6fce8dc81/src/HasOne.php#L45-L67 |
190,662 | taq/torm | src/HasOne.php | HasOne._checkAndReturnHasOne | private function _checkAndReturnHasOne($method, $value)
{
$cls = get_called_class();
if (array_key_exists($cls, self::$_has_one)
&& array_key_exists($method, self::$_has_one[$cls])
) {
return $this->_resolveHasOne($method, $value);
}
} | php | private function _checkAndReturnHasOne($method, $value)
{
$cls = get_called_class();
if (array_key_exists($cls, self::$_has_one)
&& array_key_exists($method, self::$_has_one[$cls])
) {
return $this->_resolveHasOne($method, $value);
}
} | [
"private",
"function",
"_checkAndReturnHasOne",
"(",
"$",
"method",
",",
"$",
"value",
")",
"{",
"$",
"cls",
"=",
"get_called_class",
"(",
")",
";",
"if",
"(",
"array_key_exists",
"(",
"$",
"cls",
",",
"self",
"::",
"$",
"_has_one",
")",
"&&",
"array_key... | Check and return the value of a has one association
@param string $method searched
@param mixed $value the current id
@return association | [
"Check",
"and",
"return",
"the",
"value",
"of",
"a",
"has",
"one",
"association"
] | 9db401ffd313af1b54e769cae90c00d6fce8dc81 | https://github.com/taq/torm/blob/9db401ffd313af1b54e769cae90c00d6fce8dc81/src/HasOne.php#L77-L85 |
190,663 | taq/torm | src/Dirty.php | Dirty._changedAttribute | private function _changedAttribute($attr)
{
preg_match('/(\w+)_(change|changed|was)$/', $attr, $matches);
if (sizeof($matches) < 1) {
return null;
}
$attr = $matches[1];
$meth = $matches[2];
$cur = $this->get($attr);
$old = $this->get($attr, fa... | php | private function _changedAttribute($attr)
{
preg_match('/(\w+)_(change|changed|was)$/', $attr, $matches);
if (sizeof($matches) < 1) {
return null;
}
$attr = $matches[1];
$meth = $matches[2];
$cur = $this->get($attr);
$old = $this->get($attr, fa... | [
"private",
"function",
"_changedAttribute",
"(",
"$",
"attr",
")",
"{",
"preg_match",
"(",
"'/(\\w+)_(change|changed|was)$/'",
",",
"$",
"attr",
",",
"$",
"matches",
")",
";",
"if",
"(",
"sizeof",
"(",
"$",
"matches",
")",
"<",
"1",
")",
"{",
"return",
"... | Check if an attribute changed its value since object was loaded
@param string $attr attribute
@return changed or not | [
"Check",
"if",
"an",
"attribute",
"changed",
"its",
"value",
"since",
"object",
"was",
"loaded"
] | 9db401ffd313af1b54e769cae90c00d6fce8dc81 | https://github.com/taq/torm/blob/9db401ffd313af1b54e769cae90c00d6fce8dc81/src/Dirty.php#L24-L46 |
190,664 | taq/torm | src/Dirty.php | Dirty.changed | public function changed($attrs=false)
{
$changes = array();
$cls = get_called_class();
foreach (self::$_columns[$cls] as $column) {
// if is the primary key or one of the automatic columns, skip
if ($cls::getPK() == $column || in_array(strtolower($column), array... | php | public function changed($attrs=false)
{
$changes = array();
$cls = get_called_class();
foreach (self::$_columns[$cls] as $column) {
// if is the primary key or one of the automatic columns, skip
if ($cls::getPK() == $column || in_array(strtolower($column), array... | [
"public",
"function",
"changed",
"(",
"$",
"attrs",
"=",
"false",
")",
"{",
"$",
"changes",
"=",
"array",
"(",
")",
";",
"$",
"cls",
"=",
"get_called_class",
"(",
")",
";",
"foreach",
"(",
"self",
"::",
"$",
"_columns",
"[",
"$",
"cls",
"]",
"as",
... | Return what changed
@param boolean $attrs if true, return old and current values
@return changes | [
"Return",
"what",
"changed"
] | 9db401ffd313af1b54e769cae90c00d6fce8dc81 | https://github.com/taq/torm/blob/9db401ffd313af1b54e769cae90c00d6fce8dc81/src/Dirty.php#L65-L96 |
190,665 | Kylob/Blog | src/Component.php | Component.page | public function page()
{
$page = Page::html();
$listings = $this->config('blog', 'listings');
if ($page->url['format'] != 'html') {
$file = (preg_match('/\.(txt|json|xml|rdf|rss|atom)$/', $page->url['path'])) ? $this->folder.'content/'.$page->url['path'].'.twig' : null;
... | php | public function page()
{
$page = Page::html();
$listings = $this->config('blog', 'listings');
if ($page->url['format'] != 'html') {
$file = (preg_match('/\.(txt|json|xml|rdf|rss|atom)$/', $page->url['path'])) ? $this->folder.'content/'.$page->url['path'].'.twig' : null;
... | [
"public",
"function",
"page",
"(",
")",
"{",
"$",
"page",
"=",
"Page",
"::",
"html",
"(",
")",
";",
"$",
"listings",
"=",
"$",
"this",
"->",
"config",
"(",
"'blog'",
",",
"'listings'",
")",
";",
"if",
"(",
"$",
"page",
"->",
"url",
"[",
"'format'... | Determine if there is any Blog content associated with the current url path.
@return mixed Either ``false`` if there is not a corresponding ``$page->url['path']`` Twig template, a string if ``$page->url['format'] != 'html'``, or an array suitable for passing to ``$blog->theme->renderTwig($file)`` with the following ke... | [
"Determine",
"if",
"there",
"is",
"any",
"Blog",
"content",
"associated",
"with",
"the",
"current",
"url",
"path",
"."
] | 5783def10888860ad4c4f77cda5ce6a48fee4144 | https://github.com/Kylob/Blog/blob/5783def10888860ad4c4f77cda5ce6a48fee4144/src/Component.php#L32-L64 |
190,666 | coopTilleuls/amazon-mws-orders | src/MarketplaceWebServiceOrders/Client.php | MarketplaceWebServiceOrders_Client.getOrder | public function getOrder($request)
{
if (!($request instanceof MarketplaceWebServiceOrders_Model_GetOrderRequest)) {
require_once (dirname(__FILE__) . '/Model/GetOrderRequest.php');
$request = new MarketplaceWebServiceOrders_Model_GetOrderRequest($request);
}
$paramet... | php | public function getOrder($request)
{
if (!($request instanceof MarketplaceWebServiceOrders_Model_GetOrderRequest)) {
require_once (dirname(__FILE__) . '/Model/GetOrderRequest.php');
$request = new MarketplaceWebServiceOrders_Model_GetOrderRequest($request);
}
$paramet... | [
"public",
"function",
"getOrder",
"(",
"$",
"request",
")",
"{",
"if",
"(",
"!",
"(",
"$",
"request",
"instanceof",
"MarketplaceWebServiceOrders_Model_GetOrderRequest",
")",
")",
"{",
"require_once",
"(",
"dirname",
"(",
"__FILE__",
")",
".",
"'/Model/GetOrderRequ... | Get Order
This operation takes up to 50 order ids and returns the corresponding orders.
@param mixed $request array of parameters for MarketplaceWebServiceOrders_Model_GetOrder request or MarketplaceWebServiceOrders_Model_GetOrder object itself
@see MarketplaceWebServiceOrders_Model_GetOrderRequest
@return Marketplace... | [
"Get",
"Order",
"This",
"operation",
"takes",
"up",
"to",
"50",
"order",
"ids",
"and",
"returns",
"the",
"corresponding",
"orders",
"."
] | 9554998cb67189768f26da9229fcdc580943444d | https://github.com/coopTilleuls/amazon-mws-orders/blob/9554998cb67189768f26da9229fcdc580943444d/src/MarketplaceWebServiceOrders/Client.php#L65-L79 |
190,667 | coopTilleuls/amazon-mws-orders | src/MarketplaceWebServiceOrders/Client.php | MarketplaceWebServiceOrders_Client._convertGetOrder | private function _convertGetOrder($request) {
$parameters = array();
$parameters['Action'] = 'GetOrder';
if ($request->isSetSellerId()) {
$parameters['SellerId'] = $request->getSellerId();
}
if ($request->isSetMWSAuthToken()) {
$parameters['MWSAuthToken'... | php | private function _convertGetOrder($request) {
$parameters = array();
$parameters['Action'] = 'GetOrder';
if ($request->isSetSellerId()) {
$parameters['SellerId'] = $request->getSellerId();
}
if ($request->isSetMWSAuthToken()) {
$parameters['MWSAuthToken'... | [
"private",
"function",
"_convertGetOrder",
"(",
"$",
"request",
")",
"{",
"$",
"parameters",
"=",
"array",
"(",
")",
";",
"$",
"parameters",
"[",
"'Action'",
"]",
"=",
"'GetOrder'",
";",
"if",
"(",
"$",
"request",
"->",
"isSetSellerId",
"(",
")",
")",
... | Convert GetOrderRequest to name value pairs | [
"Convert",
"GetOrderRequest",
"to",
"name",
"value",
"pairs"
] | 9554998cb67189768f26da9229fcdc580943444d | https://github.com/coopTilleuls/amazon-mws-orders/blob/9554998cb67189768f26da9229fcdc580943444d/src/MarketplaceWebServiceOrders/Client.php#L85-L100 |
190,668 | coopTilleuls/amazon-mws-orders | src/MarketplaceWebServiceOrders/Client.php | MarketplaceWebServiceOrders_Client._convertListOrders | private function _convertListOrders($request) {
$parameters = array();
$parameters['Action'] = 'ListOrders';
if ($request->isSetSellerId()) {
$parameters['SellerId'] = $request->getSellerId();
}
if ($request->isSetMWSAuthToken()) {
$parameters['MWSAuthTo... | php | private function _convertListOrders($request) {
$parameters = array();
$parameters['Action'] = 'ListOrders';
if ($request->isSetSellerId()) {
$parameters['SellerId'] = $request->getSellerId();
}
if ($request->isSetMWSAuthToken()) {
$parameters['MWSAuthTo... | [
"private",
"function",
"_convertListOrders",
"(",
"$",
"request",
")",
"{",
"$",
"parameters",
"=",
"array",
"(",
")",
";",
"$",
"parameters",
"[",
"'Action'",
"]",
"=",
"'ListOrders'",
";",
"if",
"(",
"$",
"request",
"->",
"isSetSellerId",
"(",
")",
")"... | Convert ListOrdersRequest to name value pairs | [
"Convert",
"ListOrdersRequest",
"to",
"name",
"value",
"pairs"
] | 9554998cb67189768f26da9229fcdc580943444d | https://github.com/coopTilleuls/amazon-mws-orders/blob/9554998cb67189768f26da9229fcdc580943444d/src/MarketplaceWebServiceOrders/Client.php#L278-L326 |
190,669 | coopTilleuls/amazon-mws-orders | src/MarketplaceWebServiceOrders/Client.php | MarketplaceWebServiceOrders_Client._extractHttpStatusCode | private function _extractHttpStatusCode($headers){
$statusCode = null;
if (1 === preg_match("/(\\S+) +(\\d+) +([^\n\r]+)(?:\r?\n|\r)/", $headers, $matches)) {
//The matches array [entireMatchString, protocol, statusCode, the rest]
$statusCode = $matches[2];
}
return $... | php | private function _extractHttpStatusCode($headers){
$statusCode = null;
if (1 === preg_match("/(\\S+) +(\\d+) +([^\n\r]+)(?:\r?\n|\r)/", $headers, $matches)) {
//The matches array [entireMatchString, protocol, statusCode, the rest]
$statusCode = $matches[2];
}
return $... | [
"private",
"function",
"_extractHttpStatusCode",
"(",
"$",
"headers",
")",
"{",
"$",
"statusCode",
"=",
"null",
";",
"if",
"(",
"1",
"===",
"preg_match",
"(",
"\"/(\\\\S+) +(\\\\d+) +([^\\n\\r]+)(?:\\r?\\n|\\r)/\"",
",",
"$",
"headers",
",",
"$",
"matches",
")",
... | parse the status line of a header string for the proper format and
return the status code
Example: HTTP/1.1 200 OK
...
returns String statusCode or null if the status line can't be parsed | [
"parse",
"the",
"status",
"line",
"of",
"a",
"header",
"string",
"for",
"the",
"proper",
"format",
"and",
"return",
"the",
"status",
"code"
] | 9554998cb67189768f26da9229fcdc580943444d | https://github.com/coopTilleuls/amazon-mws-orders/blob/9554998cb67189768f26da9229fcdc580943444d/src/MarketplaceWebServiceOrders/Client.php#L725-L732 |
190,670 | coopTilleuls/amazon-mws-orders | src/MarketplaceWebServiceOrders/Client.php | MarketplaceWebServiceOrders_Client._extractResponseHeaderMetadata | private function _extractResponseHeaderMetadata($rawHeaders){
$inputHeaders = preg_split("/\r\n|\n|\r/", $rawHeaders);
$headers = array();
$headers['x-mws-request-id'] = null;
$headers['x-mws-response-context'] = null;
$headers['x-mws-timestamp'] = null;
$headers['x-mws-q... | php | private function _extractResponseHeaderMetadata($rawHeaders){
$inputHeaders = preg_split("/\r\n|\n|\r/", $rawHeaders);
$headers = array();
$headers['x-mws-request-id'] = null;
$headers['x-mws-response-context'] = null;
$headers['x-mws-timestamp'] = null;
$headers['x-mws-q... | [
"private",
"function",
"_extractResponseHeaderMetadata",
"(",
"$",
"rawHeaders",
")",
"{",
"$",
"inputHeaders",
"=",
"preg_split",
"(",
"\"/\\r\\n|\\n|\\r/\"",
",",
"$",
"rawHeaders",
")",
";",
"$",
"headers",
"=",
"array",
"(",
")",
";",
"$",
"headers",
"[",
... | extract a ResponseHeaderMetadata object from the raw headers | [
"extract",
"a",
"ResponseHeaderMetadata",
"object",
"from",
"the",
"raw",
"headers"
] | 9554998cb67189768f26da9229fcdc580943444d | https://github.com/coopTilleuls/amazon-mws-orders/blob/9554998cb67189768f26da9229fcdc580943444d/src/MarketplaceWebServiceOrders/Client.php#L747-L777 |
190,671 | coopTilleuls/amazon-mws-orders | src/MarketplaceWebServiceOrders/Model/GetServiceStatusResult.php | MarketplaceWebServiceOrders_Model_GetServiceStatusResult.setMessages | public function setMessages($value)
{
if (!$this->_isNumericArray($value)) {
$value = array ($value);
}
$this->_fields['Messages']['FieldValue'] = $value;
return $this;
} | php | public function setMessages($value)
{
if (!$this->_isNumericArray($value)) {
$value = array ($value);
}
$this->_fields['Messages']['FieldValue'] = $value;
return $this;
} | [
"public",
"function",
"setMessages",
"(",
"$",
"value",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"_isNumericArray",
"(",
"$",
"value",
")",
")",
"{",
"$",
"value",
"=",
"array",
"(",
"$",
"value",
")",
";",
"}",
"$",
"this",
"->",
"_fields",
... | Set the value of the Messages property.
@param array messages
@return this instance | [
"Set",
"the",
"value",
"of",
"the",
"Messages",
"property",
"."
] | 9554998cb67189768f26da9229fcdc580943444d | https://github.com/coopTilleuls/amazon-mws-orders/blob/9554998cb67189768f26da9229fcdc580943444d/src/MarketplaceWebServiceOrders/Model/GetServiceStatusResult.php#L212-L219 |
190,672 | coopTilleuls/amazon-mws-orders | src/MarketplaceWebServiceOrders/Model/ListOrdersRequest.php | MarketplaceWebServiceOrders_Model_ListOrdersRequest.setOrderStatus | public function setOrderStatus($value)
{
if (!$this->_isNumericArray($value)) {
$value = array ($value);
}
$this->_fields['OrderStatus']['FieldValue'] = $value;
return $this;
} | php | public function setOrderStatus($value)
{
if (!$this->_isNumericArray($value)) {
$value = array ($value);
}
$this->_fields['OrderStatus']['FieldValue'] = $value;
return $this;
} | [
"public",
"function",
"setOrderStatus",
"(",
"$",
"value",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"_isNumericArray",
"(",
"$",
"value",
")",
")",
"{",
"$",
"value",
"=",
"array",
"(",
"$",
"value",
")",
";",
"}",
"$",
"this",
"->",
"_fields",... | Set the value of the OrderStatus property.
@param array orderStatus
@return this instance | [
"Set",
"the",
"value",
"of",
"the",
"OrderStatus",
"property",
"."
] | 9554998cb67189768f26da9229fcdc580943444d | https://github.com/coopTilleuls/amazon-mws-orders/blob/9554998cb67189768f26da9229fcdc580943444d/src/MarketplaceWebServiceOrders/Model/ListOrdersRequest.php#L370-L377 |
190,673 | coopTilleuls/amazon-mws-orders | src/MarketplaceWebServiceOrders/Model/ListOrdersRequest.php | MarketplaceWebServiceOrders_Model_ListOrdersRequest.setMarketplaceId | public function setMarketplaceId($value)
{
if (!$this->_isNumericArray($value)) {
$value = array ($value);
}
$this->_fields['MarketplaceId']['FieldValue'] = $value;
return $this;
} | php | public function setMarketplaceId($value)
{
if (!$this->_isNumericArray($value)) {
$value = array ($value);
}
$this->_fields['MarketplaceId']['FieldValue'] = $value;
return $this;
} | [
"public",
"function",
"setMarketplaceId",
"(",
"$",
"value",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"_isNumericArray",
"(",
"$",
"value",
")",
")",
"{",
"$",
"value",
"=",
"array",
"(",
"$",
"value",
")",
";",
"}",
"$",
"this",
"->",
"_fields... | Set the value of the MarketplaceId property.
@param array marketplaceId
@return this instance | [
"Set",
"the",
"value",
"of",
"the",
"MarketplaceId",
"property",
"."
] | 9554998cb67189768f26da9229fcdc580943444d | https://github.com/coopTilleuls/amazon-mws-orders/blob/9554998cb67189768f26da9229fcdc580943444d/src/MarketplaceWebServiceOrders/Model/ListOrdersRequest.php#L434-L441 |
190,674 | coopTilleuls/amazon-mws-orders | src/MarketplaceWebServiceOrders/Model/ListOrdersRequest.php | MarketplaceWebServiceOrders_Model_ListOrdersRequest.setFulfillmentChannel | public function setFulfillmentChannel($value)
{
if (!$this->_isNumericArray($value)) {
$value = array ($value);
}
$this->_fields['FulfillmentChannel']['FieldValue'] = $value;
return $this;
} | php | public function setFulfillmentChannel($value)
{
if (!$this->_isNumericArray($value)) {
$value = array ($value);
}
$this->_fields['FulfillmentChannel']['FieldValue'] = $value;
return $this;
} | [
"public",
"function",
"setFulfillmentChannel",
"(",
"$",
"value",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"_isNumericArray",
"(",
"$",
"value",
")",
")",
"{",
"$",
"value",
"=",
"array",
"(",
"$",
"value",
")",
";",
"}",
"$",
"this",
"->",
"_f... | Set the value of the FulfillmentChannel property.
@param array fulfillmentChannel
@return this instance | [
"Set",
"the",
"value",
"of",
"the",
"FulfillmentChannel",
"property",
"."
] | 9554998cb67189768f26da9229fcdc580943444d | https://github.com/coopTilleuls/amazon-mws-orders/blob/9554998cb67189768f26da9229fcdc580943444d/src/MarketplaceWebServiceOrders/Model/ListOrdersRequest.php#L498-L505 |
190,675 | coopTilleuls/amazon-mws-orders | src/MarketplaceWebServiceOrders/Model/ListOrdersRequest.php | MarketplaceWebServiceOrders_Model_ListOrdersRequest.setPaymentMethod | public function setPaymentMethod($value)
{
if (!$this->_isNumericArray($value)) {
$value = array ($value);
}
$this->_fields['PaymentMethod']['FieldValue'] = $value;
return $this;
} | php | public function setPaymentMethod($value)
{
if (!$this->_isNumericArray($value)) {
$value = array ($value);
}
$this->_fields['PaymentMethod']['FieldValue'] = $value;
return $this;
} | [
"public",
"function",
"setPaymentMethod",
"(",
"$",
"value",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"_isNumericArray",
"(",
"$",
"value",
")",
")",
"{",
"$",
"value",
"=",
"array",
"(",
"$",
"value",
")",
";",
"}",
"$",
"this",
"->",
"_fields... | Set the value of the PaymentMethod property.
@param array paymentMethod
@return this instance | [
"Set",
"the",
"value",
"of",
"the",
"PaymentMethod",
"property",
"."
] | 9554998cb67189768f26da9229fcdc580943444d | https://github.com/coopTilleuls/amazon-mws-orders/blob/9554998cb67189768f26da9229fcdc580943444d/src/MarketplaceWebServiceOrders/Model/ListOrdersRequest.php#L562-L569 |
190,676 | coopTilleuls/amazon-mws-orders | src/MarketplaceWebServiceOrders/Model/ListOrdersRequest.php | MarketplaceWebServiceOrders_Model_ListOrdersRequest.setTFMShipmentStatus | public function setTFMShipmentStatus($value)
{
if (!$this->_isNumericArray($value)) {
$value = array ($value);
}
$this->_fields['TFMShipmentStatus']['FieldValue'] = $value;
return $this;
} | php | public function setTFMShipmentStatus($value)
{
if (!$this->_isNumericArray($value)) {
$value = array ($value);
}
$this->_fields['TFMShipmentStatus']['FieldValue'] = $value;
return $this;
} | [
"public",
"function",
"setTFMShipmentStatus",
"(",
"$",
"value",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"_isNumericArray",
"(",
"$",
"value",
")",
")",
"{",
"$",
"value",
"=",
"array",
"(",
"$",
"value",
")",
";",
"}",
"$",
"this",
"->",
"_fi... | Set the value of the TFMShipmentStatus property.
@param array tfmShipmentStatus
@return this instance | [
"Set",
"the",
"value",
"of",
"the",
"TFMShipmentStatus",
"property",
"."
] | 9554998cb67189768f26da9229fcdc580943444d | https://github.com/coopTilleuls/amazon-mws-orders/blob/9554998cb67189768f26da9229fcdc580943444d/src/MarketplaceWebServiceOrders/Model/ListOrdersRequest.php#L764-L771 |
190,677 | Kylob/Blog | src/Twig/Theme.php | Theme.this | public function this(\Twig_Template $twig, $key = null, $value = null)
{
$name = $twig->getTemplateName();
if (!isset($this->plugin[$name])) {
$this->plugin[$name] = array();
}
if (func_num_args() == 1) {
return $this->plugin[$name]; // return all values
... | php | public function this(\Twig_Template $twig, $key = null, $value = null)
{
$name = $twig->getTemplateName();
if (!isset($this->plugin[$name])) {
$this->plugin[$name] = array();
}
if (func_num_args() == 1) {
return $this->plugin[$name]; // return all values
... | [
"public",
"function",
"this",
"(",
"\\",
"Twig_Template",
"$",
"twig",
",",
"$",
"key",
"=",
"null",
",",
"$",
"value",
"=",
"null",
")",
"{",
"$",
"name",
"=",
"$",
"twig",
"->",
"getTemplateName",
"(",
")",
";",
"if",
"(",
"!",
"isset",
"(",
"$... | A reference to the current template, sort of. This enables your plugin macros to behave more like a class, and these are your properties.
@param object $twig ``_self`` so we know who you are.
@param mixed $key What you want to either set or retrieve. Pass ``null`` to remove them all. Make it an array to set mul... | [
"A",
"reference",
"to",
"the",
"current",
"template",
"sort",
"of",
".",
"This",
"enables",
"your",
"plugin",
"macros",
"to",
"behave",
"more",
"like",
"a",
"class",
"and",
"these",
"are",
"your",
"properties",
"."
] | 5783def10888860ad4c4f77cda5ce6a48fee4144 | https://github.com/Kylob/Blog/blob/5783def10888860ad4c4f77cda5ce6a48fee4144/src/Twig/Theme.php#L510-L531 |
190,678 | Kylob/Blog | src/Twig/Theme.php | Theme.removeEval | private function removeEval(&$pattern)
{
if (is_array($pattern)) {
foreach ($pattern as $key => $value) {
$pattern[$key] = $this->removeEval($value);
}
} elseif (is_string($pattern)) {
$pattern = trim($pattern);
$mods = strrpos($pattern... | php | private function removeEval(&$pattern)
{
if (is_array($pattern)) {
foreach ($pattern as $key => $value) {
$pattern[$key] = $this->removeEval($value);
}
} elseif (is_string($pattern)) {
$pattern = trim($pattern);
$mods = strrpos($pattern... | [
"private",
"function",
"removeEval",
"(",
"&",
"$",
"pattern",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"pattern",
")",
")",
"{",
"foreach",
"(",
"$",
"pattern",
"as",
"$",
"key",
"=>",
"$",
"value",
")",
"{",
"$",
"pattern",
"[",
"$",
"key",
"... | Remove 'e' eval modifier from pattern.
@param mixed $pattern Regex backslashes must be double-escaped to work properly ie. '//'
@return mixed
@link http://php.net/manual/en/reference.pcre.pattern.modifiers.php#reference.pcre.pattern.modifiers.eval
@link http://twig.sensiolabs.org/doc/templates.html#comparisons | [
"Remove",
"e",
"eval",
"modifier",
"from",
"pattern",
"."
] | 5783def10888860ad4c4f77cda5ce6a48fee4144 | https://github.com/Kylob/Blog/blob/5783def10888860ad4c4f77cda5ce6a48fee4144/src/Twig/Theme.php#L700-L713 |
190,679 | coopTilleuls/amazon-mws-orders | src/MarketplaceWebServiceOrders/Model/ListOrderItemsByNextTokenResult.php | MarketplaceWebServiceOrders_Model_ListOrderItemsByNextTokenResult.setOrderItems | public function setOrderItems($value)
{
if (!$this->_isNumericArray($value)) {
$value = array ($value);
}
$this->_fields['OrderItems']['FieldValue'] = $value;
return $this;
} | php | public function setOrderItems($value)
{
if (!$this->_isNumericArray($value)) {
$value = array ($value);
}
$this->_fields['OrderItems']['FieldValue'] = $value;
return $this;
} | [
"public",
"function",
"setOrderItems",
"(",
"$",
"value",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"_isNumericArray",
"(",
"$",
"value",
")",
")",
"{",
"$",
"value",
"=",
"array",
"(",
"$",
"value",
")",
";",
"}",
"$",
"this",
"->",
"_fields",
... | Set the value of the OrderItems property.
@param array orderItems
@return this instance | [
"Set",
"the",
"value",
"of",
"the",
"OrderItems",
"property",
"."
] | 9554998cb67189768f26da9229fcdc580943444d | https://github.com/coopTilleuls/amazon-mws-orders/blob/9554998cb67189768f26da9229fcdc580943444d/src/MarketplaceWebServiceOrders/Model/ListOrderItemsByNextTokenResult.php#L164-L171 |
190,680 | coopTilleuls/amazon-mws-orders | src/MarketplaceWebServiceOrders/Model/Order.php | MarketplaceWebServiceOrders_Model_Order.setPaymentExecutionDetail | public function setPaymentExecutionDetail($value)
{
if (!$this->_isNumericArray($value)) {
$value = array ($value);
}
$this->_fields['PaymentExecutionDetail']['FieldValue'] = $value;
return $this;
} | php | public function setPaymentExecutionDetail($value)
{
if (!$this->_isNumericArray($value)) {
$value = array ($value);
}
$this->_fields['PaymentExecutionDetail']['FieldValue'] = $value;
return $this;
} | [
"public",
"function",
"setPaymentExecutionDetail",
"(",
"$",
"value",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"_isNumericArray",
"(",
"$",
"value",
")",
")",
"{",
"$",
"value",
"=",
"array",
"(",
"$",
"value",
")",
";",
"}",
"$",
"this",
"->",
... | Set the value of the PaymentExecutionDetail property.
@param array paymentExecutionDetail
@return this instance | [
"Set",
"the",
"value",
"of",
"the",
"PaymentExecutionDetail",
"property",
"."
] | 9554998cb67189768f26da9229fcdc580943444d | https://github.com/coopTilleuls/amazon-mws-orders/blob/9554998cb67189768f26da9229fcdc580943444d/src/MarketplaceWebServiceOrders/Model/Order.php#L736-L743 |
190,681 | coopTilleuls/amazon-mws-orders | src/MarketplaceWebServiceOrders/Model/Order.php | MarketplaceWebServiceOrders_Model_Order.setPaymentMethodDetails | public function setPaymentMethodDetails($value)
{
if (!$this->_isNumericArray($value)) {
$value = array ($value);
}
$this->_fields['PaymentMethodDetails']['FieldValue'] = $value;
return $this;
} | php | public function setPaymentMethodDetails($value)
{
if (!$this->_isNumericArray($value)) {
$value = array ($value);
}
$this->_fields['PaymentMethodDetails']['FieldValue'] = $value;
return $this;
} | [
"public",
"function",
"setPaymentMethodDetails",
"(",
"$",
"value",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"_isNumericArray",
"(",
"$",
"value",
")",
")",
"{",
"$",
"value",
"=",
"array",
"(",
"$",
"value",
")",
";",
"}",
"$",
"this",
"->",
"... | Set the value of the PaymentMethodDetails property.
@param array paymentMethodDetails
@return this instance | [
"Set",
"the",
"value",
"of",
"the",
"PaymentMethodDetails",
"property",
"."
] | 9554998cb67189768f26da9229fcdc580943444d | https://github.com/coopTilleuls/amazon-mws-orders/blob/9554998cb67189768f26da9229fcdc580943444d/src/MarketplaceWebServiceOrders/Model/Order.php#L846-L853 |
190,682 | coopTilleuls/amazon-mws-orders | src/MarketplaceWebServiceOrders/Model/GetOrderRequest.php | MarketplaceWebServiceOrders_Model_GetOrderRequest.setAmazonOrderId | public function setAmazonOrderId($value)
{
if (!$this->_isNumericArray($value)) {
$value = array ($value);
}
$this->_fields['AmazonOrderId']['FieldValue'] = $value;
return $this;
} | php | public function setAmazonOrderId($value)
{
if (!$this->_isNumericArray($value)) {
$value = array ($value);
}
$this->_fields['AmazonOrderId']['FieldValue'] = $value;
return $this;
} | [
"public",
"function",
"setAmazonOrderId",
"(",
"$",
"value",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"_isNumericArray",
"(",
"$",
"value",
")",
")",
"{",
"$",
"value",
"=",
"array",
"(",
"$",
"value",
")",
";",
"}",
"$",
"this",
"->",
"_fields... | Set the value of the AmazonOrderId property.
@param array amazonOrderId
@return this instance | [
"Set",
"the",
"value",
"of",
"the",
"AmazonOrderId",
"property",
"."
] | 9554998cb67189768f26da9229fcdc580943444d | https://github.com/coopTilleuls/amazon-mws-orders/blob/9554998cb67189768f26da9229fcdc580943444d/src/MarketplaceWebServiceOrders/Model/GetOrderRequest.php#L164-L171 |
190,683 | Kylob/Blog | src/Blog.php | Blog.url | public function url($path, $slashes = false)
{
$path = ($slashes !== false) ? explode('/', $path) : array($path);
foreach ($path as $key => $value) {
$path[$key] = URLify::filter($value);
}
return implode('/', $path);
} | php | public function url($path, $slashes = false)
{
$path = ($slashes !== false) ? explode('/', $path) : array($path);
foreach ($path as $key => $value) {
$path[$key] = URLify::filter($value);
}
return implode('/', $path);
} | [
"public",
"function",
"url",
"(",
"$",
"path",
",",
"$",
"slashes",
"=",
"false",
")",
"{",
"$",
"path",
"=",
"(",
"$",
"slashes",
"!==",
"false",
")",
"?",
"explode",
"(",
"'/'",
",",
"$",
"path",
")",
":",
"array",
"(",
"$",
"path",
")",
";",... | Slugifies a folder path suitable for urls.
@param string $path The path you would like to slugify
@param mixed $slashes If anything but false, it will allow your path to have slashes.
@return string | [
"Slugifies",
"a",
"folder",
"path",
"suitable",
"for",
"urls",
"."
] | 5783def10888860ad4c4f77cda5ce6a48fee4144 | https://github.com/Kylob/Blog/blob/5783def10888860ad4c4f77cda5ce6a48fee4144/src/Blog.php#L787-L795 |
190,684 | Kylob/Blog | src/Blog.php | Blog.title | public function title($string)
{
$string = explode(' ', $string);
foreach ($string as $key => $value) {
if (!empty($value) && mb_strtoupper($value) == $value) {
$string[$key] = mb_strtolower($value);
}
}
return TextFormatter::titleCase(implode... | php | public function title($string)
{
$string = explode(' ', $string);
foreach ($string as $key => $value) {
if (!empty($value) && mb_strtoupper($value) == $value) {
$string[$key] = mb_strtolower($value);
}
}
return TextFormatter::titleCase(implode... | [
"public",
"function",
"title",
"(",
"$",
"string",
")",
"{",
"$",
"string",
"=",
"explode",
"(",
"' '",
",",
"$",
"string",
")",
";",
"foreach",
"(",
"$",
"string",
"as",
"$",
"key",
"=>",
"$",
"value",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"... | Properly formats a title string.
@param string $string
@return string | [
"Properly",
"formats",
"a",
"title",
"string",
"."
] | 5783def10888860ad4c4f77cda5ce6a48fee4144 | https://github.com/Kylob/Blog/blob/5783def10888860ad4c4f77cda5ce6a48fee4144/src/Blog.php#L804-L814 |
190,685 | Kylob/Blog | src/Blog.php | Blog.config | public function config($key = null)
{
$args = func_get_args(); // In PHP7, func_get_args() are changed by the time we use them, so we call it now
if (is_null($this->config)) {
$file = $this->folder.'config.yml';
$this->config = (is_file($file)) ? (array) Yaml::parse(file_get_... | php | public function config($key = null)
{
$args = func_get_args(); // In PHP7, func_get_args() are changed by the time we use them, so we call it now
if (is_null($this->config)) {
$file = $this->folder.'config.yml';
$this->config = (is_file($file)) ? (array) Yaml::parse(file_get_... | [
"public",
"function",
"config",
"(",
"$",
"key",
"=",
"null",
")",
"{",
"$",
"args",
"=",
"func_get_args",
"(",
")",
";",
"// In PHP7, func_get_args() are changed by the time we use them, so we call it now",
"if",
"(",
"is_null",
"(",
"$",
"this",
"->",
"config",
... | Retrieves any config value found in the Blog's config.yml file.
@param string $key The config array key whose value you would like to retrieve. For every arg you include we will keep working our way up the config array to find just what you are looking for.
@return mixed The config key(s) value, or null if not found... | [
"Retrieves",
"any",
"config",
"value",
"found",
"in",
"the",
"Blog",
"s",
"config",
".",
"yml",
"file",
"."
] | 5783def10888860ad4c4f77cda5ce6a48fee4144 | https://github.com/Kylob/Blog/blob/5783def10888860ad4c4f77cda5ce6a48fee4144/src/Blog.php#L823-L872 |
190,686 | Kylob/Blog | src/Blog.php | Blog.configInfo | private function configInfo($table, $path, $name)
{
if (empty($path)) {
return array();
}
if (!$config = $this->config($table, $path)) {
$config = array();
}
unset($config['path'], $config['url']);
$page = Page::html();
$config = array_... | php | private function configInfo($table, $path, $name)
{
if (empty($path)) {
return array();
}
if (!$config = $this->config($table, $path)) {
$config = array();
}
unset($config['path'], $config['url']);
$page = Page::html();
$config = array_... | [
"private",
"function",
"configInfo",
"(",
"$",
"table",
",",
"$",
"path",
",",
"$",
"name",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"path",
")",
")",
"{",
"return",
"array",
"(",
")",
";",
"}",
"if",
"(",
"!",
"$",
"config",
"=",
"$",
"this",
... | Compiles an array of useful information.
@param string $table Either 'authors', 'categories', or 'tags'.
@param string $path The ``$table``'s key (a url path).
@param string $name The default ``$table[$path]``'s name if one is not specified.
@return array Either an empty one if not found, or the 'name', 'path', 'ur... | [
"Compiles",
"an",
"array",
"of",
"useful",
"information",
"."
] | 5783def10888860ad4c4f77cda5ce6a48fee4144 | https://github.com/Kylob/Blog/blob/5783def10888860ad4c4f77cda5ce6a48fee4144/src/Blog.php#L883-L904 |
190,687 | Kylob/Blog | src/Blog.php | Blog.normalizeFolders | private function normalizeFolders($path = null)
{
$page = Page::html();
$dir = $this->folder.'content/';
// normalize
if ($path && preg_match('/[^'.$page->url['chars'].'\/]/', $path)) {
$seo = $this->url($path, 'slashes');
if (is_dir($dir.$path)) {
... | php | private function normalizeFolders($path = null)
{
$page = Page::html();
$dir = $this->folder.'content/';
// normalize
if ($path && preg_match('/[^'.$page->url['chars'].'\/]/', $path)) {
$seo = $this->url($path, 'slashes');
if (is_dir($dir.$path)) {
... | [
"private",
"function",
"normalizeFolders",
"(",
"$",
"path",
"=",
"null",
")",
"{",
"$",
"page",
"=",
"Page",
"::",
"html",
"(",
")",
";",
"$",
"dir",
"=",
"$",
"this",
"->",
"folder",
".",
"'content/'",
";",
"// normalize",
"if",
"(",
"$",
"path",
... | Recursively goes through the blog's 'content' folder, and fixes any malnamed directories.
@param string $path There is nothing to see here. This value gets passed within the method itself. | [
"Recursively",
"goes",
"through",
"the",
"blog",
"s",
"content",
"folder",
"and",
"fixes",
"any",
"malnamed",
"directories",
"."
] | 5783def10888860ad4c4f77cda5ce6a48fee4144 | https://github.com/Kylob/Blog/blob/5783def10888860ad4c4f77cda5ce6a48fee4144/src/Blog.php#L1027-L1043 |
190,688 | coopTilleuls/amazon-mws-orders | src/MarketplaceWebServiceOrders/Model/ListOrdersResult.php | MarketplaceWebServiceOrders_Model_ListOrdersResult.setOrders | public function setOrders($value)
{
if (!$this->_isNumericArray($value)) {
$value = array ($value);
}
$this->_fields['Orders']['FieldValue'] = $value;
return $this;
} | php | public function setOrders($value)
{
if (!$this->_isNumericArray($value)) {
$value = array ($value);
}
$this->_fields['Orders']['FieldValue'] = $value;
return $this;
} | [
"public",
"function",
"setOrders",
"(",
"$",
"value",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"_isNumericArray",
"(",
"$",
"value",
")",
")",
"{",
"$",
"value",
"=",
"array",
"(",
"$",
"value",
")",
";",
"}",
"$",
"this",
"->",
"_fields",
"[... | Set the value of the Orders property.
@param array orders
@return this instance | [
"Set",
"the",
"value",
"of",
"the",
"Orders",
"property",
"."
] | 9554998cb67189768f26da9229fcdc580943444d | https://github.com/coopTilleuls/amazon-mws-orders/blob/9554998cb67189768f26da9229fcdc580943444d/src/MarketplaceWebServiceOrders/Model/ListOrdersResult.php#L212-L219 |
190,689 | coopTilleuls/amazon-mws-orders | src/MarketplaceWebServiceOrders/Model/OrderItem.php | MarketplaceWebServiceOrders_Model_OrderItem.setPromotionIds | public function setPromotionIds($value)
{
if (!$this->_isNumericArray($value)) {
$value = array ($value);
}
$this->_fields['PromotionIds']['FieldValue'] = $value;
return $this;
} | php | public function setPromotionIds($value)
{
if (!$this->_isNumericArray($value)) {
$value = array ($value);
}
$this->_fields['PromotionIds']['FieldValue'] = $value;
return $this;
} | [
"public",
"function",
"setPromotionIds",
"(",
"$",
"value",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"_isNumericArray",
"(",
"$",
"value",
")",
")",
"{",
"$",
"value",
"=",
"array",
"(",
"$",
"value",
")",
";",
"}",
"$",
"this",
"->",
"_fields"... | Set the value of the PromotionIds property.
@param array promotionIds
@return this instance | [
"Set",
"the",
"value",
"of",
"the",
"PromotionIds",
"property",
"."
] | 9554998cb67189768f26da9229fcdc580943444d | https://github.com/coopTilleuls/amazon-mws-orders/blob/9554998cb67189768f26da9229fcdc580943444d/src/MarketplaceWebServiceOrders/Model/OrderItem.php#L812-L819 |
190,690 | kylekatarnls/vicopo | src/Vicopo.php | Vicopo.get | static protected function get($search, $protocol = 'https') {
$vicopoUrl = $protocol . '://vicopo.selfbuild.fr/search/' . urlencode($search);
$json = @json_decode(file_get_contents($vicopoUrl));
if (!is_object($json) || !isset($json->cities)) {
throw new Exception("No valid answear found", 1);
}
return $js... | php | static protected function get($search, $protocol = 'https') {
$vicopoUrl = $protocol . '://vicopo.selfbuild.fr/search/' . urlencode($search);
$json = @json_decode(file_get_contents($vicopoUrl));
if (!is_object($json) || !isset($json->cities)) {
throw new Exception("No valid answear found", 1);
}
return $js... | [
"static",
"protected",
"function",
"get",
"(",
"$",
"search",
",",
"$",
"protocol",
"=",
"'https'",
")",
"{",
"$",
"vicopoUrl",
"=",
"$",
"protocol",
".",
"'://vicopo.selfbuild.fr/search/'",
".",
"urlencode",
"(",
"$",
"search",
")",
";",
"$",
"json",
"=",... | Search on VICOPO server.
@param string $search city name or zip code
@param string $protocol http or https
@return array
@throws Exception | [
"Search",
"on",
"VICOPO",
"server",
"."
] | c0d851c716c9f67a948dd2ea338e881145be7daf | https://github.com/kylekatarnls/vicopo/blob/c0d851c716c9f67a948dd2ea338e881145be7daf/src/Vicopo.php#L19-L26 |
190,691 | coopTilleuls/amazon-mws-orders | src/MarketplaceWebServiceOrders/Model/BuyerTaxInfo.php | MarketplaceWebServiceOrders_Model_BuyerTaxInfo.setTaxClassifications | public function setTaxClassifications($value)
{
if (!$this->_isNumericArray($value)) {
$value = array ($value);
}
$this->_fields['TaxClassifications']['FieldValue'] = $value;
return $this;
} | php | public function setTaxClassifications($value)
{
if (!$this->_isNumericArray($value)) {
$value = array ($value);
}
$this->_fields['TaxClassifications']['FieldValue'] = $value;
return $this;
} | [
"public",
"function",
"setTaxClassifications",
"(",
"$",
"value",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"_isNumericArray",
"(",
"$",
"value",
")",
")",
"{",
"$",
"value",
"=",
"array",
"(",
"$",
"value",
")",
";",
"}",
"$",
"this",
"->",
"_f... | Set the value of the TaxClassifications property.
@param array taxClassifications
@return this instance | [
"Set",
"the",
"value",
"of",
"the",
"TaxClassifications",
"property",
"."
] | 9554998cb67189768f26da9229fcdc580943444d | https://github.com/coopTilleuls/amazon-mws-orders/blob/9554998cb67189768f26da9229fcdc580943444d/src/MarketplaceWebServiceOrders/Model/BuyerTaxInfo.php#L164-L171 |
190,692 | icomefromthenet/ReverseRegex | src/ReverseRegex/Parser/CharacterClass.php | CharacterClass.normalize | public function normalize(Scope $head, Scope $set, Lexer $lexer)
{
$collection = array();
$unicode = new Unicode();
while($lexer->moveNext() && !$lexer->isNextToken(Lexer::T_SET_CLOSE)) {
$value = null;
switch(true) {
... | php | public function normalize(Scope $head, Scope $set, Lexer $lexer)
{
$collection = array();
$unicode = new Unicode();
while($lexer->moveNext() && !$lexer->isNextToken(Lexer::T_SET_CLOSE)) {
$value = null;
switch(true) {
... | [
"public",
"function",
"normalize",
"(",
"Scope",
"$",
"head",
",",
"Scope",
"$",
"set",
",",
"Lexer",
"$",
"lexer",
")",
"{",
"$",
"collection",
"=",
"array",
"(",
")",
";",
"$",
"unicode",
"=",
"new",
"Unicode",
"(",
")",
";",
"while",
"(",
"$",
... | Will return a normalized ie unicode sequences been evaluated.
@return string a normalized character class string
@param ReverseRegex\Generator\Scope $head
@param ReverseRegex\Generator\Scope $set
@param Lexer $lexer the lexer to normalize | [
"Will",
"return",
"a",
"normalized",
"ie",
"unicode",
"sequences",
"been",
"evaluated",
"."
] | 1e48eb88a0dd0220f5c234fda38ceb4d47e378ad | https://github.com/icomefromthenet/ReverseRegex/blob/1e48eb88a0dd0220f5c234fda38ceb4d47e378ad/src/ReverseRegex/Parser/CharacterClass.php#L28-L63 |
190,693 | icomefromthenet/ReverseRegex | src/ReverseRegex/Parser/CharacterClass.php | CharacterClass.fillRange | public function fillRange(Scope $head,$start,$end)
{
$start_index = Utf8::ord($start);
$ending_index = Utf8::ord($end);
if($ending_index < $start_index ) {
throw new ParserException(sprintf('Character class range %s - %s is out of order',$start,$end));
... | php | public function fillRange(Scope $head,$start,$end)
{
$start_index = Utf8::ord($start);
$ending_index = Utf8::ord($end);
if($ending_index < $start_index ) {
throw new ParserException(sprintf('Character class range %s - %s is out of order',$start,$end));
... | [
"public",
"function",
"fillRange",
"(",
"Scope",
"$",
"head",
",",
"$",
"start",
",",
"$",
"end",
")",
"{",
"$",
"start_index",
"=",
"Utf8",
"::",
"ord",
"(",
"$",
"start",
")",
";",
"$",
"ending_index",
"=",
"Utf8",
"::",
"ord",
"(",
"$",
"end",
... | Fill a range given starting and ending character
@return void
@access public | [
"Fill",
"a",
"range",
"given",
"starting",
"and",
"ending",
"character"
] | 1e48eb88a0dd0220f5c234fda38ceb4d47e378ad | https://github.com/icomefromthenet/ReverseRegex/blob/1e48eb88a0dd0220f5c234fda38ceb4d47e378ad/src/ReverseRegex/Parser/CharacterClass.php#L131-L144 |
190,694 | icomefromthenet/ReverseRegex | src/ReverseRegex/Generator/LiteralScope.php | LiteralScope.generate | public function generate(&$result,GeneratorInterface $generator)
{
if($this->literals->count() === 0) {
throw new GeneratorException('There are no literals to choose from');
}
$repeat_x = $this->calculateRepeatQuota($generator);
while($repeat_x > 0) {
... | php | public function generate(&$result,GeneratorInterface $generator)
{
if($this->literals->count() === 0) {
throw new GeneratorException('There are no literals to choose from');
}
$repeat_x = $this->calculateRepeatQuota($generator);
while($repeat_x > 0) {
... | [
"public",
"function",
"generate",
"(",
"&",
"$",
"result",
",",
"GeneratorInterface",
"$",
"generator",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"literals",
"->",
"count",
"(",
")",
"===",
"0",
")",
"{",
"throw",
"new",
"GeneratorException",
"(",
"'There ... | Generate a text string appending to the result argument
@access public
@param string $result
@param GeneratorInterface $generator | [
"Generate",
"a",
"text",
"string",
"appending",
"to",
"the",
"result",
"argument"
] | 1e48eb88a0dd0220f5c234fda38ceb4d47e378ad | https://github.com/icomefromthenet/ReverseRegex/blob/1e48eb88a0dd0220f5c234fda38ceb4d47e378ad/src/ReverseRegex/Generator/LiteralScope.php#L79-L101 |
190,695 | camcima/camcima-soap-client | src/Camcima/Soap/Client.php | Client.setProxyAuth | public function setProxyAuth($user, $password)
{
$this->setProxyUser($user);
$this->setProxyPassword($password);
return $this;
} | php | public function setProxyAuth($user, $password)
{
$this->setProxyUser($user);
$this->setProxyPassword($password);
return $this;
} | [
"public",
"function",
"setProxyAuth",
"(",
"$",
"user",
",",
"$",
"password",
")",
"{",
"$",
"this",
"->",
"setProxyUser",
"(",
"$",
"user",
")",
";",
"$",
"this",
"->",
"setProxyPassword",
"(",
"$",
"password",
")",
";",
"return",
"$",
"this",
";",
... | Set proxy auth data
@param $user
@param $password
@return $this | [
"Set",
"proxy",
"auth",
"data"
] | 7ac4465b1953601564ac213352151df469366af1 | https://github.com/camcima/camcima-soap-client/blob/7ac4465b1953601564ac213352151df469366af1/src/Camcima/Soap/Client.php#L507-L513 |
190,696 | odan/twig-assets | src/Twig/TwigAssetsEngine.php | TwigAssetsEngine.prepareAssets | private function prepareAssets(array $assets): array
{
$result = [];
foreach ($assets as $name) {
$result[] = $this->getRealFilename($name);
}
return $result;
} | php | private function prepareAssets(array $assets): array
{
$result = [];
foreach ($assets as $name) {
$result[] = $this->getRealFilename($name);
}
return $result;
} | [
"private",
"function",
"prepareAssets",
"(",
"array",
"$",
"assets",
")",
":",
"array",
"{",
"$",
"result",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"assets",
"as",
"$",
"name",
")",
"{",
"$",
"result",
"[",
"]",
"=",
"$",
"this",
"->",
"getRealFil... | Resolve real asset filenames.
@param array $assets assets
@return array assets | [
"Resolve",
"real",
"asset",
"filenames",
"."
] | a116a7bfc2fdc03d99efc0fb0168e796cbff8a22 | https://github.com/odan/twig-assets/blob/a116a7bfc2fdc03d99efc0fb0168e796cbff8a22/src/Twig/TwigAssetsEngine.php#L151-L159 |
190,697 | odan/twig-assets | src/Twig/TwigAssetsEngine.php | TwigAssetsEngine.getRealFilename | private function getRealFilename(string $file): string
{
if (strpos($file, 'vfs://') !== false) {
return $file;
}
return $this->loader->getSourceContext($file)->getPath();
} | php | private function getRealFilename(string $file): string
{
if (strpos($file, 'vfs://') !== false) {
return $file;
}
return $this->loader->getSourceContext($file)->getPath();
} | [
"private",
"function",
"getRealFilename",
"(",
"string",
"$",
"file",
")",
":",
"string",
"{",
"if",
"(",
"strpos",
"(",
"$",
"file",
",",
"'vfs://'",
")",
"!==",
"false",
")",
"{",
"return",
"$",
"file",
";",
"}",
"return",
"$",
"this",
"->",
"loade... | Returns full path and filename.
@param string $file file
@throws LoaderError
@return string | [
"Returns",
"full",
"path",
"and",
"filename",
"."
] | a116a7bfc2fdc03d99efc0fb0168e796cbff8a22 | https://github.com/odan/twig-assets/blob/a116a7bfc2fdc03d99efc0fb0168e796cbff8a22/src/Twig/TwigAssetsEngine.php#L170-L177 |
190,698 | icomefromthenet/ReverseRegex | src/ReverseRegex/Generator/Node.php | Node.setLabel | public function setLabel($label)
{
if (!(is_scalar($label) || is_null($label))) {
return false;
}
$this->label = $label;
} | php | public function setLabel($label)
{
if (!(is_scalar($label) || is_null($label))) {
return false;
}
$this->label = $label;
} | [
"public",
"function",
"setLabel",
"(",
"$",
"label",
")",
"{",
"if",
"(",
"!",
"(",
"is_scalar",
"(",
"$",
"label",
")",
"||",
"is_null",
"(",
"$",
"label",
")",
")",
")",
"{",
"return",
"false",
";",
"}",
"$",
"this",
"->",
"label",
"=",
"$",
... | Sets the node label
@access public
@param string $label the nodes label | [
"Sets",
"the",
"node",
"label"
] | 1e48eb88a0dd0220f5c234fda38ceb4d47e378ad | https://github.com/icomefromthenet/ReverseRegex/blob/1e48eb88a0dd0220f5c234fda38ceb4d47e378ad/src/ReverseRegex/Generator/Node.php#L64-L71 |
190,699 | icomefromthenet/ReverseRegex | src/ReverseRegex/Generator/Node.php | Node.& | public function &detach(Node $node)
{
foreach ($this->links as $linked_node) {
if ($linked_node == $node) {
$this->links->detach($node);
}
}
return $this;
} | php | public function &detach(Node $node)
{
foreach ($this->links as $linked_node) {
if ($linked_node == $node) {
$this->links->detach($node);
}
}
return $this;
} | [
"public",
"function",
"&",
"detach",
"(",
"Node",
"$",
"node",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"links",
"as",
"$",
"linked_node",
")",
"{",
"if",
"(",
"$",
"linked_node",
"==",
"$",
"node",
")",
"{",
"$",
"this",
"->",
"links",
"->",
... | Detach a node
@access public
@return Node
@param Node $node the node to remove | [
"Detach",
"a",
"node"
] | 1e48eb88a0dd0220f5c234fda38ceb4d47e378ad | https://github.com/icomefromthenet/ReverseRegex/blob/1e48eb88a0dd0220f5c234fda38ceb4d47e378ad/src/ReverseRegex/Generator/Node.php#L95-L104 |
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.