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
228,700
mariano/disque-php
src/Connection/Socket.php
Socket.getSocket
protected function getSocket($host, $port, $timeout) { return stream_socket_client("tcp://{$host}:{$port}", $error, $message, $timeout, STREAM_CLIENT_CONNECT | STREAM_CLIENT_PERSISTENT); }
php
protected function getSocket($host, $port, $timeout) { return stream_socket_client("tcp://{$host}:{$port}", $error, $message, $timeout, STREAM_CLIENT_CONNECT | STREAM_CLIENT_PERSISTENT); }
[ "protected", "function", "getSocket", "(", "$", "host", ",", "$", "port", ",", "$", "timeout", ")", "{", "return", "stream_socket_client", "(", "\"tcp://{$host}:{$port}\"", ",", "$", "error", ",", "$", "message", ",", "$", "timeout", ",", "STREAM_CLIENT_CONNEC...
Build actual socket @param string $host Host @param int $port Port @param float $timeout Timeout @return resource Socket
[ "Build", "actual", "socket" ]
56cf00d97e739fec861717484657dbef2888df60
https://github.com/mariano/disque-php/blob/56cf00d97e739fec861717484657dbef2888df60/src/Connection/Socket.php#L178-L181
228,701
mariano/disque-php
src/Connection/Socket.php
Socket.getType
private function getType($keepWaiting = false) { $type = null; while (!feof($this->socket)) { $type = fgetc($this->socket); if ($type !== false && $type !== '') { break; } $info = stream_get_meta_data($this->socket); if (!$...
php
private function getType($keepWaiting = false) { $type = null; while (!feof($this->socket)) { $type = fgetc($this->socket); if ($type !== false && $type !== '') { break; } $info = stream_get_meta_data($this->socket); if (!$...
[ "private", "function", "getType", "(", "$", "keepWaiting", "=", "false", ")", "{", "$", "type", "=", "null", ";", "while", "(", "!", "feof", "(", "$", "this", "->", "socket", ")", ")", "{", "$", "type", "=", "fgetc", "(", "$", "this", "->", "sock...
Get the first byte from Disque, which contains the data type @param bool $keepWaiting If `true`, timeouts on stream read will be ignored @return string A single char @throws ConnectionException
[ "Get", "the", "first", "byte", "from", "Disque", "which", "contains", "the", "data", "type" ]
56cf00d97e739fec861717484657dbef2888df60
https://github.com/mariano/disque-php/blob/56cf00d97e739fec861717484657dbef2888df60/src/Connection/Socket.php#L190-L210
228,702
mariano/disque-php
src/Connection/Socket.php
Socket.getData
private function getData() { $data = fgets($this->socket); if ($data === false || $data === '') { throw new ConnectionException('Nothing received while reading from client'); } return $data; }
php
private function getData() { $data = fgets($this->socket); if ($data === false || $data === '') { throw new ConnectionException('Nothing received while reading from client'); } return $data; }
[ "private", "function", "getData", "(", ")", "{", "$", "data", "=", "fgets", "(", "$", "this", "->", "socket", ")", ";", "if", "(", "$", "data", "===", "false", "||", "$", "data", "===", "''", ")", "{", "throw", "new", "ConnectionException", "(", "'...
Get a line of data @return string Line of data @throws ConnectionException
[ "Get", "a", "line", "of", "data" ]
56cf00d97e739fec861717484657dbef2888df60
https://github.com/mariano/disque-php/blob/56cf00d97e739fec861717484657dbef2888df60/src/Connection/Socket.php#L218-L225
228,703
czim/laravel-cms-upload-module
src/Http/Controllers/FileController.php
FileController.getCustomValidator
protected function getCustomValidator(UploadedFile $file, $rules) { if (null === $rules) { return null; } if ( ! is_array($rules)) { $rules = explode('|', $rules); } return Validator::make(['file' => $file], ['file' => $rules]); }
php
protected function getCustomValidator(UploadedFile $file, $rules) { if (null === $rules) { return null; } if ( ! is_array($rules)) { $rules = explode('|', $rules); } return Validator::make(['file' => $file], ['file' => $rules]); }
[ "protected", "function", "getCustomValidator", "(", "UploadedFile", "$", "file", ",", "$", "rules", ")", "{", "if", "(", "null", "===", "$", "rules", ")", "{", "return", "null", ";", "}", "if", "(", "!", "is_array", "(", "$", "rules", ")", ")", "{", ...
Gets a validator for the uploaded file with custom request-specified rules. @param UploadedFile $file @param array|string|null $rules @return \Illuminate\Validation\Validator|null
[ "Gets", "a", "validator", "for", "the", "uploaded", "file", "with", "custom", "request", "-", "specified", "rules", "." ]
3599801efcfdcf9164e8c75c3e1b2c6e7e3692c3
https://github.com/czim/laravel-cms-upload-module/blob/3599801efcfdcf9164e8c75c3e1b2c6e7e3692c3/src/Http/Controllers/FileController.php#L193-L204
228,704
czim/laravel-cms-upload-module
src/Http/Controllers/FileController.php
FileController.performGarbageCollection
protected function performGarbageCollection() { if ( ! config('cms-upload-module.gc.enabled', true)) { return; } list($probability, $total) = config('cms-upload-module.gc.lottery', [0, 0]); if ($probability < 1 || $total < 1 || rand(0, $total) > $probability) { ...
php
protected function performGarbageCollection() { if ( ! config('cms-upload-module.gc.enabled', true)) { return; } list($probability, $total) = config('cms-upload-module.gc.lottery', [0, 0]); if ($probability < 1 || $total < 1 || rand(0, $total) > $probability) { ...
[ "protected", "function", "performGarbageCollection", "(", ")", "{", "if", "(", "!", "config", "(", "'cms-upload-module.gc.enabled'", ",", "true", ")", ")", "{", "return", ";", "}", "list", "(", "$", "probability", ",", "$", "total", ")", "=", "config", "("...
Performs garbage collection based on lottery.
[ "Performs", "garbage", "collection", "based", "on", "lottery", "." ]
3599801efcfdcf9164e8c75c3e1b2c6e7e3692c3
https://github.com/czim/laravel-cms-upload-module/blob/3599801efcfdcf9164e8c75c3e1b2c6e7e3692c3/src/Http/Controllers/FileController.php#L209-L222
228,705
mariano/disque-php
src/Command/GetJob.php
GetJob.isBlocking
public function isBlocking() { $arguments = $this->getArguments(); $options = end($arguments); if (is_array($options) && !empty($options['nohang'])) { return false; } return true; }
php
public function isBlocking() { $arguments = $this->getArguments(); $options = end($arguments); if (is_array($options) && !empty($options['nohang'])) { return false; } return true; }
[ "public", "function", "isBlocking", "(", ")", "{", "$", "arguments", "=", "$", "this", "->", "getArguments", "(", ")", ";", "$", "options", "=", "end", "(", "$", "arguments", ")", ";", "if", "(", "is_array", "(", "$", "options", ")", "&&", "!", "em...
Tells if this command blocks while waiting for a response, to avoid being affected by connection timeouts. @return bool If true, this command blocks
[ "Tells", "if", "this", "command", "blocks", "while", "waiting", "for", "a", "response", "to", "avoid", "being", "affected", "by", "connection", "timeouts", "." ]
56cf00d97e739fec861717484657dbef2888df60
https://github.com/mariano/disque-php/blob/56cf00d97e739fec861717484657dbef2888df60/src/Command/GetJob.php#L60-L68
228,706
mariano/disque-php
src/Connection/Manager.php
Manager.findAvailableConnection
protected function findAvailableConnection() { $servers = $this->credentials; shuffle($servers); $previous = null; foreach ($servers as $server) { try { $node = $this->getNodeConnection($server); } catch (ConnectionException $e) { ...
php
protected function findAvailableConnection() { $servers = $this->credentials; shuffle($servers); $previous = null; foreach ($servers as $server) { try { $node = $this->getNodeConnection($server); } catch (ConnectionException $e) { ...
[ "protected", "function", "findAvailableConnection", "(", ")", "{", "$", "servers", "=", "$", "this", "->", "credentials", ";", "shuffle", "(", "$", "servers", ")", ";", "$", "previous", "=", "null", ";", "foreach", "(", "$", "servers", "as", "$", "server...
Get a functional connection to any known node Disque suggests the first connection should be chosen randomly We go through the user-supplied credentials randomly and try to connect. @return Node A connected node @throws ConnectionException
[ "Get", "a", "functional", "connection", "to", "any", "known", "node" ]
56cf00d97e739fec861717484657dbef2888df60
https://github.com/mariano/disque-php/blob/56cf00d97e739fec861717484657dbef2888df60/src/Connection/Manager.php#L212-L232
228,707
mariano/disque-php
src/Connection/Manager.php
Manager.getNodeConnection
protected function getNodeConnection(Credentials $server) { $node = $this->createNode($server); $node->connect(); return $node; }
php
protected function getNodeConnection(Credentials $server) { $node = $this->createNode($server); $node->connect(); return $node; }
[ "protected", "function", "getNodeConnection", "(", "Credentials", "$", "server", ")", "{", "$", "node", "=", "$", "this", "->", "createNode", "(", "$", "server", ")", ";", "$", "node", "->", "connect", "(", ")", ";", "return", "$", "node", ";", "}" ]
Connect to the node given in the credentials @param Credentials $server @return Node A connected node @throws ConnectionException @throws AuthenticationException
[ "Connect", "to", "the", "node", "given", "in", "the", "credentials" ]
56cf00d97e739fec861717484657dbef2888df60
https://github.com/mariano/disque-php/blob/56cf00d97e739fec861717484657dbef2888df60/src/Connection/Manager.php#L244-L249
228,708
mariano/disque-php
src/Connection/Manager.php
Manager.postprocessExecution
protected function postprocessExecution( CommandInterface $command, $response ) { if ($command instanceof GetJob) { $this->updateNodeStats($command->parse($response)); $this->switchNodeIfNeeded(); } return $response; }
php
protected function postprocessExecution( CommandInterface $command, $response ) { if ($command instanceof GetJob) { $this->updateNodeStats($command->parse($response)); $this->switchNodeIfNeeded(); } return $response; }
[ "protected", "function", "postprocessExecution", "(", "CommandInterface", "$", "command", ",", "$", "response", ")", "{", "if", "(", "$", "command", "instanceof", "GetJob", ")", "{", "$", "this", "->", "updateNodeStats", "(", "$", "command", "->", "parse", "...
Postprocess the command execution, eg. update node stats @param CommandInterface $command @param mixed $response @return mixed @throws ConnectionException
[ "Postprocess", "the", "command", "execution", "eg", ".", "update", "node", "stats" ]
56cf00d97e739fec861717484657dbef2888df60
https://github.com/mariano/disque-php/blob/56cf00d97e739fec861717484657dbef2888df60/src/Connection/Manager.php#L284-L294
228,709
mariano/disque-php
src/Connection/Manager.php
Manager.updateNodeStats
protected function updateNodeStats(array $jobs) { foreach ($jobs as $job) { $jobId = $job[JobsResponse::KEY_ID]; $nodeId = $this->getNodeIdFromJobId($jobId); if (!isset($nodeId) || !isset($this->nodes[$nodeId])) { continue; } $node...
php
protected function updateNodeStats(array $jobs) { foreach ($jobs as $job) { $jobId = $job[JobsResponse::KEY_ID]; $nodeId = $this->getNodeIdFromJobId($jobId); if (!isset($nodeId) || !isset($this->nodes[$nodeId])) { continue; } $node...
[ "protected", "function", "updateNodeStats", "(", "array", "$", "jobs", ")", "{", "foreach", "(", "$", "jobs", "as", "$", "job", ")", "{", "$", "jobId", "=", "$", "job", "[", "JobsResponse", "::", "KEY_ID", "]", ";", "$", "nodeId", "=", "$", "this", ...
Update node counters indicating how many jobs the node has produced @param array $jobs Jobs
[ "Update", "node", "counters", "indicating", "how", "many", "jobs", "the", "node", "has", "produced" ]
56cf00d97e739fec861717484657dbef2888df60
https://github.com/mariano/disque-php/blob/56cf00d97e739fec861717484657dbef2888df60/src/Connection/Manager.php#L301-L313
228,710
mariano/disque-php
src/Connection/Manager.php
Manager.switchNodeIfNeeded
private function switchNodeIfNeeded() { $sortedNodes = $this->priorityStrategy->sort( $this->nodes, $this->nodeId ); $previous = null; // Try to connect by priority, continue on error, return on success foreach($sortedNodes as $nodeCandidate) { ...
php
private function switchNodeIfNeeded() { $sortedNodes = $this->priorityStrategy->sort( $this->nodes, $this->nodeId ); $previous = null; // Try to connect by priority, continue on error, return on success foreach($sortedNodes as $nodeCandidate) { ...
[ "private", "function", "switchNodeIfNeeded", "(", ")", "{", "$", "sortedNodes", "=", "$", "this", "->", "priorityStrategy", "->", "sort", "(", "$", "this", "->", "nodes", ",", "$", "this", "->", "nodeId", ")", ";", "$", "previous", "=", "null", ";", "/...
Decide if we should switch to a better node @throws ConnectionException
[ "Decide", "if", "we", "should", "switch", "to", "a", "better", "node" ]
56cf00d97e739fec861717484657dbef2888df60
https://github.com/mariano/disque-php/blob/56cf00d97e739fec861717484657dbef2888df60/src/Connection/Manager.php#L320-L357
228,711
mariano/disque-php
src/Connection/Manager.php
Manager.getNodeIdFromJobId
private function getNodeIdFromJobId($jobId) { $nodePrefix = $this->getNodePrefixFromJobId($jobId); if ( isset($this->nodePrefixes[$nodePrefix]) && array_key_exists($this->nodePrefixes[$nodePrefix], $this->nodes) ) { return $this->nodePrefixes[$nodePrefix];...
php
private function getNodeIdFromJobId($jobId) { $nodePrefix = $this->getNodePrefixFromJobId($jobId); if ( isset($this->nodePrefixes[$nodePrefix]) && array_key_exists($this->nodePrefixes[$nodePrefix], $this->nodes) ) { return $this->nodePrefixes[$nodePrefix];...
[ "private", "function", "getNodeIdFromJobId", "(", "$", "jobId", ")", "{", "$", "nodePrefix", "=", "$", "this", "->", "getNodePrefixFromJobId", "(", "$", "jobId", ")", ";", "if", "(", "isset", "(", "$", "this", "->", "nodePrefixes", "[", "$", "nodePrefix", ...
Get a node ID based off a Job ID @param string $jobId Job ID @return string|null Node ID
[ "Get", "a", "node", "ID", "based", "off", "a", "Job", "ID" ]
56cf00d97e739fec861717484657dbef2888df60
https://github.com/mariano/disque-php/blob/56cf00d97e739fec861717484657dbef2888df60/src/Connection/Manager.php#L365-L376
228,712
mariano/disque-php
src/Connection/Manager.php
Manager.getNodePrefixFromJobId
private function getNodePrefixFromJobId($jobId) { $nodePrefix = substr( $jobId, JobsResponse::ID_NODE_PREFIX_START, Node::PREFIX_LENGTH ); return $nodePrefix; }
php
private function getNodePrefixFromJobId($jobId) { $nodePrefix = substr( $jobId, JobsResponse::ID_NODE_PREFIX_START, Node::PREFIX_LENGTH ); return $nodePrefix; }
[ "private", "function", "getNodePrefixFromJobId", "(", "$", "jobId", ")", "{", "$", "nodePrefix", "=", "substr", "(", "$", "jobId", ",", "JobsResponse", "::", "ID_NODE_PREFIX_START", ",", "Node", "::", "PREFIX_LENGTH", ")", ";", "return", "$", "nodePrefix", ";"...
Get the node prefix from the job ID @param string $jobId @return string Node prefix
[ "Get", "the", "node", "prefix", "from", "the", "job", "ID" ]
56cf00d97e739fec861717484657dbef2888df60
https://github.com/mariano/disque-php/blob/56cf00d97e739fec861717484657dbef2888df60/src/Connection/Manager.php#L384-L393
228,713
mariano/disque-php
src/Connection/Manager.php
Manager.shouldBeConnected
protected function shouldBeConnected() { // If we lost the connection, first let's try and reconnect if (!$this->isConnected()) { try { $this->switchNodeIfNeeded(); } catch (ConnectionException $e) { throw new ConnectionException('Not connected...
php
protected function shouldBeConnected() { // If we lost the connection, first let's try and reconnect if (!$this->isConnected()) { try { $this->switchNodeIfNeeded(); } catch (ConnectionException $e) { throw new ConnectionException('Not connected...
[ "protected", "function", "shouldBeConnected", "(", ")", "{", "// If we lost the connection, first let's try and reconnect", "if", "(", "!", "$", "this", "->", "isConnected", "(", ")", ")", "{", "try", "{", "$", "this", "->", "switchNodeIfNeeded", "(", ")", ";", ...
We should be connected @return void @throws ConnectionException
[ "We", "should", "be", "connected" ]
56cf00d97e739fec861717484657dbef2888df60
https://github.com/mariano/disque-php/blob/56cf00d97e739fec861717484657dbef2888df60/src/Connection/Manager.php#L401-L411
228,714
mariano/disque-php
src/Connection/Manager.php
Manager.createNode
private function createNode(Credentials $credentials) { $host = $credentials->getHost(); $port = $credentials->getPort(); $connection = $this->connectionFactory->create($host, $port); return new Node($credentials, $connection); }
php
private function createNode(Credentials $credentials) { $host = $credentials->getHost(); $port = $credentials->getPort(); $connection = $this->connectionFactory->create($host, $port); return new Node($credentials, $connection); }
[ "private", "function", "createNode", "(", "Credentials", "$", "credentials", ")", "{", "$", "host", "=", "$", "credentials", "->", "getHost", "(", ")", ";", "$", "port", "=", "$", "credentials", "->", "getPort", "(", ")", ";", "$", "connection", "=", "...
Create a new Node object @param Credentials $credentials @return Node An unconnected Node
[ "Create", "a", "new", "Node", "object" ]
56cf00d97e739fec861717484657dbef2888df60
https://github.com/mariano/disque-php/blob/56cf00d97e739fec861717484657dbef2888df60/src/Connection/Manager.php#L420-L427
228,715
mariano/disque-php
src/Connection/Manager.php
Manager.switchToNode
private function switchToNode(Node $node) { $nodeId = $node->getId(); // Return early if we're trying to switch to the current node. if (($this->nodeId === $nodeId)) { // But return early only if the current node is connected to Disque. // If it is disconnected, we wa...
php
private function switchToNode(Node $node) { $nodeId = $node->getId(); // Return early if we're trying to switch to the current node. if (($this->nodeId === $nodeId)) { // But return early only if the current node is connected to Disque. // If it is disconnected, we wa...
[ "private", "function", "switchToNode", "(", "Node", "$", "node", ")", "{", "$", "nodeId", "=", "$", "node", "->", "getId", "(", ")", ";", "// Return early if we're trying to switch to the current node.", "if", "(", "(", "$", "this", "->", "nodeId", "===", "$",...
Switch to the given node and map the cluster from its HELLO @param Node $node
[ "Switch", "to", "the", "given", "node", "and", "map", "the", "cluster", "from", "its", "HELLO" ]
56cf00d97e739fec861717484657dbef2888df60
https://github.com/mariano/disque-php/blob/56cf00d97e739fec861717484657dbef2888df60/src/Connection/Manager.php#L434-L455
228,716
mariano/disque-php
src/Connection/Manager.php
Manager.revealClusterFromHello
private function revealClusterFromHello(Node $node) { $hello = $node->getHello(); $revealedNodes = []; foreach ($hello[HelloResponse::NODES] as $node) { $id = $node[HelloResponse::NODE_ID]; $revealedNode = $this->revealNodeFromHello($id, $node); // Updat...
php
private function revealClusterFromHello(Node $node) { $hello = $node->getHello(); $revealedNodes = []; foreach ($hello[HelloResponse::NODES] as $node) { $id = $node[HelloResponse::NODE_ID]; $revealedNode = $this->revealNodeFromHello($id, $node); // Updat...
[ "private", "function", "revealClusterFromHello", "(", "Node", "$", "node", ")", "{", "$", "hello", "=", "$", "node", "->", "getHello", "(", ")", ";", "$", "revealedNodes", "=", "[", "]", ";", "foreach", "(", "$", "hello", "[", "HelloResponse", "::", "N...
Reveal the whole Disque cluster from a node HELLO response The HELLO response from a Disque node contains addresses of all other nodes in the cluster. We want to learn about them and save them, so that we can switch to them later, if needed. @param Node $node The current node
[ "Reveal", "the", "whole", "Disque", "cluster", "from", "a", "node", "HELLO", "response" ]
56cf00d97e739fec861717484657dbef2888df60
https://github.com/mariano/disque-php/blob/56cf00d97e739fec861717484657dbef2888df60/src/Connection/Manager.php#L466-L483
228,717
mariano/disque-php
src/Connection/Manager.php
Manager.revealNodeFromHello
private function revealNodeFromHello($nodeId, array $node) { /** * Add the node prefix to the pool. We create the prefix manually * from the node ID rather than asking the Node object. Newly created * Nodes aren't connected and thus don't know their ID or prefix. * ...
php
private function revealNodeFromHello($nodeId, array $node) { /** * Add the node prefix to the pool. We create the prefix manually * from the node ID rather than asking the Node object. Newly created * Nodes aren't connected and thus don't know their ID or prefix. * ...
[ "private", "function", "revealNodeFromHello", "(", "$", "nodeId", ",", "array", "$", "node", ")", "{", "/**\n * Add the node prefix to the pool. We create the prefix manually\n * from the node ID rather than asking the Node object. Newly created\n * Nodes aren't conne...
Reveal a single node from a HELLO response, or use an existing node @param string $nodeId The node ID @param array $node Node information as returned by the HELLO command @return Node $node A node in the current cluster
[ "Reveal", "a", "single", "node", "from", "a", "HELLO", "response", "or", "use", "an", "existing", "node" ]
56cf00d97e739fec861717484657dbef2888df60
https://github.com/mariano/disque-php/blob/56cf00d97e739fec861717484657dbef2888df60/src/Connection/Manager.php#L493-L524
228,718
mariano/disque-php
src/Connection/Manager.php
Manager.copyNodeStats
private function copyNodeStats(Node $oldNode, Node $newNode) { $oldNodeJobCount = $oldNode->getTotalJobCount(); $newNode->addJobCount($oldNodeJobCount); }
php
private function copyNodeStats(Node $oldNode, Node $newNode) { $oldNodeJobCount = $oldNode->getTotalJobCount(); $newNode->addJobCount($oldNodeJobCount); }
[ "private", "function", "copyNodeStats", "(", "Node", "$", "oldNode", ",", "Node", "$", "newNode", ")", "{", "$", "oldNodeJobCount", "=", "$", "oldNode", "->", "getTotalJobCount", "(", ")", ";", "$", "newNode", "->", "addJobCount", "(", "$", "oldNodeJobCount"...
Copy node stats from the old to the new node @param Node $oldNode @param Node $newNode
[ "Copy", "node", "stats", "from", "the", "old", "to", "the", "new", "node" ]
56cf00d97e739fec861717484657dbef2888df60
https://github.com/mariano/disque-php/blob/56cf00d97e739fec861717484657dbef2888df60/src/Connection/Manager.php#L542-L546
228,719
stanislav-web/phalcon-sms-factory
src/SMSFactory/Providers/SmsUkraine.php
SmsUkraine.send
final public function send($message) { $response = $this->client()->{$this->config->getRequestMethod()}($this->config->getMessageUri(), array_merge( $this->config->getProviderConfig(), [ 'command' => 'send', 'to' => $this->recipient, ...
php
final public function send($message) { $response = $this->client()->{$this->config->getRequestMethod()}($this->config->getMessageUri(), array_merge( $this->config->getProviderConfig(), [ 'command' => 'send', 'to' => $this->recipient, ...
[ "final", "public", "function", "send", "(", "$", "message", ")", "{", "$", "response", "=", "$", "this", "->", "client", "(", ")", "->", "{", "$", "this", "->", "config", "->", "getRequestMethod", "(", ")", "}", "(", "$", "this", "->", "config", "-...
Final send function @param string $message @return \Phalcon\Http\Client\Response|string
[ "Final", "send", "function" ]
75e5b61819ae24705e87073508f99341b64da2cd
https://github.com/stanislav-web/phalcon-sms-factory/blob/75e5b61819ae24705e87073508f99341b64da2cd/src/SMSFactory/Providers/SmsUkraine.php#L95-L107
228,720
jeremeamia/FunctionParser
src/FunctionParser.php
FunctionParser.fromCallable
public static function fromCallable($callable) { if (!is_callable($callable)) { throw new \InvalidArgumentException('You must provide a vaild PHP callable.'); } elseif (is_string($callable) && strpos($callable, '::') > 0) { $callable = explode('::', $c...
php
public static function fromCallable($callable) { if (!is_callable($callable)) { throw new \InvalidArgumentException('You must provide a vaild PHP callable.'); } elseif (is_string($callable) && strpos($callable, '::') > 0) { $callable = explode('::', $c...
[ "public", "static", "function", "fromCallable", "(", "$", "callable", ")", "{", "if", "(", "!", "is_callable", "(", "$", "callable", ")", ")", "{", "throw", "new", "\\", "InvalidArgumentException", "(", "'You must provide a vaild PHP callable.'", ")", ";", "}", ...
A factory method that creates a FunctionParser from any PHP callable. @param mixed $callable A PHP callable to be parsed. @return FunctionParser An instance of FunctionParser. @throws \InvalidArgumentException
[ "A", "factory", "method", "that", "creates", "a", "FunctionParser", "from", "any", "PHP", "callable", "." ]
035b52000b88ea8d72a6647dd4cd39f080cf7ada
https://github.com/jeremeamia/FunctionParser/blob/035b52000b88ea8d72a6647dd4cd39f080cf7ada/src/FunctionParser.php#L55-L77
228,721
jeremeamia/FunctionParser
src/FunctionParser.php
FunctionParser.getName
public function getName() { $name = $this->reflection->getName(); if (strpos($name, '{closure}') !== false) { return null; } return $name; }
php
public function getName() { $name = $this->reflection->getName(); if (strpos($name, '{closure}') !== false) { return null; } return $name; }
[ "public", "function", "getName", "(", ")", "{", "$", "name", "=", "$", "this", "->", "reflection", "->", "getName", "(", ")", ";", "if", "(", "strpos", "(", "$", "name", ",", "'{closure}'", ")", "!==", "false", ")", "{", "return", "null", ";", "}",...
Returns the name of the function, if there is one. @return null|string The name of the function.
[ "Returns", "the", "name", "of", "the", "function", "if", "there", "is", "one", "." ]
035b52000b88ea8d72a6647dd4cd39f080cf7ada
https://github.com/jeremeamia/FunctionParser/blob/035b52000b88ea8d72a6647dd4cd39f080cf7ada/src/FunctionParser.php#L114-L124
228,722
jeremeamia/FunctionParser
src/FunctionParser.php
FunctionParser.fetchTokenizer
protected function fetchTokenizer() { // Load the file containing the code for the function $file = new \SplFileObject($this->reflection->getFileName()); // Identify the first and last lines of the code for the function $first_line = $this->reflection->getStartLine(); $last_...
php
protected function fetchTokenizer() { // Load the file containing the code for the function $file = new \SplFileObject($this->reflection->getFileName()); // Identify the first and last lines of the code for the function $first_line = $this->reflection->getStartLine(); $last_...
[ "protected", "function", "fetchTokenizer", "(", ")", "{", "// Load the file containing the code for the function", "$", "file", "=", "new", "\\", "SplFileObject", "(", "$", "this", "->", "reflection", "->", "getFileName", "(", ")", ")", ";", "// Identify the first and...
Creates a tokenizer representing the code that is the best candidate for representing the function. It uses reflection to find the file and lines of the code and then puts that code into the tokenizer. @return \FunctionParser\Tokenizer The tokenizer of the function's code.
[ "Creates", "a", "tokenizer", "representing", "the", "code", "that", "is", "the", "best", "candidate", "for", "representing", "the", "function", ".", "It", "uses", "reflection", "to", "find", "the", "file", "and", "lines", "of", "the", "code", "and", "then", ...
035b52000b88ea8d72a6647dd4cd39f080cf7ada
https://github.com/jeremeamia/FunctionParser/blob/035b52000b88ea8d72a6647dd4cd39f080cf7ada/src/FunctionParser.php#L215-L242
228,723
jeremeamia/FunctionParser
src/FunctionParser.php
FunctionParser.parseCode
protected function parseCode() { $brace_level = 0; $parsed_code = ''; $parsing_complete = false; // Parse the code looking for the end of the function /** @var $token \FunctionParser\Token */ foreach ($this->tokenizer as $token) { /*****...
php
protected function parseCode() { $brace_level = 0; $parsed_code = ''; $parsing_complete = false; // Parse the code looking for the end of the function /** @var $token \FunctionParser\Token */ foreach ($this->tokenizer as $token) { /*****...
[ "protected", "function", "parseCode", "(", ")", "{", "$", "brace_level", "=", "0", ";", "$", "parsed_code", "=", "''", ";", "$", "parsing_complete", "=", "false", ";", "// Parse the code looking for the end of the function", "/** @var $token \\FunctionParser\\Token */", ...
Parses the code using the tokenizer and keeping track of matching braces. @return string The code representing the function. @throws \RuntimeException on invalid code.
[ "Parses", "the", "code", "using", "the", "tokenizer", "and", "keeping", "track", "of", "matching", "braces", "." ]
035b52000b88ea8d72a6647dd4cd39f080cf7ada
https://github.com/jeremeamia/FunctionParser/blob/035b52000b88ea8d72a6647dd4cd39f080cf7ada/src/FunctionParser.php#L250-L319
228,724
jeremeamia/FunctionParser
src/FunctionParser.php
FunctionParser.parseBody
protected function parseBody() { // Remove the function signature and outer braces $start = strpos($this->code, '{'); $finish = strrpos($this->code, '}'); $body = ltrim(rtrim(substr($this->code, $start + 1, $finish - $start - 1)), "\n"); return $body; }
php
protected function parseBody() { // Remove the function signature and outer braces $start = strpos($this->code, '{'); $finish = strrpos($this->code, '}'); $body = ltrim(rtrim(substr($this->code, $start + 1, $finish - $start - 1)), "\n"); return $body; }
[ "protected", "function", "parseBody", "(", ")", "{", "// Remove the function signature and outer braces", "$", "start", "=", "strpos", "(", "$", "this", "->", "code", ",", "'{'", ")", ";", "$", "finish", "=", "strrpos", "(", "$", "this", "->", "code", ",", ...
Removes the function signature and braces to expose only the procedural body of the function. @return string The body of the function.
[ "Removes", "the", "function", "signature", "and", "braces", "to", "expose", "only", "the", "procedural", "body", "of", "the", "function", "." ]
035b52000b88ea8d72a6647dd4cd39f080cf7ada
https://github.com/jeremeamia/FunctionParser/blob/035b52000b88ea8d72a6647dd4cd39f080cf7ada/src/FunctionParser.php#L326-L334
228,725
sokil/php-fraud-detect
src/Detector.php
Detector.check
public function check() { $this->state = self::STATE_UNCHECKED; // check all conditions /* @var $processor \Sokil\FraudDetector\ProcessorInterface */ foreach($this->processorDeclarationList->getKeys() as $processorName) { $processor = $this->getProcessor($process...
php
public function check() { $this->state = self::STATE_UNCHECKED; // check all conditions /* @var $processor \Sokil\FraudDetector\ProcessorInterface */ foreach($this->processorDeclarationList->getKeys() as $processorName) { $processor = $this->getProcessor($process...
[ "public", "function", "check", "(", ")", "{", "$", "this", "->", "state", "=", "self", "::", "STATE_UNCHECKED", ";", "// check all conditions", "/* @var $processor \\Sokil\\FraudDetector\\ProcessorInterface */", "foreach", "(", "$", "this", "->", "processorDeclarationList...
Check if request is not fraud
[ "Check", "if", "request", "is", "not", "fraud" ]
b92f99fff7432febb813a9162748fa3b299c8474
https://github.com/sokil/php-fraud-detect/blob/b92f99fff7432febb813a9162748fa3b299c8474/src/Detector.php#L79-L105
228,726
sokil/php-fraud-detect
src/Detector.php
Detector.declareProcessor
public function declareProcessor($name, $callable = null, $priority = 0) { $this->processorDeclarationList->set($name, $callable, $priority); return $this; }
php
public function declareProcessor($name, $callable = null, $priority = 0) { $this->processorDeclarationList->set($name, $callable, $priority); return $this; }
[ "public", "function", "declareProcessor", "(", "$", "name", ",", "$", "callable", "=", "null", ",", "$", "priority", "=", "0", ")", "{", "$", "this", "->", "processorDeclarationList", "->", "set", "(", "$", "name", ",", "$", "callable", ",", "$", "prio...
Add processor identified by its name. If processor already added, it will be replaced by new instance. @param string $name name of processor @param callable $callable configurator callable @return \Sokil\FraudDetector\Detector
[ "Add", "processor", "identified", "by", "its", "name", ".", "If", "processor", "already", "added", "it", "will", "be", "replaced", "by", "new", "instance", "." ]
b92f99fff7432febb813a9162748fa3b299c8474
https://github.com/sokil/php-fraud-detect/blob/b92f99fff7432febb813a9162748fa3b299c8474/src/Detector.php#L121-L125
228,727
sokil/php-fraud-detect
src/Detector.php
Detector.getProcessorClassName
private function getProcessorClassName($name) { $className = ucfirst($name) . 'Processor'; foreach($this->processorNamespaces as $namespace) { $fullyQualifiedClassName = $namespace . '\\' . $className; if(class_exists($fullyQualifiedClassName)) { return $full...
php
private function getProcessorClassName($name) { $className = ucfirst($name) . 'Processor'; foreach($this->processorNamespaces as $namespace) { $fullyQualifiedClassName = $namespace . '\\' . $className; if(class_exists($fullyQualifiedClassName)) { return $full...
[ "private", "function", "getProcessorClassName", "(", "$", "name", ")", "{", "$", "className", "=", "ucfirst", "(", "$", "name", ")", ".", "'Processor'", ";", "foreach", "(", "$", "this", "->", "processorNamespaces", "as", "$", "namespace", ")", "{", "$", ...
Factory method to create new check condition @param string $name name of check condition @return \Sokil\FraudDetector\ProcessorInterface @throws \Exception
[ "Factory", "method", "to", "create", "new", "check", "condition" ]
b92f99fff7432febb813a9162748fa3b299c8474
https://github.com/sokil/php-fraud-detect/blob/b92f99fff7432febb813a9162748fa3b299c8474/src/Detector.php#L147-L159
228,728
sop/crypto-types
lib/CryptoTypes/Asymmetric/EC/ECConversion.php
ECConversion.bitStringToOctetString
public static function bitStringToOctetString(BitString $bs): OctetString { $str = $bs->string(); if ($bs->unusedBits()) { // @todo pad string throw new \RuntimeException("Unaligned bitstrings to supported"); } return new OctetString($str); }
php
public static function bitStringToOctetString(BitString $bs): OctetString { $str = $bs->string(); if ($bs->unusedBits()) { // @todo pad string throw new \RuntimeException("Unaligned bitstrings to supported"); } return new OctetString($str); }
[ "public", "static", "function", "bitStringToOctetString", "(", "BitString", "$", "bs", ")", ":", "OctetString", "{", "$", "str", "=", "$", "bs", "->", "string", "(", ")", ";", "if", "(", "$", "bs", "->", "unusedBits", "(", ")", ")", "{", "// @todo pad ...
Perform Bit-String-to-Octet-String Conversion. Defined in SEC 1 section 2.3.1. @param BitString $bs @throws \RuntimeException @return OctetString
[ "Perform", "Bit", "-", "String", "-", "to", "-", "Octet", "-", "String", "Conversion", "." ]
1d36250a110b07300aeb003a20aeaadfc6445501
https://github.com/sop/crypto-types/blob/1d36250a110b07300aeb003a20aeaadfc6445501/lib/CryptoTypes/Asymmetric/EC/ECConversion.php#L27-L35
228,729
sop/crypto-types
lib/CryptoTypes/Asymmetric/EC/ECConversion.php
ECConversion.integerToOctetString
public static function integerToOctetString(Integer $num, $mlen = null): OctetString { $gmp = gmp_init($num->number(), 10); $str = gmp_export($gmp, 1, GMP_MSW_FIRST | GMP_BIG_ENDIAN); if (null !== $mlen) { $len = strlen($str); if ($len > $mlen) { throw...
php
public static function integerToOctetString(Integer $num, $mlen = null): OctetString { $gmp = gmp_init($num->number(), 10); $str = gmp_export($gmp, 1, GMP_MSW_FIRST | GMP_BIG_ENDIAN); if (null !== $mlen) { $len = strlen($str); if ($len > $mlen) { throw...
[ "public", "static", "function", "integerToOctetString", "(", "Integer", "$", "num", ",", "$", "mlen", "=", "null", ")", ":", "OctetString", "{", "$", "gmp", "=", "gmp_init", "(", "$", "num", "->", "number", "(", ")", ",", "10", ")", ";", "$", "str", ...
Perform Integer-to-Octet-String Conversion. Defined in SEC 1 section 2.3.7. @param Integer $num @param int|null $mlen Optional desired output length @throws \UnexpectedValueException @return OctetString
[ "Perform", "Integer", "-", "to", "-", "Octet", "-", "String", "Conversion", "." ]
1d36250a110b07300aeb003a20aeaadfc6445501
https://github.com/sop/crypto-types/blob/1d36250a110b07300aeb003a20aeaadfc6445501/lib/CryptoTypes/Asymmetric/EC/ECConversion.php#L60-L75
228,730
sop/crypto-types
lib/CryptoTypes/Asymmetric/EC/ECConversion.php
ECConversion.octetStringToInteger
public static function octetStringToInteger(OctetString $os): Integer { $num = gmp_import($os->string(), 1, GMP_MSW_FIRST | GMP_BIG_ENDIAN); return new Integer(gmp_strval($num, 10)); }
php
public static function octetStringToInteger(OctetString $os): Integer { $num = gmp_import($os->string(), 1, GMP_MSW_FIRST | GMP_BIG_ENDIAN); return new Integer(gmp_strval($num, 10)); }
[ "public", "static", "function", "octetStringToInteger", "(", "OctetString", "$", "os", ")", ":", "Integer", "{", "$", "num", "=", "gmp_import", "(", "$", "os", "->", "string", "(", ")", ",", "1", ",", "GMP_MSW_FIRST", "|", "GMP_BIG_ENDIAN", ")", ";", "re...
Perform Octet-String-to-Integer Conversion. Defined in SEC 1 section 2.3.8. @param OctetString $os @return Integer
[ "Perform", "Octet", "-", "String", "-", "to", "-", "Integer", "Conversion", "." ]
1d36250a110b07300aeb003a20aeaadfc6445501
https://github.com/sop/crypto-types/blob/1d36250a110b07300aeb003a20aeaadfc6445501/lib/CryptoTypes/Asymmetric/EC/ECConversion.php#L85-L89
228,731
sop/crypto-types
lib/CryptoTypes/Asymmetric/EC/ECConversion.php
ECConversion.numberToOctets
public static function numberToOctets($num, $mlen = null): string { return self::integerToOctetString(new Integer($num), $mlen)->string(); }
php
public static function numberToOctets($num, $mlen = null): string { return self::integerToOctetString(new Integer($num), $mlen)->string(); }
[ "public", "static", "function", "numberToOctets", "(", "$", "num", ",", "$", "mlen", "=", "null", ")", ":", "string", "{", "return", "self", "::", "integerToOctetString", "(", "new", "Integer", "(", "$", "num", ")", ",", "$", "mlen", ")", "->", "string...
Convert a base-10 number to octets. This is a convenicence method for integer <-> octet string conversion without the need for external ASN.1 dependencies. @param int|string $num Number in base-10 @param int|null $mlen Optional desired output length @return string
[ "Convert", "a", "base", "-", "10", "number", "to", "octets", "." ]
1d36250a110b07300aeb003a20aeaadfc6445501
https://github.com/sop/crypto-types/blob/1d36250a110b07300aeb003a20aeaadfc6445501/lib/CryptoTypes/Asymmetric/EC/ECConversion.php#L101-L104
228,732
sudocode/ohmy-auth
src/ohmy/Auth/Promise.php
Promise._resolve
public function _resolve($value) { if ($this->state === self::PENDING) { $this->value = $value; for ($i = 0; $i < count($this->success_pending); $i++) { $callback = $this->success_pending[$i]; $callback($value); } $this->state = sel...
php
public function _resolve($value) { if ($this->state === self::PENDING) { $this->value = $value; for ($i = 0; $i < count($this->success_pending); $i++) { $callback = $this->success_pending[$i]; $callback($value); } $this->state = sel...
[ "public", "function", "_resolve", "(", "$", "value", ")", "{", "if", "(", "$", "this", "->", "state", "===", "self", "::", "PENDING", ")", "{", "$", "this", "->", "value", "=", "$", "value", ";", "for", "(", "$", "i", "=", "0", ";", "$", "i", ...
Dispatch queued callbacks. Also sets state to RESOLVED. @param $value
[ "Dispatch", "queued", "callbacks", ".", "Also", "sets", "state", "to", "RESOLVED", "." ]
8536acc01fef30737e2a66af1a3d037d5fb5c6ad
https://github.com/sudocode/ohmy-auth/blob/8536acc01fef30737e2a66af1a3d037d5fb5c6ad/src/ohmy/Auth/Promise.php#L35-L44
228,733
sudocode/ohmy-auth
src/ohmy/Auth/Promise.php
Promise._reject
public function _reject($value) { if ($this->state === self::PENDING) { $this->value = $value; for ($i = 0; $i < count($this->failure_pending); $i++) { $callback = $this->failure_pending[$i]; $callback($value); } $this->state = self...
php
public function _reject($value) { if ($this->state === self::PENDING) { $this->value = $value; for ($i = 0; $i < count($this->failure_pending); $i++) { $callback = $this->failure_pending[$i]; $callback($value); } $this->state = self...
[ "public", "function", "_reject", "(", "$", "value", ")", "{", "if", "(", "$", "this", "->", "state", "===", "self", "::", "PENDING", ")", "{", "$", "this", "->", "value", "=", "$", "value", ";", "for", "(", "$", "i", "=", "0", ";", "$", "i", ...
Dispatch queued callbacks. Also sets state to REJECTED. @param $value
[ "Dispatch", "queued", "callbacks", ".", "Also", "sets", "state", "to", "REJECTED", "." ]
8536acc01fef30737e2a66af1a3d037d5fb5c6ad
https://github.com/sudocode/ohmy-auth/blob/8536acc01fef30737e2a66af1a3d037d5fb5c6ad/src/ohmy/Auth/Promise.php#L73-L82
228,734
sudocode/ohmy-auth
src/ohmy/Auth/Promise.php
Promise._catch
private function _catch($callback) { if ($this->state === self::REJECTED) { $this->value = $callback($this->value); } return $this; }
php
private function _catch($callback) { if ($this->state === self::REJECTED) { $this->value = $callback($this->value); } return $this; }
[ "private", "function", "_catch", "(", "$", "callback", ")", "{", "if", "(", "$", "this", "->", "state", "===", "self", "::", "REJECTED", ")", "{", "$", "this", "->", "value", "=", "$", "callback", "(", "$", "this", "->", "value", ")", ";", "}", "...
Execute a callback if the promise has been rejected. @param $callback @return $this
[ "Execute", "a", "callback", "if", "the", "promise", "has", "been", "rejected", "." ]
8536acc01fef30737e2a66af1a3d037d5fb5c6ad
https://github.com/sudocode/ohmy-auth/blob/8536acc01fef30737e2a66af1a3d037d5fb5c6ad/src/ohmy/Auth/Promise.php#L119-L124
228,735
sudocode/ohmy-auth
src/ohmy/Auth/Promise.php
Promise._finally
private function _finally($callback) { if ($this->state !== self::PENDING) { $callback($this->value); } return $this; }
php
private function _finally($callback) { if ($this->state !== self::PENDING) { $callback($this->value); } return $this; }
[ "private", "function", "_finally", "(", "$", "callback", ")", "{", "if", "(", "$", "this", "->", "state", "!==", "self", "::", "PENDING", ")", "{", "$", "callback", "(", "$", "this", "->", "value", ")", ";", "}", "return", "$", "this", ";", "}" ]
Execute a callback without changing value of promise. @param $callback @return $this
[ "Execute", "a", "callback", "without", "changing", "value", "of", "promise", "." ]
8536acc01fef30737e2a66af1a3d037d5fb5c6ad
https://github.com/sudocode/ohmy-auth/blob/8536acc01fef30737e2a66af1a3d037d5fb5c6ad/src/ohmy/Auth/Promise.php#L131-L136
228,736
contao-bootstrap/templates
src/View/FormRenderer.php
FormRenderer.render
public function render(string $templatePrefix, array $data): string { $formLayout = $this->layoutManager->getDefaultLayout(); if ($formLayout instanceof HorizontalFormLayout) { $templateName = $templatePrefix . '_horizontal'; } else { $templateName = $templatePrefix ...
php
public function render(string $templatePrefix, array $data): string { $formLayout = $this->layoutManager->getDefaultLayout(); if ($formLayout instanceof HorizontalFormLayout) { $templateName = $templatePrefix . '_horizontal'; } else { $templateName = $templatePrefix ...
[ "public", "function", "render", "(", "string", "$", "templatePrefix", ",", "array", "$", "data", ")", ":", "string", "{", "$", "formLayout", "=", "$", "this", "->", "layoutManager", "->", "getDefaultLayout", "(", ")", ";", "if", "(", "$", "formLayout", "...
Generate the form view. @param string $templatePrefix The template prefix which gets an _horizontal or _default suffix. @param array $data Template data being used in the new template. @return string
[ "Generate", "the", "form", "view", "." ]
cf507af3a194895923c6b84d97aa224e8b5b6d2f
https://github.com/contao-bootstrap/templates/blob/cf507af3a194895923c6b84d97aa224e8b5b6d2f/src/View/FormRenderer.php#L63-L78
228,737
contao-bootstrap/templates
src/View/FormRenderer.php
FormRenderer.prepare
public function prepare(Template $template): void { $formLayout = $this->layoutManager->getDefaultLayout(); if ($formLayout instanceof HorizontalFormLayout) { $template->labelColClass = $formLayout->getLabelColumnClass(); $template->colClass = $formLayout->getColumnCl...
php
public function prepare(Template $template): void { $formLayout = $this->layoutManager->getDefaultLayout(); if ($formLayout instanceof HorizontalFormLayout) { $template->labelColClass = $formLayout->getLabelColumnClass(); $template->colClass = $formLayout->getColumnCl...
[ "public", "function", "prepare", "(", "Template", "$", "template", ")", ":", "void", "{", "$", "formLayout", "=", "$", "this", "->", "layoutManager", "->", "getDefaultLayout", "(", ")", ";", "if", "(", "$", "formLayout", "instanceof", "HorizontalFormLayout", ...
Prepare the template by adding grid related classes. @param Template $template The template. @return void
[ "Prepare", "the", "template", "by", "adding", "grid", "related", "classes", "." ]
cf507af3a194895923c6b84d97aa224e8b5b6d2f
https://github.com/contao-bootstrap/templates/blob/cf507af3a194895923c6b84d97aa224e8b5b6d2f/src/View/FormRenderer.php#L87-L107
228,738
coolcsn/CsnCms
src/CsnCms/View/Helper/Vote.php
Vote.hasUserVoted
protected function hasUserVoted($vote) { $dql = "SELECT count(v.id) FROM CsnCms\Entity\Vote v LEFT JOIN v.usersVoted u WHERE v.id = ?0 AND u.id =?1"; $query = $this->entityManager->createQuery($dql); $voteId = $vote->getId(); $user = $this->getView()->identity(); $hasUserVoted ...
php
protected function hasUserVoted($vote) { $dql = "SELECT count(v.id) FROM CsnCms\Entity\Vote v LEFT JOIN v.usersVoted u WHERE v.id = ?0 AND u.id =?1"; $query = $this->entityManager->createQuery($dql); $voteId = $vote->getId(); $user = $this->getView()->identity(); $hasUserVoted ...
[ "protected", "function", "hasUserVoted", "(", "$", "vote", ")", "{", "$", "dql", "=", "\"SELECT count(v.id) FROM CsnCms\\Entity\\Vote v LEFT JOIN v.usersVoted u WHERE v.id = ?0 AND u.id =?1\"", ";", "$", "query", "=", "$", "this", "->", "entityManager", "->", "createQuery",...
Checks if the current user has already voted for the entity @param \CsnCms\Entity\Vote $vote @return integer 1 if voted, 0 if not, -1 if is not allowed to vote.
[ "Checks", "if", "the", "current", "user", "has", "already", "voted", "for", "the", "entity" ]
fd2b163e292836b9f672400694a86f75225b725a
https://github.com/coolcsn/CsnCms/blob/fd2b163e292836b9f672400694a86f75225b725a/src/CsnCms/View/Helper/Vote.php#L67-L84
228,739
silverstripe/silverstripe-mimevalidator
src/MimeUploadValidator.php
MimeUploadValidator.isValidMime
public function isValidMime() { $extension = strtolower(pathinfo($this->tmpFile['name'], PATHINFO_EXTENSION)); // we can't check filenames without an extension or no temp file path, let them pass validation. if (!$extension || !$this->tmpFile['tmp_name']) { return true; ...
php
public function isValidMime() { $extension = strtolower(pathinfo($this->tmpFile['name'], PATHINFO_EXTENSION)); // we can't check filenames without an extension or no temp file path, let them pass validation. if (!$extension || !$this->tmpFile['tmp_name']) { return true; ...
[ "public", "function", "isValidMime", "(", ")", "{", "$", "extension", "=", "strtolower", "(", "pathinfo", "(", "$", "this", "->", "tmpFile", "[", "'name'", "]", ",", "PATHINFO_EXTENSION", ")", ")", ";", "// we can't check filenames without an extension or no temp fi...
Check if the temporary file has a valid MIME type for it's extension. @uses finfo php extension @return bool|null @throws MimeUploadValidatorException
[ "Check", "if", "the", "temporary", "file", "has", "a", "valid", "MIME", "type", "for", "it", "s", "extension", "." ]
12c28214d591e38ad136b27618e042e0d6f55057
https://github.com/silverstripe/silverstripe-mimevalidator/blob/12c28214d591e38ad136b27618e042e0d6f55057/src/MimeUploadValidator.php#L52-L83
228,740
silverstripe/silverstripe-mimevalidator
src/MimeUploadValidator.php
MimeUploadValidator.getExpectedMimeTypes
public function getExpectedMimeTypes($file) { $extension = strtolower(pathinfo($file['name'], PATHINFO_EXTENSION)); // if the finfo php extension isn't loaded, we can't complete this check. if (!class_exists('finfo')) { throw new MimeUploadValidatorException('PHP extension finfo...
php
public function getExpectedMimeTypes($file) { $extension = strtolower(pathinfo($file['name'], PATHINFO_EXTENSION)); // if the finfo php extension isn't loaded, we can't complete this check. if (!class_exists('finfo')) { throw new MimeUploadValidatorException('PHP extension finfo...
[ "public", "function", "getExpectedMimeTypes", "(", "$", "file", ")", "{", "$", "extension", "=", "strtolower", "(", "pathinfo", "(", "$", "file", "[", "'name'", "]", ",", "PATHINFO_EXTENSION", ")", ")", ";", "// if the finfo php extension isn't loaded, we can't comp...
Fetches an array of valid mimetypes. @param $file @return array @throws MimeUploadValidatorException
[ "Fetches", "an", "array", "of", "valid", "mimetypes", "." ]
12c28214d591e38ad136b27618e042e0d6f55057
https://github.com/silverstripe/silverstripe-mimevalidator/blob/12c28214d591e38ad136b27618e042e0d6f55057/src/MimeUploadValidator.php#L92-L123
228,741
silverstripe/silverstripe-mimevalidator
src/MimeUploadValidator.php
MimeUploadValidator.compareMime
public function compareMime($first, $second) { return preg_replace($this->filterPattern, '', $first) === preg_replace($this->filterPattern, '', $second); }
php
public function compareMime($first, $second) { return preg_replace($this->filterPattern, '', $first) === preg_replace($this->filterPattern, '', $second); }
[ "public", "function", "compareMime", "(", "$", "first", ",", "$", "second", ")", "{", "return", "preg_replace", "(", "$", "this", "->", "filterPattern", ",", "''", ",", "$", "first", ")", "===", "preg_replace", "(", "$", "this", "->", "filterPattern", ",...
Check two MIME types roughly match eachother. Before we check MIME types, remove known prefixes "vnd.", "x-" etc. If there is a suffix, we'll use that to compare. Examples: application/x-json = json application/json = json application/xhtml+xml = xml application/xml = xml @param string $first The first MIME type to ...
[ "Check", "two", "MIME", "types", "roughly", "match", "eachother", "." ]
12c28214d591e38ad136b27618e042e0d6f55057
https://github.com/silverstripe/silverstripe-mimevalidator/blob/12c28214d591e38ad136b27618e042e0d6f55057/src/MimeUploadValidator.php#L140-L143
228,742
mlaphp/mlaphp
src/Mlaphp/Response.php
Response.getViewPath
public function getViewPath() { if (! $this->base) { return $this->view; } return rtrim($this->base, DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR . ltrim($this->view, DIRECTORY_SEPARATOR); }
php
public function getViewPath() { if (! $this->base) { return $this->view; } return rtrim($this->base, DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR . ltrim($this->view, DIRECTORY_SEPARATOR); }
[ "public", "function", "getViewPath", "(", ")", "{", "if", "(", "!", "$", "this", "->", "base", ")", "{", "return", "$", "this", "->", "view", ";", "}", "return", "rtrim", "(", "$", "this", "->", "base", ",", "DIRECTORY_SEPARATOR", ")", ".", "DIRECTOR...
Returns the full path to the view. @return string
[ "Returns", "the", "full", "path", "to", "the", "view", "." ]
c0c90e7217c598c82bb65e5304e8076da381c1f8
https://github.com/mlaphp/mlaphp/blob/c0c90e7217c598c82bb65e5304e8076da381c1f8/src/Mlaphp/Response.php#L110-L119
228,743
mlaphp/mlaphp
src/Mlaphp/Response.php
Response.requireView
public function requireView() { if (! $this->view) { return ''; } extract($this->vars); ob_start(); require $this->getViewPath(); return ob_get_clean(); }
php
public function requireView() { if (! $this->view) { return ''; } extract($this->vars); ob_start(); require $this->getViewPath(); return ob_get_clean(); }
[ "public", "function", "requireView", "(", ")", "{", "if", "(", "!", "$", "this", "->", "view", ")", "{", "return", "''", ";", "}", "extract", "(", "$", "this", "->", "vars", ")", ";", "ob_start", "(", ")", ";", "require", "$", "this", "->", "getV...
Requires the view in its own scope with etracted variables and returns the buffered output. @return string
[ "Requires", "the", "view", "in", "its", "own", "scope", "with", "etracted", "variables", "and", "returns", "the", "buffered", "output", "." ]
c0c90e7217c598c82bb65e5304e8076da381c1f8
https://github.com/mlaphp/mlaphp/blob/c0c90e7217c598c82bb65e5304e8076da381c1f8/src/Mlaphp/Response.php#L259-L269
228,744
mlaphp/mlaphp
src/Mlaphp/Response.php
Response.sendHeaders
public function sendHeaders() { foreach ($this->headers as $args) { $func = array_shift($args); call_user_func_array($func, $args); } }
php
public function sendHeaders() { foreach ($this->headers as $args) { $func = array_shift($args); call_user_func_array($func, $args); } }
[ "public", "function", "sendHeaders", "(", ")", "{", "foreach", "(", "$", "this", "->", "headers", "as", "$", "args", ")", "{", "$", "func", "=", "array_shift", "(", "$", "args", ")", ";", "call_user_func_array", "(", "$", "func", ",", "$", "args", ")...
Outputs the buffered calls to `header`, `setcookie`, etc. @return null
[ "Outputs", "the", "buffered", "calls", "to", "header", "setcookie", "etc", "." ]
c0c90e7217c598c82bb65e5304e8076da381c1f8
https://github.com/mlaphp/mlaphp/blob/c0c90e7217c598c82bb65e5304e8076da381c1f8/src/Mlaphp/Response.php#L276-L282
228,745
pear/Net_LDAP2
Net/LDAP2.php
Net_LDAP2.connect
public static function connect($config = array()) { $ldap_check = self::checkLDAPExtension(); if (self::iserror($ldap_check)) { return $ldap_check; } @$obj = new Net_LDAP2($config); // todo? better errorhandling for setConfig()? // connect and bind with...
php
public static function connect($config = array()) { $ldap_check = self::checkLDAPExtension(); if (self::iserror($ldap_check)) { return $ldap_check; } @$obj = new Net_LDAP2($config); // todo? better errorhandling for setConfig()? // connect and bind with...
[ "public", "static", "function", "connect", "(", "$", "config", "=", "array", "(", ")", ")", "{", "$", "ldap_check", "=", "self", "::", "checkLDAPExtension", "(", ")", ";", "if", "(", "self", "::", "iserror", "(", "$", "ldap_check", ")", ")", "{", "re...
Configure Net_LDAP2, connect and bind Use this method as starting point of using Net_LDAP2 to establish a connection to your LDAP server. Static function that returns either an error object or the new Net_LDAP2 object. Something like a factory. Takes a config array with the needed parameters. @param array $config Co...
[ "Configure", "Net_LDAP2", "connect", "and", "bind" ]
38f1b22a96dfbd7ec53852f0e1e7ec1a9a5eb0e8
https://github.com/pear/Net_LDAP2/blob/38f1b22a96dfbd7ec53852f0e1e7ec1a9a5eb0e8/Net/LDAP2.php#L195-L213
228,746
pear/Net_LDAP2
Net/LDAP2.php
Net_LDAP2.setConfig
protected function setConfig($config) { // // Parameter check -- probably should raise an error here if config // is not an array. // if (! is_array($config)) { return; } foreach ($config as $k => $v) { if (isset($this->_config[$k])) {...
php
protected function setConfig($config) { // // Parameter check -- probably should raise an error here if config // is not an array. // if (! is_array($config)) { return; } foreach ($config as $k => $v) { if (isset($this->_config[$k])) {...
[ "protected", "function", "setConfig", "(", "$", "config", ")", "{", "//", "// Parameter check -- probably should raise an error here if config", "// is not an array.", "//", "if", "(", "!", "is_array", "(", "$", "config", ")", ")", "{", "return", ";", "}", "foreach"...
Sets the internal configuration array @param array $config Configuration array @access protected @return void
[ "Sets", "the", "internal", "configuration", "array" ]
38f1b22a96dfbd7ec53852f0e1e7ec1a9a5eb0e8
https://github.com/pear/Net_LDAP2/blob/38f1b22a96dfbd7ec53852f0e1e7ec1a9a5eb0e8/Net/LDAP2.php#L244-L296
228,747
pear/Net_LDAP2
Net/LDAP2.php
Net_LDAP2.bind
public function bind($dn = null, $password = null) { // fetch current bind credentials if (is_null($dn)) { $dn = $this->_config["binddn"]; } if (is_null($password)) { $password = $this->_config["bindpw"]; } // Connect first, if we haven't so f...
php
public function bind($dn = null, $password = null) { // fetch current bind credentials if (is_null($dn)) { $dn = $this->_config["binddn"]; } if (is_null($password)) { $password = $this->_config["bindpw"]; } // Connect first, if we haven't so f...
[ "public", "function", "bind", "(", "$", "dn", "=", "null", ",", "$", "password", "=", "null", ")", "{", "// fetch current bind credentials", "if", "(", "is_null", "(", "$", "dn", ")", ")", "{", "$", "dn", "=", "$", "this", "->", "_config", "[", "\"bi...
Bind or rebind to the ldap-server This function binds with the given dn and password to the server. In case no connection has been made yet, it will be started and startTLS issued if appropiate. The internal bind configuration is not being updated, so if you call bind() without parameters, you can rebind with the cre...
[ "Bind", "or", "rebind", "to", "the", "ldap", "-", "server" ]
38f1b22a96dfbd7ec53852f0e1e7ec1a9a5eb0e8
https://github.com/pear/Net_LDAP2/blob/38f1b22a96dfbd7ec53852f0e1e7ec1a9a5eb0e8/Net/LDAP2.php#L315-L366
228,748
pear/Net_LDAP2
Net/LDAP2.php
Net_LDAP2.performReconnect
protected function performReconnect() { // Return true if we are already connected. if ($this->_link !== false) { return true; } // Default error message in case all connection attempts // fail but no message is set $current_error = new PEAR_Error('Unkno...
php
protected function performReconnect() { // Return true if we are already connected. if ($this->_link !== false) { return true; } // Default error message in case all connection attempts // fail but no message is set $current_error = new PEAR_Error('Unkno...
[ "protected", "function", "performReconnect", "(", ")", "{", "// Return true if we are already connected.", "if", "(", "$", "this", "->", "_link", "!==", "false", ")", "{", "return", "true", ";", "}", "// Default error message in case all connection attempts", "// fail but...
Reconnect to the ldap-server. In case the connection to the LDAP service has dropped out for some reason, this function will reconnect, and re-bind if a bind has been attempted in the past. It is probably most useful when the server list provided to the new() or connect() function is an array rather than a single hos...
[ "Reconnect", "to", "the", "ldap", "-", "server", "." ]
38f1b22a96dfbd7ec53852f0e1e7ec1a9a5eb0e8
https://github.com/pear/Net_LDAP2/blob/38f1b22a96dfbd7ec53852f0e1e7ec1a9a5eb0e8/Net/LDAP2.php#L557-L605
228,749
pear/Net_LDAP2
Net/LDAP2.php
Net_LDAP2.startTLS
public function startTLS() { /* Test to see if the server supports TLS first. This is done via testing the extensions offered by the server. The OID 1.3.6.1.4.1.1466.20037 tells us, if TLS is supported. Note, that not all servers allow to feth either the rootDSE or ...
php
public function startTLS() { /* Test to see if the server supports TLS first. This is done via testing the extensions offered by the server. The OID 1.3.6.1.4.1.1466.20037 tells us, if TLS is supported. Note, that not all servers allow to feth either the rootDSE or ...
[ "public", "function", "startTLS", "(", ")", "{", "/* Test to see if the server supports TLS first.\n This is done via testing the extensions offered by the server.\n The OID 1.3.6.1.4.1.1466.20037 tells us, if TLS is supported.\n Note, that not all servers allow to feth eit...
Starts an encrypted session @access public @return Net_LDAP2_Error|true Net_LDAP2_Error object or true
[ "Starts", "an", "encrypted", "session" ]
38f1b22a96dfbd7ec53852f0e1e7ec1a9a5eb0e8
https://github.com/pear/Net_LDAP2/blob/38f1b22a96dfbd7ec53852f0e1e7ec1a9a5eb0e8/Net/LDAP2.php#L613-L657
228,750
pear/Net_LDAP2
Net/LDAP2.php
Net_LDAP2.add
public function add($entry) { if (!$entry instanceof Net_LDAP2_Entry) { return PEAR::raiseError('Parameter to Net_LDAP2::add() must be a Net_LDAP2_Entry object.'); } // Continue attempting the add operation in a loop until we // get a success, a definitive failure, or th...
php
public function add($entry) { if (!$entry instanceof Net_LDAP2_Entry) { return PEAR::raiseError('Parameter to Net_LDAP2::add() must be a Net_LDAP2_Entry object.'); } // Continue attempting the add operation in a loop until we // get a success, a definitive failure, or th...
[ "public", "function", "add", "(", "$", "entry", ")", "{", "if", "(", "!", "$", "entry", "instanceof", "Net_LDAP2_Entry", ")", "{", "return", "PEAR", "::", "raiseError", "(", "'Parameter to Net_LDAP2::add() must be a Net_LDAP2_Entry object.'", ")", ";", "}", "// Co...
Add a new entryobject to a directory. Use add to add a new Net_LDAP2_Entry object to the directory. This also links the entry to the connection used for the add, if it was a fresh entry ({@link Net_LDAP2_Entry::createFresh()}) @param Net_LDAP2_Entry $entry Net_LDAP2_Entry @return Net_LDAP2_Error|true Net_LDAP2_Er...
[ "Add", "a", "new", "entryobject", "to", "a", "directory", "." ]
38f1b22a96dfbd7ec53852f0e1e7ec1a9a5eb0e8
https://github.com/pear/Net_LDAP2/blob/38f1b22a96dfbd7ec53852f0e1e7ec1a9a5eb0e8/Net/LDAP2.php#L715-L767
228,751
pear/Net_LDAP2
Net/LDAP2.php
Net_LDAP2.delete
public function delete($dn, $recursive = false) { if ($dn instanceof Net_LDAP2_Entry) { $dn = $dn->dn(); } if (false === is_string($dn)) { return PEAR::raiseError("Parameter is not a string nor an entry object!"); } // Recursive delete searches for ch...
php
public function delete($dn, $recursive = false) { if ($dn instanceof Net_LDAP2_Entry) { $dn = $dn->dn(); } if (false === is_string($dn)) { return PEAR::raiseError("Parameter is not a string nor an entry object!"); } // Recursive delete searches for ch...
[ "public", "function", "delete", "(", "$", "dn", ",", "$", "recursive", "=", "false", ")", "{", "if", "(", "$", "dn", "instanceof", "Net_LDAP2_Entry", ")", "{", "$", "dn", "=", "$", "dn", "->", "dn", "(", ")", ";", "}", "if", "(", "false", "===", ...
Delete an entry from the directory The object may either be a string representing the dn or a Net_LDAP2_Entry object. When the boolean paramter recursive is set, all subentries of the entry will be deleted as well. @param string|Net_LDAP2_Entry $dn DN-string or Net_LDAP2_Entry @param boolean $re...
[ "Delete", "an", "entry", "from", "the", "directory" ]
38f1b22a96dfbd7ec53852f0e1e7ec1a9a5eb0e8
https://github.com/pear/Net_LDAP2/blob/38f1b22a96dfbd7ec53852f0e1e7ec1a9a5eb0e8/Net/LDAP2.php#L782-L849
228,752
pear/Net_LDAP2
Net/LDAP2.php
Net_LDAP2.modify
public function modify($entry, $parms = array()) { if (is_string($entry)) { $entry = $this->getEntry($entry); if (self::isError($entry)) { return $entry; } } if (!$entry instanceof Net_LDAP2_Entry) { return PEAR::raiseError("Par...
php
public function modify($entry, $parms = array()) { if (is_string($entry)) { $entry = $this->getEntry($entry); if (self::isError($entry)) { return $entry; } } if (!$entry instanceof Net_LDAP2_Entry) { return PEAR::raiseError("Par...
[ "public", "function", "modify", "(", "$", "entry", ",", "$", "parms", "=", "array", "(", ")", ")", "{", "if", "(", "is_string", "(", "$", "entry", ")", ")", "{", "$", "entry", "=", "$", "this", "->", "getEntry", "(", "$", "entry", ")", ";", "if...
Modify an ldapentry directly on the server This one takes the DN or a Net_LDAP2_Entry object and an array of actions. This array should be something like this: array('add' => array('attribute1' => array('val1', 'val2'), 'attribute2' => array('val1')), 'delete' => array('attribute1'), 'replace' => array('attribute1' =...
[ "Modify", "an", "ldapentry", "directly", "on", "the", "server" ]
38f1b22a96dfbd7ec53852f0e1e7ec1a9a5eb0e8
https://github.com/pear/Net_LDAP2/blob/38f1b22a96dfbd7ec53852f0e1e7ec1a9a5eb0e8/Net/LDAP2.php#L887-L982
228,753
pear/Net_LDAP2
Net/LDAP2.php
Net_LDAP2.setOption
public function setOption($option, $value) { if ($this->_link) { if (defined($option)) { if (@ldap_set_option($this->_link, constant($option), $value)) { return true; } else { $err = @ldap_errno($this->_link); ...
php
public function setOption($option, $value) { if ($this->_link) { if (defined($option)) { if (@ldap_set_option($this->_link, constant($option), $value)) { return true; } else { $err = @ldap_errno($this->_link); ...
[ "public", "function", "setOption", "(", "$", "option", ",", "$", "value", ")", "{", "if", "(", "$", "this", "->", "_link", ")", "{", "if", "(", "defined", "(", "$", "option", ")", ")", "{", "if", "(", "@", "ldap_set_option", "(", "$", "this", "->...
Set an LDAP option @param string $option Option to set @param mixed $value Value to set Option to @access public @return Net_LDAP2_Error|true Net_LDAP2_Error object or true
[ "Set", "an", "LDAP", "option" ]
38f1b22a96dfbd7ec53852f0e1e7ec1a9a5eb0e8
https://github.com/pear/Net_LDAP2/blob/38f1b22a96dfbd7ec53852f0e1e7ec1a9a5eb0e8/Net/LDAP2.php#L1122-L1144
228,754
pear/Net_LDAP2
Net/LDAP2.php
Net_LDAP2.getOption
public function getOption($option) { if ($this->_link) { if (defined($option)) { if (@ldap_get_option($this->_link, constant($option), $value)) { return $value; } else { $err = @ldap_errno($this->_link); ...
php
public function getOption($option) { if ($this->_link) { if (defined($option)) { if (@ldap_get_option($this->_link, constant($option), $value)) { return $value; } else { $err = @ldap_errno($this->_link); ...
[ "public", "function", "getOption", "(", "$", "option", ")", "{", "if", "(", "$", "this", "->", "_link", ")", "{", "if", "(", "defined", "(", "$", "option", ")", ")", "{", "if", "(", "@", "ldap_get_option", "(", "$", "this", "->", "_link", ",", "c...
Get an LDAP option value @param string $option Option to get @access public @return Net_LDAP2_Error|string Net_LDAP2_Error or option value
[ "Get", "an", "LDAP", "option", "value" ]
38f1b22a96dfbd7ec53852f0e1e7ec1a9a5eb0e8
https://github.com/pear/Net_LDAP2/blob/38f1b22a96dfbd7ec53852f0e1e7ec1a9a5eb0e8/Net/LDAP2.php#L1154-L1176
228,755
pear/Net_LDAP2
Net/LDAP2.php
Net_LDAP2.getLDAPVersion
public function getLDAPVersion() { if ($this->_link) { $version = $this->getOption("LDAP_OPT_PROTOCOL_VERSION"); } else { $version = $this->_config['version']; } return $version; }
php
public function getLDAPVersion() { if ($this->_link) { $version = $this->getOption("LDAP_OPT_PROTOCOL_VERSION"); } else { $version = $this->_config['version']; } return $version; }
[ "public", "function", "getLDAPVersion", "(", ")", "{", "if", "(", "$", "this", "->", "_link", ")", "{", "$", "version", "=", "$", "this", "->", "getOption", "(", "\"LDAP_OPT_PROTOCOL_VERSION\"", ")", ";", "}", "else", "{", "$", "version", "=", "$", "th...
Get the LDAP_PROTOCOL_VERSION that is used on the connection. A lot of ldap functionality is defined by what protocol version the ldap server speaks. This might be 2 or 3. @return int
[ "Get", "the", "LDAP_PROTOCOL_VERSION", "that", "is", "used", "on", "the", "connection", "." ]
38f1b22a96dfbd7ec53852f0e1e7ec1a9a5eb0e8
https://github.com/pear/Net_LDAP2/blob/38f1b22a96dfbd7ec53852f0e1e7ec1a9a5eb0e8/Net/LDAP2.php#L1186-L1194
228,756
pear/Net_LDAP2
Net/LDAP2.php
Net_LDAP2.setLDAPVersion
public function setLDAPVersion($version = 0, $force = false) { if (!$version) { $version = $this->_config['version']; } // // Check to see if the server supports this version first. // // Todo: Why is this so horribly slow? // $this->rootDse() is ...
php
public function setLDAPVersion($version = 0, $force = false) { if (!$version) { $version = $this->_config['version']; } // // Check to see if the server supports this version first. // // Todo: Why is this so horribly slow? // $this->rootDse() is ...
[ "public", "function", "setLDAPVersion", "(", "$", "version", "=", "0", ",", "$", "force", "=", "false", ")", "{", "if", "(", "!", "$", "version", ")", "{", "$", "version", "=", "$", "this", "->", "_config", "[", "'version'", "]", ";", "}", "//", ...
Set the LDAP_PROTOCOL_VERSION that is used on the connection. @param int $version LDAP-version that should be used @param boolean $force If set to true, the check against the rootDSE will be skipped @return Net_LDAP2_Error|true Net_LDAP2_Error object or true @todo Checking via the rootDSE takes much time - w...
[ "Set", "the", "LDAP_PROTOCOL_VERSION", "that", "is", "used", "on", "the", "connection", "." ]
38f1b22a96dfbd7ec53852f0e1e7ec1a9a5eb0e8
https://github.com/pear/Net_LDAP2/blob/38f1b22a96dfbd7ec53852f0e1e7ec1a9a5eb0e8/Net/LDAP2.php#L1205-L1237
228,757
pear/Net_LDAP2
Net/LDAP2.php
Net_LDAP2.dnExists
public function dnExists($dn) { if (PEAR::isError($dn)) { return $dn; } if ($dn instanceof Net_LDAP2_Entry) { $dn = $dn->dn(); } if (false === is_string($dn)) { return PEAR::raiseError('Parameter $dn is not a string nor an entry object!');...
php
public function dnExists($dn) { if (PEAR::isError($dn)) { return $dn; } if ($dn instanceof Net_LDAP2_Entry) { $dn = $dn->dn(); } if (false === is_string($dn)) { return PEAR::raiseError('Parameter $dn is not a string nor an entry object!');...
[ "public", "function", "dnExists", "(", "$", "dn", ")", "{", "if", "(", "PEAR", "::", "isError", "(", "$", "dn", ")", ")", "{", "return", "$", "dn", ";", "}", "if", "(", "$", "dn", "instanceof", "Net_LDAP2_Entry", ")", "{", "$", "dn", "=", "$", ...
Tells if a DN does exist in the directory @param string|Net_LDAP2_Entry $dn The DN of the object to test @return boolean|Net_LDAP2_Error
[ "Tells", "if", "a", "DN", "does", "exist", "in", "the", "directory" ]
38f1b22a96dfbd7ec53852f0e1e7ec1a9a5eb0e8
https://github.com/pear/Net_LDAP2/blob/38f1b22a96dfbd7ec53852f0e1e7ec1a9a5eb0e8/Net/LDAP2.php#L1247-L1274
228,758
pear/Net_LDAP2
Net/LDAP2.php
Net_LDAP2.getEntry
public function getEntry($dn, $attr = array()) { if (!is_array($attr)) { $attr = array($attr); } $result = $this->search($dn, '(objectClass=*)', array('scope' => 'base', 'attributes' => $attr)); if (self::isError($result)) { ret...
php
public function getEntry($dn, $attr = array()) { if (!is_array($attr)) { $attr = array($attr); } $result = $this->search($dn, '(objectClass=*)', array('scope' => 'base', 'attributes' => $attr)); if (self::isError($result)) { ret...
[ "public", "function", "getEntry", "(", "$", "dn", ",", "$", "attr", "=", "array", "(", ")", ")", "{", "if", "(", "!", "is_array", "(", "$", "attr", ")", ")", "{", "$", "attr", "=", "array", "(", "$", "attr", ")", ";", "}", "$", "result", "=",...
Get a specific entry based on the DN @param string $dn DN of the entry that should be fetched @param array $attr Array of Attributes to select. If ommitted, all attributes are fetched. @return Net_LDAP2_Entry|Net_LDAP2_Error Reference to a Net_LDAP2_Entry object or Net_LDAP2_Error object @todo Maybe check again...
[ "Get", "a", "specific", "entry", "based", "on", "the", "DN" ]
38f1b22a96dfbd7ec53852f0e1e7ec1a9a5eb0e8
https://github.com/pear/Net_LDAP2/blob/38f1b22a96dfbd7ec53852f0e1e7ec1a9a5eb0e8/Net/LDAP2.php#L1286-L1303
228,759
pear/Net_LDAP2
Net/LDAP2.php
Net_LDAP2.move
public function move($entry, $newdn, $target_ldap = null) { if (is_string($entry)) { $entry_o = $this->getEntry($entry); } else { $entry_o = $entry; } if (!$entry_o instanceof Net_LDAP2_Entry) { return PEAR::raiseError('Parameter $entry is expected...
php
public function move($entry, $newdn, $target_ldap = null) { if (is_string($entry)) { $entry_o = $this->getEntry($entry); } else { $entry_o = $entry; } if (!$entry_o instanceof Net_LDAP2_Entry) { return PEAR::raiseError('Parameter $entry is expected...
[ "public", "function", "move", "(", "$", "entry", ",", "$", "newdn", ",", "$", "target_ldap", "=", "null", ")", "{", "if", "(", "is_string", "(", "$", "entry", ")", ")", "{", "$", "entry_o", "=", "$", "this", "->", "getEntry", "(", "$", "entry", "...
Rename or move an entry This method will instantly carry out an update() after the move, so the entry is moved instantly. You can pass an optional Net_LDAP2 object. In this case, a cross directory move will be performed which deletes the entry in the source (THIS) directory and adds it in the directory $target_ldap. A...
[ "Rename", "or", "move", "an", "entry" ]
38f1b22a96dfbd7ec53852f0e1e7ec1a9a5eb0e8
https://github.com/pear/Net_LDAP2/blob/38f1b22a96dfbd7ec53852f0e1e7ec1a9a5eb0e8/Net/LDAP2.php#L1325-L1368
228,760
pear/Net_LDAP2
Net/LDAP2.php
Net_LDAP2.copy
public function copy($entry, $newdn) { if (!$entry instanceof Net_LDAP2_Entry) { return PEAR::raiseError('Parameter $entry is expected to be a Net_LDAP2_Entry object!'); } $newentry = Net_LDAP2_Entry::createFresh($newdn, $entry->getValues()); $result = $this->add($newe...
php
public function copy($entry, $newdn) { if (!$entry instanceof Net_LDAP2_Entry) { return PEAR::raiseError('Parameter $entry is expected to be a Net_LDAP2_Entry object!'); } $newentry = Net_LDAP2_Entry::createFresh($newdn, $entry->getValues()); $result = $this->add($newe...
[ "public", "function", "copy", "(", "$", "entry", ",", "$", "newdn", ")", "{", "if", "(", "!", "$", "entry", "instanceof", "Net_LDAP2_Entry", ")", "{", "return", "PEAR", "::", "raiseError", "(", "'Parameter $entry is expected to be a Net_LDAP2_Entry object!'", ")",...
Copy an entry to a new location The entry will be immediately copied. Please note that only attributes you have selected will be copied. @param Net_LDAP2_Entry $entry Entry object @param string $newdn New FQF-DN of the entry @return Net_LDAP2_Error|Net_LDAP2_Entry Error Message or reference to the copied e...
[ "Copy", "an", "entry", "to", "a", "new", "location" ]
38f1b22a96dfbd7ec53852f0e1e7ec1a9a5eb0e8
https://github.com/pear/Net_LDAP2/blob/38f1b22a96dfbd7ec53852f0e1e7ec1a9a5eb0e8/Net/LDAP2.php#L1382-L1396
228,761
pear/Net_LDAP2
Net/LDAP2.php
Net_LDAP2.errorMessage
public static function errorMessage($errorcode) { $errorMessages = array( 0x00 => "LDAP_SUCCESS", 0x01 => "LDAP_OPERATIONS_ERROR", 0x02 => "LDAP_PROTOCOL_ERROR", 0x03 => "LDAP_TIMELIMIT_EX...
php
public static function errorMessage($errorcode) { $errorMessages = array( 0x00 => "LDAP_SUCCESS", 0x01 => "LDAP_OPERATIONS_ERROR", 0x02 => "LDAP_PROTOCOL_ERROR", 0x03 => "LDAP_TIMELIMIT_EX...
[ "public", "static", "function", "errorMessage", "(", "$", "errorcode", ")", "{", "$", "errorMessages", "=", "array", "(", "0x00", "=>", "\"LDAP_SUCCESS\"", ",", "0x01", "=>", "\"LDAP_OPERATIONS_ERROR\"", ",", "0x02", "=>", "\"LDAP_PROTOCOL_ERROR\"", ",", "0x03", ...
Returns the string for an ldap errorcode. Made to be able to make better errorhandling Function based on DB::errorMessage() Tip: The best description of the errorcodes is found here: http://www.directory-info.com/LDAP2/LDAPErrorCodes.html @param int $errorcode Error code @return string The errorstring for the error.
[ "Returns", "the", "string", "for", "an", "ldap", "errorcode", "." ]
38f1b22a96dfbd7ec53852f0e1e7ec1a9a5eb0e8
https://github.com/pear/Net_LDAP2/blob/38f1b22a96dfbd7ec53852f0e1e7ec1a9a5eb0e8/Net/LDAP2.php#L1411-L1481
228,762
pear/Net_LDAP2
Net/LDAP2.php
Net_LDAP2.rootDse
public function rootDse($attrs = null) { if ($attrs !== null && !is_array($attrs)) { return PEAR::raiseError('Parameter $attr is expected to be an array!'); } $attrs_signature = serialize($attrs); // see if we need to fetch a fresh object, or if we already // re...
php
public function rootDse($attrs = null) { if ($attrs !== null && !is_array($attrs)) { return PEAR::raiseError('Parameter $attr is expected to be an array!'); } $attrs_signature = serialize($attrs); // see if we need to fetch a fresh object, or if we already // re...
[ "public", "function", "rootDse", "(", "$", "attrs", "=", "null", ")", "{", "if", "(", "$", "attrs", "!==", "null", "&&", "!", "is_array", "(", "$", "attrs", ")", ")", "{", "return", "PEAR", "::", "raiseError", "(", "'Parameter $attr is expected to be an ar...
Gets a rootDSE object This either fetches a fresh rootDSE object or returns it from the internal cache for performance reasons, if possible. @param array $attrs Array of attributes to search for @access public @return Net_LDAP2_Error|Net_LDAP2_RootDSE Net_LDAP2_Error or Net_LDAP2_RootDSE object
[ "Gets", "a", "rootDSE", "object" ]
38f1b22a96dfbd7ec53852f0e1e7ec1a9a5eb0e8
https://github.com/pear/Net_LDAP2/blob/38f1b22a96dfbd7ec53852f0e1e7ec1a9a5eb0e8/Net/LDAP2.php#L1494-L1514
228,763
pear/Net_LDAP2
Net/LDAP2.php
Net_LDAP2.schema
public function schema($dn = null) { // Schema caching by Knut-Olav Hoven // If a schema caching object is registered, we use that to fetch // a schema object. // See registerSchemaCache() for more info on this. if ($this->_schema === null) { if ($this->_schema_ca...
php
public function schema($dn = null) { // Schema caching by Knut-Olav Hoven // If a schema caching object is registered, we use that to fetch // a schema object. // See registerSchemaCache() for more info on this. if ($this->_schema === null) { if ($this->_schema_ca...
[ "public", "function", "schema", "(", "$", "dn", "=", "null", ")", "{", "// Schema caching by Knut-Olav Hoven", "// If a schema caching object is registered, we use that to fetch", "// a schema object.", "// See registerSchemaCache() for more info on this.", "if", "(", "$", "this", ...
Get a schema object @param string $dn (optional) Subschema entry dn @access public @return Net_LDAP2_Schema|Net_LDAP2_Error Net_LDAP2_Schema or Net_LDAP2_Error object
[ "Get", "a", "schema", "object" ]
38f1b22a96dfbd7ec53852f0e1e7ec1a9a5eb0e8
https://github.com/pear/Net_LDAP2/blob/38f1b22a96dfbd7ec53852f0e1e7ec1a9a5eb0e8/Net/LDAP2.php#L1537-L1574
228,764
pinfirestudios/yii2-bugsnag
src/BugsnagAsset.php
BugsnagAsset.init
public function init() { if (!Yii::$app->has('bugsnag')) { throw new InvalidConfigException('BugsnagAsset requires Bugsnag component to be enabled'); } if (!in_array($this->version, [2, 3])) { throw new InvalidConfigException('Bugsnag javascript only ...
php
public function init() { if (!Yii::$app->has('bugsnag')) { throw new InvalidConfigException('BugsnagAsset requires Bugsnag component to be enabled'); } if (!in_array($this->version, [2, 3])) { throw new InvalidConfigException('Bugsnag javascript only ...
[ "public", "function", "init", "(", ")", "{", "if", "(", "!", "Yii", "::", "$", "app", "->", "has", "(", "'bugsnag'", ")", ")", "{", "throw", "new", "InvalidConfigException", "(", "'BugsnagAsset requires Bugsnag component to be enabled'", ")", ";", "}", "if", ...
Initiates Bugsnag javascript registration
[ "Initiates", "Bugsnag", "javascript", "registration" ]
032c061e8293e41917b12fc78b59290f3219d2e4
https://github.com/pinfirestudios/yii2-bugsnag/blob/032c061e8293e41917b12fc78b59290f3219d2e4/src/BugsnagAsset.php#L37-L52
228,765
pinfirestudios/yii2-bugsnag
src/BugsnagAsset.php
BugsnagAsset.registerJavascript
private function registerJavascript() { $filePath = '//d2wy8f7a9ursnm.cloudfront.net/bugsnag-' . $this->version . '.js'; if (!$this->useCdn) { $this->sourcePath = '@bower/bugsnag/src'; $filePath = 'bugsnag.js'; if (!file_exists(Yii::getAlias($this->sourcePath . '/' . $file...
php
private function registerJavascript() { $filePath = '//d2wy8f7a9ursnm.cloudfront.net/bugsnag-' . $this->version . '.js'; if (!$this->useCdn) { $this->sourcePath = '@bower/bugsnag/src'; $filePath = 'bugsnag.js'; if (!file_exists(Yii::getAlias($this->sourcePath . '/' . $file...
[ "private", "function", "registerJavascript", "(", ")", "{", "$", "filePath", "=", "'//d2wy8f7a9ursnm.cloudfront.net/bugsnag-'", ".", "$", "this", "->", "version", ".", "'.js'", ";", "if", "(", "!", "$", "this", "->", "useCdn", ")", "{", "$", "this", "->", ...
Registers Bugsnag JavaScript to page
[ "Registers", "Bugsnag", "JavaScript", "to", "page" ]
032c061e8293e41917b12fc78b59290f3219d2e4
https://github.com/pinfirestudios/yii2-bugsnag/blob/032c061e8293e41917b12fc78b59290f3219d2e4/src/BugsnagAsset.php#L58-L96
228,766
rexxars/morse-php
library/Table.php
Table.getCharacter
public function getCharacter($morse) { $key = strtr($morse, '.-', '01'); return isset($this->reversedTable[$key]) ? $this->reversedTable[$key] : false; }
php
public function getCharacter($morse) { $key = strtr($morse, '.-', '01'); return isset($this->reversedTable[$key]) ? $this->reversedTable[$key] : false; }
[ "public", "function", "getCharacter", "(", "$", "morse", ")", "{", "$", "key", "=", "strtr", "(", "$", "morse", ",", "'.-'", ",", "'01'", ")", ";", "return", "isset", "(", "$", "this", "->", "reversedTable", "[", "$", "key", "]", ")", "?", "$", "...
Get character for given morse code @param string $morse @return string
[ "Get", "character", "for", "given", "morse", "code" ]
4f8b8fe15639ddd6f9f030c06e9ccce844142ac9
https://github.com/rexxars/morse-php/blob/4f8b8fe15639ddd6f9f030c06e9ccce844142ac9/library/Table.php#L167-L170
228,767
dunglas/api-platform-heroku
src/Database.php
Database.createParameters
public static function createParameters() { $database = parse_url(getenv('DATABASE_URL')); putenv(sprintf('SYMFONY__DATABASE_HOST=%s', $database['host'])); putenv(sprintf('SYMFONY__DATABASE_PORT=%s', $database['port'])); putenv(sprintf('SYMFONY__DATABASE_USER=%s', $database['user'])...
php
public static function createParameters() { $database = parse_url(getenv('DATABASE_URL')); putenv(sprintf('SYMFONY__DATABASE_HOST=%s', $database['host'])); putenv(sprintf('SYMFONY__DATABASE_PORT=%s', $database['port'])); putenv(sprintf('SYMFONY__DATABASE_USER=%s', $database['user'])...
[ "public", "static", "function", "createParameters", "(", ")", "{", "$", "database", "=", "parse_url", "(", "getenv", "(", "'DATABASE_URL'", ")", ")", ";", "putenv", "(", "sprintf", "(", "'SYMFONY__DATABASE_HOST=%s'", ",", "$", "database", "[", "'host'", "]", ...
Creates parameters.
[ "Creates", "parameters", "." ]
6e6f68764c31e679033c82acd85430d7b4b6d482
https://github.com/dunglas/api-platform-heroku/blob/6e6f68764c31e679033c82acd85430d7b4b6d482/src/Database.php#L24-L33
228,768
denar90/yii2-wavesurfer-audio-widget
WaveSurferAudioWidget.php
WaveSurferAudioWidget.showControls
private function showControls() { //set controll btn class name $jsClassName = 'js-audio-widget-action'; foreach($this->settings['controls'] as $key => $value) { if ($value) { $cssClassName = 'audio-widget-' . $key; $options['class'] = $cssClassNam...
php
private function showControls() { //set controll btn class name $jsClassName = 'js-audio-widget-action'; foreach($this->settings['controls'] as $key => $value) { if ($value) { $cssClassName = 'audio-widget-' . $key; $options['class'] = $cssClassNam...
[ "private", "function", "showControls", "(", ")", "{", "//set controll btn class name", "$", "jsClassName", "=", "'js-audio-widget-action'", ";", "foreach", "(", "$", "this", "->", "settings", "[", "'controls'", "]", "as", "$", "key", "=>", "$", "value", ")", "...
Show widget controls
[ "Show", "widget", "controls" ]
0ac6788bbd1d54db8c099eff1d41bb2102f98f71
https://github.com/denar90/yii2-wavesurfer-audio-widget/blob/0ac6788bbd1d54db8c099eff1d41bb2102f98f71/WaveSurferAudioWidget.php#L69-L85
228,769
denar90/yii2-wavesurfer-audio-widget
WaveSurferAudioWidget.php
WaveSurferAudioWidget.setSettingsForJs
private function setSettingsForJs() { //check if audio url was set if (ArrayHelper::keyExists('fileUrl', $this->settings, false) && !empty($this->settings['fileUrl'])) { $this->widgetSettings['fileUrl'] = $this->settings['fileUrl']; } else { throw new ElementNotFound('fil...
php
private function setSettingsForJs() { //check if audio url was set if (ArrayHelper::keyExists('fileUrl', $this->settings, false) && !empty($this->settings['fileUrl'])) { $this->widgetSettings['fileUrl'] = $this->settings['fileUrl']; } else { throw new ElementNotFound('fil...
[ "private", "function", "setSettingsForJs", "(", ")", "{", "//check if audio url was set", "if", "(", "ArrayHelper", "::", "keyExists", "(", "'fileUrl'", ",", "$", "this", "->", "settings", ",", "false", ")", "&&", "!", "empty", "(", "$", "this", "->", "setti...
Set settings for js widget @throws ElementNotFound fileUrl was not set
[ "Set", "settings", "for", "js", "widget" ]
0ac6788bbd1d54db8c099eff1d41bb2102f98f71
https://github.com/denar90/yii2-wavesurfer-audio-widget/blob/0ac6788bbd1d54db8c099eff1d41bb2102f98f71/WaveSurferAudioWidget.php#L91-L105
228,770
denar90/yii2-wavesurfer-audio-widget
WaveSurferAudioWidget.php
WaveSurferAudioWidget.registerWidgetScripts
private function registerWidgetScripts() { $view = $this->getView(); $asset = Yii::$container->get(Asset::className()); $asset::register($view); $this->widgetSettings = Json::encode($this->widgetSettings); $view->registerJs("var audioWidget = new AudioWidget(" . $this->widget...
php
private function registerWidgetScripts() { $view = $this->getView(); $asset = Yii::$container->get(Asset::className()); $asset::register($view); $this->widgetSettings = Json::encode($this->widgetSettings); $view->registerJs("var audioWidget = new AudioWidget(" . $this->widget...
[ "private", "function", "registerWidgetScripts", "(", ")", "{", "$", "view", "=", "$", "this", "->", "getView", "(", ")", ";", "$", "asset", "=", "Yii", "::", "$", "container", "->", "get", "(", "Asset", "::", "className", "(", ")", ")", ";", "$", "...
Register widget asset
[ "Register", "widget", "asset" ]
0ac6788bbd1d54db8c099eff1d41bb2102f98f71
https://github.com/denar90/yii2-wavesurfer-audio-widget/blob/0ac6788bbd1d54db8c099eff1d41bb2102f98f71/WaveSurferAudioWidget.php#L110-L117
228,771
stanislav-web/phalcon-sms-factory
src/SMSFactory/Sender.php
Sender.call
final public function call($providerName) { $configProviderClass = "SMSFactory\\Config\\$providerName"; // note: no leading backslash $providerClass = "SMSFactory\\Providers\\$providerName"; // note: no leading backslash if (class_exists($providerClass) === true) { // inject c...
php
final public function call($providerName) { $configProviderClass = "SMSFactory\\Config\\$providerName"; // note: no leading backslash $providerClass = "SMSFactory\\Providers\\$providerName"; // note: no leading backslash if (class_exists($providerClass) === true) { // inject c...
[ "final", "public", "function", "call", "(", "$", "providerName", ")", "{", "$", "configProviderClass", "=", "\"SMSFactory\\\\Config\\\\$providerName\"", ";", "// note: no leading backslash", "$", "providerClass", "=", "\"SMSFactory\\\\Providers\\\\$providerName\"", ";", "// n...
Get SMS provider @param string $providerName demanded provider @uses ProviderInterface::setRecipient() @uses ProviderInterface::send() @uses ProviderInterface::balance() @throws BaseException @return object
[ "Get", "SMS", "provider" ]
75e5b61819ae24705e87073508f99341b64da2cd
https://github.com/stanislav-web/phalcon-sms-factory/blob/75e5b61819ae24705e87073508f99341b64da2cd/src/SMSFactory/Sender.php#L47-L60
228,772
projek-xyz/slim-monolog
src/Monolog.php
Monolog.useRotatingFiles
public function useRotatingFiles($level = Logger::DEBUG, $filename = null) { $filename || $filename = $this->name.'.log'; $path = $this->settings['directory'].'/'.$filename; $this->monolog->pushHandler( $handler = new Handler\RotatingFileHandler($path, 5, $level) ); ...
php
public function useRotatingFiles($level = Logger::DEBUG, $filename = null) { $filename || $filename = $this->name.'.log'; $path = $this->settings['directory'].'/'.$filename; $this->monolog->pushHandler( $handler = new Handler\RotatingFileHandler($path, 5, $level) ); ...
[ "public", "function", "useRotatingFiles", "(", "$", "level", "=", "Logger", "::", "DEBUG", ",", "$", "filename", "=", "null", ")", "{", "$", "filename", "||", "$", "filename", "=", "$", "this", "->", "name", ".", "'.log'", ";", "$", "path", "=", "$",...
Register a rotating file log handler. @param mixed $level @param null|string $filename @return \Projek\Slim\Monolog
[ "Register", "a", "rotating", "file", "log", "handler", "." ]
fdbb28a67105d22a81ad0b15d31e730f7461be26
https://github.com/projek-xyz/slim-monolog/blob/fdbb28a67105d22a81ad0b15d31e730f7461be26/src/Monolog.php#L197-L207
228,773
projek-xyz/slim-monolog
src/MonologProvider.php
MonologProvider.register
public function register(Container $container) { $settings = $container->get('settings'); if (!isset($settings['logger'])) { throw new InvalidArgumentException('Logger configuration not found'); } $basename = isset($settings['basename']) ? $settings['basename'] : 'slim-...
php
public function register(Container $container) { $settings = $container->get('settings'); if (!isset($settings['logger'])) { throw new InvalidArgumentException('Logger configuration not found'); } $basename = isset($settings['basename']) ? $settings['basename'] : 'slim-...
[ "public", "function", "register", "(", "Container", "$", "container", ")", "{", "$", "settings", "=", "$", "container", "->", "get", "(", "'settings'", ")", ";", "if", "(", "!", "isset", "(", "$", "settings", "[", "'logger'", "]", ")", ")", "{", "thr...
Register this monolog provider with a Pimple container @param \Pimple\Container $container
[ "Register", "this", "monolog", "provider", "with", "a", "Pimple", "container" ]
fdbb28a67105d22a81ad0b15d31e730f7461be26
https://github.com/projek-xyz/slim-monolog/blob/fdbb28a67105d22a81ad0b15d31e730f7461be26/src/MonologProvider.php#L15-L26
228,774
sop/crypto-types
lib/CryptoTypes/Signature/Signature.php
Signature.fromSignatureData
public static function fromSignatureData(string $data, AlgorithmIdentifierType $algo): Signature { if ($algo instanceof RSASignatureAlgorithmIdentifier) { return RSASignature::fromSignatureString($data); } if ($algo instanceof ECSignatureAlgorithmIdentifier) { ...
php
public static function fromSignatureData(string $data, AlgorithmIdentifierType $algo): Signature { if ($algo instanceof RSASignatureAlgorithmIdentifier) { return RSASignature::fromSignatureString($data); } if ($algo instanceof ECSignatureAlgorithmIdentifier) { ...
[ "public", "static", "function", "fromSignatureData", "(", "string", "$", "data", ",", "AlgorithmIdentifierType", "$", "algo", ")", ":", "Signature", "{", "if", "(", "$", "algo", "instanceof", "RSASignatureAlgorithmIdentifier", ")", "{", "return", "RSASignature", "...
Get signature object by signature data and used algorithm. @param string $data Signature value @param AlgorithmIdentifierType $algo Algorithm identifier @return self
[ "Get", "signature", "object", "by", "signature", "data", "and", "used", "algorithm", "." ]
1d36250a110b07300aeb003a20aeaadfc6445501
https://github.com/sop/crypto-types/blob/1d36250a110b07300aeb003a20aeaadfc6445501/lib/CryptoTypes/Signature/Signature.php#L31-L41
228,775
mlaphp/mlaphp
src/Mlaphp/MysqlDatabase.php
MysqlDatabase.addLinkArgument
protected function addLinkArgument($func, $args) { if (! isset($this->link_arg[$func])) { return $args; } if (count($args) >= $this->link_arg[$func]) { return $args; } $args[] = $this->link; return $args; }
php
protected function addLinkArgument($func, $args) { if (! isset($this->link_arg[$func])) { return $args; } if (count($args) >= $this->link_arg[$func]) { return $args; } $args[] = $this->link; return $args; }
[ "protected", "function", "addLinkArgument", "(", "$", "func", ",", "$", "args", ")", "{", "if", "(", "!", "isset", "(", "$", "this", "->", "link_arg", "[", "$", "func", "]", ")", ")", "{", "return", "$", "args", ";", "}", "if", "(", "count", "(",...
Given a MySQL function name and an array of arguments, adds the link identifier to the end of the arguments if one is needed. @param string $func The MySQL function name. @param array $args The arguments to the function. @return array The arguments, with the link identifier if one is needed.
[ "Given", "a", "MySQL", "function", "name", "and", "an", "array", "of", "arguments", "adds", "the", "link", "identifier", "to", "the", "end", "of", "the", "arguments", "if", "one", "is", "needed", "." ]
c0c90e7217c598c82bb65e5304e8076da381c1f8
https://github.com/mlaphp/mlaphp/blob/c0c90e7217c598c82bb65e5304e8076da381c1f8/src/Mlaphp/MysqlDatabase.php#L190-L202
228,776
mlaphp/mlaphp
src/Mlaphp/MysqlDatabase.php
MysqlDatabase.lazyConnect
protected function lazyConnect($func) { // do not reconnect if ($this->link) { return; } // connect only for functions that need a link if (! isset($this->link_arg[$func])) { return; } // connect and retain the identifier $thi...
php
protected function lazyConnect($func) { // do not reconnect if ($this->link) { return; } // connect only for functions that need a link if (! isset($this->link_arg[$func])) { return; } // connect and retain the identifier $thi...
[ "protected", "function", "lazyConnect", "(", "$", "func", ")", "{", "// do not reconnect", "if", "(", "$", "this", "->", "link", ")", "{", "return", ";", "}", "// connect only for functions that need a link", "if", "(", "!", "isset", "(", "$", "this", "->", ...
Given a MySQL function name, connects to the server if there is no link and identifier and one is needed. @param string $func The MySQL function name. @return null @throws RuntimeException if the connection attempt fails.
[ "Given", "a", "MySQL", "function", "name", "connects", "to", "the", "server", "if", "there", "is", "no", "link", "and", "identifier", "and", "one", "is", "needed", "." ]
c0c90e7217c598c82bb65e5304e8076da381c1f8
https://github.com/mlaphp/mlaphp/blob/c0c90e7217c598c82bb65e5304e8076da381c1f8/src/Mlaphp/MysqlDatabase.php#L212-L240
228,777
pear/Net_LDAP2
Net/LDAP2/SimpleFileSchemaCache.php
Net_LDAP2_SimpleFileSchemaCache.loadSchema
public function loadSchema() { $return = false; // Net_LDAP2 will load schema from LDAP if (file_exists($this->config['path'])) { $cache_maxage = filemtime($this->config['path']) + $this->config['max_age']; if (time() <= $cache_maxage || $this->config['max_age'] == 0) { ...
php
public function loadSchema() { $return = false; // Net_LDAP2 will load schema from LDAP if (file_exists($this->config['path'])) { $cache_maxage = filemtime($this->config['path']) + $this->config['max_age']; if (time() <= $cache_maxage || $this->config['max_age'] == 0) { ...
[ "public", "function", "loadSchema", "(", ")", "{", "$", "return", "=", "false", ";", "// Net_LDAP2 will load schema from LDAP", "if", "(", "file_exists", "(", "$", "this", "->", "config", "[", "'path'", "]", ")", ")", "{", "$", "cache_maxage", "=", "filemtim...
Return the schema object from the cache If file is existent and cache has not expired yet, then the cache is deserialized and returned. @return Net_LDAP2_Schema|Net_LDAP2_Error|false
[ "Return", "the", "schema", "object", "from", "the", "cache" ]
38f1b22a96dfbd7ec53852f0e1e7ec1a9a5eb0e8
https://github.com/pear/Net_LDAP2/blob/38f1b22a96dfbd7ec53852f0e1e7ec1a9a5eb0e8/Net/LDAP2/SimpleFileSchemaCache.php#L68-L78
228,778
paulzi/yii2-sortable
SortableBehavior.php
SortableBehavior.reorder
public function reorder($middle = true) { $result = 0; \Yii::$app->getDb()->transaction(function () use (&$result, $middle) { $list = $this->getQueryInternal() ->select($this->owner->primaryKey()) ->orderBy([$this->sortAttribute => SORT_ASC]) ...
php
public function reorder($middle = true) { $result = 0; \Yii::$app->getDb()->transaction(function () use (&$result, $middle) { $list = $this->getQueryInternal() ->select($this->owner->primaryKey()) ->orderBy([$this->sortAttribute => SORT_ASC]) ...
[ "public", "function", "reorder", "(", "$", "middle", "=", "true", ")", "{", "$", "result", "=", "0", ";", "\\", "Yii", "::", "$", "app", "->", "getDb", "(", ")", "->", "transaction", "(", "function", "(", ")", "use", "(", "&", "$", "result", ",",...
Reorders items with values of sortAttribute begin from zero. @param bool $middle @return integer @throws \Exception
[ "Reorders", "items", "with", "values", "of", "sortAttribute", "begin", "from", "zero", "." ]
2d51e8a923acb4cc385e8d28faa0e8d179aa014e
https://github.com/paulzi/yii2-sortable/blob/2d51e8a923acb4cc385e8d28faa0e8d179aa014e/SortableBehavior.php#L177-L193
228,779
sop/crypto-types
lib/CryptoTypes/Asymmetric/OneAsymmetricKey.php
OneAsymmetricKey.privateKey
public function privateKey(): PrivateKey { $algo = $this->algorithmIdentifier(); switch ($algo->oid()) { // RSA case AlgorithmIdentifier::OID_RSA_ENCRYPTION: return RSA\RSAPrivateKey::fromDER($this->_privateKeyData); // elliptic curve c...
php
public function privateKey(): PrivateKey { $algo = $this->algorithmIdentifier(); switch ($algo->oid()) { // RSA case AlgorithmIdentifier::OID_RSA_ENCRYPTION: return RSA\RSAPrivateKey::fromDER($this->_privateKeyData); // elliptic curve c...
[ "public", "function", "privateKey", "(", ")", ":", "PrivateKey", "{", "$", "algo", "=", "$", "this", "->", "algorithmIdentifier", "(", ")", ";", "switch", "(", "$", "algo", "->", "oid", "(", ")", ")", "{", "// RSA", "case", "AlgorithmIdentifier", "::", ...
Get private key. @throws \RuntimeException @return PrivateKey
[ "Get", "private", "key", "." ]
1d36250a110b07300aeb003a20aeaadfc6445501
https://github.com/sop/crypto-types/blob/1d36250a110b07300aeb003a20aeaadfc6445501/lib/CryptoTypes/Asymmetric/OneAsymmetricKey.php#L169-L194
228,780
mariano/disque-php
src/Command/Response/JscanResponse.php
JscanResponse.parseBody
protected function parseBody(array $body) { $jobs = []; if (!empty($body)) { if (is_string($body[0])) { foreach ($body as $element) { $jobs[] = ['id' => $element]; } } else { $keyValueResponse = new KeyValueR...
php
protected function parseBody(array $body) { $jobs = []; if (!empty($body)) { if (is_string($body[0])) { foreach ($body as $element) { $jobs[] = ['id' => $element]; } } else { $keyValueResponse = new KeyValueR...
[ "protected", "function", "parseBody", "(", "array", "$", "body", ")", "{", "$", "jobs", "=", "[", "]", ";", "if", "(", "!", "empty", "(", "$", "body", ")", ")", "{", "if", "(", "is_string", "(", "$", "body", "[", "0", "]", ")", ")", "{", "for...
Parse main body @param array $body Body @return array Parsed body
[ "Parse", "main", "body" ]
56cf00d97e739fec861717484657dbef2888df60
https://github.com/mariano/disque-php/blob/56cf00d97e739fec861717484657dbef2888df60/src/Command/Response/JscanResponse.php#L12-L31
228,781
sop/crypto-types
lib/CryptoTypes/AlgorithmIdentifier/Cipher/RC2CBCAlgorithmIdentifier.php
RC2CBCAlgorithmIdentifier._versionToEKB
private static function _versionToEKB(int $version): int { static $lut; if ($version > 255) { return $version; } if (!isset($lut)) { $lut = array_flip(self::EKB_TABLE); } return $lut[$version]; }
php
private static function _versionToEKB(int $version): int { static $lut; if ($version > 255) { return $version; } if (!isset($lut)) { $lut = array_flip(self::EKB_TABLE); } return $lut[$version]; }
[ "private", "static", "function", "_versionToEKB", "(", "int", "$", "version", ")", ":", "int", "{", "static", "$", "lut", ";", "if", "(", "$", "version", ">", "255", ")", "{", "return", "$", "version", ";", "}", "if", "(", "!", "isset", "(", "$", ...
Translate version number to number of effective key bits. @param int $version @return int
[ "Translate", "version", "number", "to", "number", "of", "effective", "key", "bits", "." ]
1d36250a110b07300aeb003a20aeaadfc6445501
https://github.com/sop/crypto-types/blob/1d36250a110b07300aeb003a20aeaadfc6445501/lib/CryptoTypes/AlgorithmIdentifier/Cipher/RC2CBCAlgorithmIdentifier.php#L211-L221
228,782
rexxars/morse-php
library/Text.php
Text.toMorse
public function toMorse($text) { $text = strtoupper($text); $words = preg_split('#\s+#', $text); $morse = array_map([$this, 'morseWord'], $words); return implode($this->wordSeparator, $morse); }
php
public function toMorse($text) { $text = strtoupper($text); $words = preg_split('#\s+#', $text); $morse = array_map([$this, 'morseWord'], $words); return implode($this->wordSeparator, $morse); }
[ "public", "function", "toMorse", "(", "$", "text", ")", "{", "$", "text", "=", "strtoupper", "(", "$", "text", ")", ";", "$", "words", "=", "preg_split", "(", "'#\\s+#'", ",", "$", "text", ")", ";", "$", "morse", "=", "array_map", "(", "[", "$", ...
Translate the given text to morse code @param string $text @return string
[ "Translate", "the", "given", "text", "to", "morse", "code" ]
4f8b8fe15639ddd6f9f030c06e9ccce844142ac9
https://github.com/rexxars/morse-php/blob/4f8b8fe15639ddd6f9f030c06e9ccce844142ac9/library/Text.php#L71-L76
228,783
rexxars/morse-php
library/Text.php
Text.fromMorse
public function fromMorse($morse) { $morse = str_replace($this->invalidCharacterReplacement . ' ', '', $morse); $words = explode($this->wordSeparator, $morse); $morse = array_map([$this, 'translateMorseWord'], $words); return implode(' ', $morse); }
php
public function fromMorse($morse) { $morse = str_replace($this->invalidCharacterReplacement . ' ', '', $morse); $words = explode($this->wordSeparator, $morse); $morse = array_map([$this, 'translateMorseWord'], $words); return implode(' ', $morse); }
[ "public", "function", "fromMorse", "(", "$", "morse", ")", "{", "$", "morse", "=", "str_replace", "(", "$", "this", "->", "invalidCharacterReplacement", ".", "' '", ",", "''", ",", "$", "morse", ")", ";", "$", "words", "=", "explode", "(", "$", "this",...
Translate the given morse code to text @param string $morse @return string
[ "Translate", "the", "given", "morse", "code", "to", "text" ]
4f8b8fe15639ddd6f9f030c06e9ccce844142ac9
https://github.com/rexxars/morse-php/blob/4f8b8fe15639ddd6f9f030c06e9ccce844142ac9/library/Text.php#L84-L89
228,784
rexxars/morse-php
library/Text.php
Text.translateMorseWord
private function translateMorseWord($morse) { $morseChars = explode(' ', $morse); $characters = array_map([$this, 'translateMorseCharacter'], $morseChars); return implode('', $characters); }
php
private function translateMorseWord($morse) { $morseChars = explode(' ', $morse); $characters = array_map([$this, 'translateMorseCharacter'], $morseChars); return implode('', $characters); }
[ "private", "function", "translateMorseWord", "(", "$", "morse", ")", "{", "$", "morseChars", "=", "explode", "(", "' '", ",", "$", "morse", ")", ";", "$", "characters", "=", "array_map", "(", "[", "$", "this", ",", "'translateMorseCharacter'", "]", ",", ...
Translate a "morse word" to text @param string $morse @return string
[ "Translate", "a", "morse", "word", "to", "text" ]
4f8b8fe15639ddd6f9f030c06e9ccce844142ac9
https://github.com/rexxars/morse-php/blob/4f8b8fe15639ddd6f9f030c06e9ccce844142ac9/library/Text.php#L97-L101
228,785
rexxars/morse-php
library/Text.php
Text.morseWord
private function morseWord($word) { $chars = $this->strSplit($word); $morse = array_map([$this, 'morseCharacter'], $chars); return implode(' ', $morse); }
php
private function morseWord($word) { $chars = $this->strSplit($word); $morse = array_map([$this, 'morseCharacter'], $chars); return implode(' ', $morse); }
[ "private", "function", "morseWord", "(", "$", "word", ")", "{", "$", "chars", "=", "$", "this", "->", "strSplit", "(", "$", "word", ")", ";", "$", "morse", "=", "array_map", "(", "[", "$", "this", ",", "'morseCharacter'", "]", ",", "$", "chars", ")...
Return the morse code for this word @param string $word @return string
[ "Return", "the", "morse", "code", "for", "this", "word" ]
4f8b8fe15639ddd6f9f030c06e9ccce844142ac9
https://github.com/rexxars/morse-php/blob/4f8b8fe15639ddd6f9f030c06e9ccce844142ac9/library/Text.php#L119-L123
228,786
rexxars/morse-php
library/Text.php
Text.morseCharacter
private function morseCharacter($char) { if (!isset($this->table[$char])) { return $this->invalidCharacterReplacement; } return $this->table->getMorse($char); }
php
private function morseCharacter($char) { if (!isset($this->table[$char])) { return $this->invalidCharacterReplacement; } return $this->table->getMorse($char); }
[ "private", "function", "morseCharacter", "(", "$", "char", ")", "{", "if", "(", "!", "isset", "(", "$", "this", "->", "table", "[", "$", "char", "]", ")", ")", "{", "return", "$", "this", "->", "invalidCharacterReplacement", ";", "}", "return", "$", ...
Return the morse code for this character @param string $char @return string
[ "Return", "the", "morse", "code", "for", "this", "character" ]
4f8b8fe15639ddd6f9f030c06e9ccce844142ac9
https://github.com/rexxars/morse-php/blob/4f8b8fe15639ddd6f9f030c06e9ccce844142ac9/library/Text.php#L131-L137
228,787
sop/crypto-types
lib/CryptoTypes/Asymmetric/EC/ECPublicKey.php
ECPublicKey.fromCoordinates
public static function fromCoordinates($x, $y, $named_curve = null, $bits = null): ECPublicKey { // if bitsize is not explicitly set, check from supported curves if (!isset($bits) && isset($named_curve)) { $bits = self::_curveSize($named_curve); } $mlen = null; if...
php
public static function fromCoordinates($x, $y, $named_curve = null, $bits = null): ECPublicKey { // if bitsize is not explicitly set, check from supported curves if (!isset($bits) && isset($named_curve)) { $bits = self::_curveSize($named_curve); } $mlen = null; if...
[ "public", "static", "function", "fromCoordinates", "(", "$", "x", ",", "$", "y", ",", "$", "named_curve", "=", "null", ",", "$", "bits", "=", "null", ")", ":", "ECPublicKey", "{", "// if bitsize is not explicitly set, check from supported curves", "if", "(", "!"...
Initialize from curve point coordinates. @param int|string $x X coordinate as a base10 number @param int|string $y Y coordinate as a base10 number @param string|null $named_curve Named curve OID @param int|null $bits Size of <i>p</i> in bits @return self
[ "Initialize", "from", "curve", "point", "coordinates", "." ]
1d36250a110b07300aeb003a20aeaadfc6445501
https://github.com/sop/crypto-types/blob/1d36250a110b07300aeb003a20aeaadfc6445501/lib/CryptoTypes/Asymmetric/EC/ECPublicKey.php#L67-L81
228,788
sop/crypto-types
lib/CryptoTypes/Asymmetric/EC/ECPublicKey.php
ECPublicKey.curvePointOctets
public function curvePointOctets(): array { if ($this->isCompressed()) { throw new \RuntimeException("EC point compression not supported."); } $str = substr($this->_ecPoint, 1); list($x, $y) = str_split($str, (int) floor(strlen($str) / 2)); return [$x, $y]; }
php
public function curvePointOctets(): array { if ($this->isCompressed()) { throw new \RuntimeException("EC point compression not supported."); } $str = substr($this->_ecPoint, 1); list($x, $y) = str_split($str, (int) floor(strlen($str) / 2)); return [$x, $y]; }
[ "public", "function", "curvePointOctets", "(", ")", ":", "array", "{", "if", "(", "$", "this", "->", "isCompressed", "(", ")", ")", "{", "throw", "new", "\\", "RuntimeException", "(", "\"EC point compression not supported.\"", ")", ";", "}", "$", "str", "=",...
Get curve point coordinates in octet string representation. @return string[] Tuple of X and Y field elements as a string.
[ "Get", "curve", "point", "coordinates", "in", "octet", "string", "representation", "." ]
1d36250a110b07300aeb003a20aeaadfc6445501
https://github.com/sop/crypto-types/blob/1d36250a110b07300aeb003a20aeaadfc6445501/lib/CryptoTypes/Asymmetric/EC/ECPublicKey.php#L147-L155
228,789
sop/crypto-types
lib/CryptoTypes/Asymmetric/PublicKey.php
PublicKey.fromPEM
public static function fromPEM(PEM $pem) { switch ($pem->type()) { case PEM::TYPE_RSA_PUBLIC_KEY: return RSA\RSAPublicKey::fromDER($pem->data()); case PEM::TYPE_PUBLIC_KEY: return PublicKeyInfo::fromPEM($pem)->publicKey(); } throw new \...
php
public static function fromPEM(PEM $pem) { switch ($pem->type()) { case PEM::TYPE_RSA_PUBLIC_KEY: return RSA\RSAPublicKey::fromDER($pem->data()); case PEM::TYPE_PUBLIC_KEY: return PublicKeyInfo::fromPEM($pem)->publicKey(); } throw new \...
[ "public", "static", "function", "fromPEM", "(", "PEM", "$", "pem", ")", "{", "switch", "(", "$", "pem", "->", "type", "(", ")", ")", "{", "case", "PEM", "::", "TYPE_RSA_PUBLIC_KEY", ":", "return", "RSA", "\\", "RSAPublicKey", "::", "fromDER", "(", "$",...
Initialize public key from PEM. @param PEM $pem @throws \UnexpectedValueException @return PublicKey
[ "Initialize", "public", "key", "from", "PEM", "." ]
1d36250a110b07300aeb003a20aeaadfc6445501
https://github.com/sop/crypto-types/blob/1d36250a110b07300aeb003a20aeaadfc6445501/lib/CryptoTypes/Asymmetric/PublicKey.php#L56-L66
228,790
nodes-php/counter-cache
src/CounterCache.php
CounterCache.count
public function count(IlluminateModel $model) { // If model does not implement the CounterCacheable // interface, we'll jump ship and abort. if (! $model instanceof CounterCacheable) { Log::error(sprintf('[%s] Model [%s] does not implement CounterCacheable.', __CLASS__, get_class...
php
public function count(IlluminateModel $model) { // If model does not implement the CounterCacheable // interface, we'll jump ship and abort. if (! $model instanceof CounterCacheable) { Log::error(sprintf('[%s] Model [%s] does not implement CounterCacheable.', __CLASS__, get_class...
[ "public", "function", "count", "(", "IlluminateModel", "$", "model", ")", "{", "// If model does not implement the CounterCacheable", "// interface, we'll jump ship and abort.", "if", "(", "!", "$", "model", "instanceof", "CounterCacheable", ")", "{", "Log", "::", "error"...
Perform counter caching on model. @author Morten Rugaard <moru@nodes.dk> @param \Illuminate\Database\Eloquent\Model $model @return bool @throws \Nodes\CounterCache\Exceptions\NoCounterCachesFoundException @throws \Nodes\CounterCache\Exceptions\NotCounterCacheableException @throws \Nodes\CounterCache\Exceptions\Relat...
[ "Perform", "counter", "caching", "on", "model", "." ]
623f19bdcfd15fdadfb38d9f118ea0dbdfebf7df
https://github.com/nodes-php/counter-cache/blob/623f19bdcfd15fdadfb38d9f118ea0dbdfebf7df/src/CounterCache.php#L30-L86
228,791
nodes-php/counter-cache
src/CounterCache.php
CounterCache.countAll
public function countAll(IlluminateModel $model) { // Retrieve all entities of model $entities = $model->get(); // If no entities found, we'll log the error, // throw an exception and abort. if (! $entities->isEmpty()) { Log::error(sprintf('[%s] No entities found...
php
public function countAll(IlluminateModel $model) { // Retrieve all entities of model $entities = $model->get(); // If no entities found, we'll log the error, // throw an exception and abort. if (! $entities->isEmpty()) { Log::error(sprintf('[%s] No entities found...
[ "public", "function", "countAll", "(", "IlluminateModel", "$", "model", ")", "{", "// Retrieve all entities of model", "$", "entities", "=", "$", "model", "->", "get", "(", ")", ";", "// If no entities found, we'll log the error,", "// throw an exception and abort.", "if"...
Perform counter caching on all entities of model. @author Morten Rugaard <moru@nodes.dk> @param \Illuminate\Database\Eloquent\Model $model @return bool @throws \Nodes\CounterCache\Exceptions\NoEntitiesFoundException @throws \Nodes\CounterCache\Exceptions\NoCounterCachesFound @throws \Nodes\CounterCache\Exceptions\No...
[ "Perform", "counter", "caching", "on", "all", "entities", "of", "model", "." ]
623f19bdcfd15fdadfb38d9f118ea0dbdfebf7df
https://github.com/nodes-php/counter-cache/blob/623f19bdcfd15fdadfb38d9f118ea0dbdfebf7df/src/CounterCache.php#L100-L118
228,792
nodes-php/counter-cache
src/CounterCache.php
CounterCache.updateCount
protected function updateCount(IlluminateModel $model, IlluminateRelation $relation, $counterCacheConditions, $foreignKey, $counterCacheColumnName) { // Retrieve table name of relation $relationTableName = $relation->getModel()->getTable(); // Generate query builder for counting entries ...
php
protected function updateCount(IlluminateModel $model, IlluminateRelation $relation, $counterCacheConditions, $foreignKey, $counterCacheColumnName) { // Retrieve table name of relation $relationTableName = $relation->getModel()->getTable(); // Generate query builder for counting entries ...
[ "protected", "function", "updateCount", "(", "IlluminateModel", "$", "model", ",", "IlluminateRelation", "$", "relation", ",", "$", "counterCacheConditions", ",", "$", "foreignKey", ",", "$", "counterCacheColumnName", ")", "{", "// Retrieve table name of relation", "$",...
Update counter cache column. @author Morten Rugaard <moru@nodes.dk> @param \Illuminate\Database\Eloquent\Model $model @param \Illuminate\Database\Eloquent\Relations\Relation $relation @param array|null $counterCacheConditions @param string ...
[ "Update", "counter", "cache", "column", "." ]
623f19bdcfd15fdadfb38d9f118ea0dbdfebf7df
https://github.com/nodes-php/counter-cache/blob/623f19bdcfd15fdadfb38d9f118ea0dbdfebf7df/src/CounterCache.php#L132-L167
228,793
pear/Net_LDAP2
Net/LDAP2/Search.php
Net_LDAP2_Search.entries
public function entries() { $entries = array(); if (false === $this->_entry_cache) { // cache is empty: fetch from LDAP while ($entry = $this->shiftEntry()) { $entries[] = $entry; } $this->_entry_cache = $entries; // store result in ca...
php
public function entries() { $entries = array(); if (false === $this->_entry_cache) { // cache is empty: fetch from LDAP while ($entry = $this->shiftEntry()) { $entries[] = $entry; } $this->_entry_cache = $entries; // store result in ca...
[ "public", "function", "entries", "(", ")", "{", "$", "entries", "=", "array", "(", ")", ";", "if", "(", "false", "===", "$", "this", "->", "_entry_cache", ")", "{", "// cache is empty: fetch from LDAP", "while", "(", "$", "entry", "=", "$", "this", "->",...
Returns an array of entry objects. @return array Array of entry objects.
[ "Returns", "an", "array", "of", "entry", "objects", "." ]
38f1b22a96dfbd7ec53852f0e1e7ec1a9a5eb0e8
https://github.com/pear/Net_LDAP2/blob/38f1b22a96dfbd7ec53852f0e1e7ec1a9a5eb0e8/Net/LDAP2/Search.php#L159-L172
228,794
pear/Net_LDAP2
Net/LDAP2/Search.php
Net_LDAP2_Search.shiftEntry
public function shiftEntry() { if (is_null($this->_entry)) { if(!$this->_entry = @ldap_first_entry($this->_link, $this->_search)) { $false = false; return $false; } $entry = Net_LDAP2_Entry::createConnected($this->_ldap, $this->_entry); ...
php
public function shiftEntry() { if (is_null($this->_entry)) { if(!$this->_entry = @ldap_first_entry($this->_link, $this->_search)) { $false = false; return $false; } $entry = Net_LDAP2_Entry::createConnected($this->_ldap, $this->_entry); ...
[ "public", "function", "shiftEntry", "(", ")", "{", "if", "(", "is_null", "(", "$", "this", "->", "_entry", ")", ")", "{", "if", "(", "!", "$", "this", "->", "_entry", "=", "@", "ldap_first_entry", "(", "$", "this", "->", "_link", ",", "$", "this", ...
Get the next entry in the searchresult from LDAP server. This will return a valid Net_LDAP2_Entry object or false, so you can use this method to easily iterate over the entries inside a while loop. @return Net_LDAP2_Entry|false Reference to Net_LDAP2_Entry object or false
[ "Get", "the", "next", "entry", "in", "the", "searchresult", "from", "LDAP", "server", "." ]
38f1b22a96dfbd7ec53852f0e1e7ec1a9a5eb0e8
https://github.com/pear/Net_LDAP2/blob/38f1b22a96dfbd7ec53852f0e1e7ec1a9a5eb0e8/Net/LDAP2/Search.php#L183-L201
228,795
pear/Net_LDAP2
Net/LDAP2/Search.php
Net_LDAP2_Search.popEntry
public function popEntry() { if (false === $this->_entry_cache) { // fetch entries into cache if not done so far $this->_entry_cache = $this->entries(); } $return = array_pop($this->_entry_cache); return (null === $return)? false : $return; }
php
public function popEntry() { if (false === $this->_entry_cache) { // fetch entries into cache if not done so far $this->_entry_cache = $this->entries(); } $return = array_pop($this->_entry_cache); return (null === $return)? false : $return; }
[ "public", "function", "popEntry", "(", ")", "{", "if", "(", "false", "===", "$", "this", "->", "_entry_cache", ")", "{", "// fetch entries into cache if not done so far", "$", "this", "->", "_entry_cache", "=", "$", "this", "->", "entries", "(", ")", ";", "}...
Retrieve the next entry in the searchresult, but starting from last entry This is the opposite to {@link shiftEntry()} and is also very useful to be used inside a while loop. @return Net_LDAP2_Entry|false
[ "Retrieve", "the", "next", "entry", "in", "the", "searchresult", "but", "starting", "from", "last", "entry" ]
38f1b22a96dfbd7ec53852f0e1e7ec1a9a5eb0e8
https://github.com/pear/Net_LDAP2/blob/38f1b22a96dfbd7ec53852f0e1e7ec1a9a5eb0e8/Net/LDAP2/Search.php#L223-L232
228,796
pear/Net_LDAP2
Net/LDAP2/Search.php
Net_LDAP2_Search.sorted_as_struct
public function sorted_as_struct($attrs = array('cn'), $order = SORT_ASC) { /* * Old Code, suitable and fast for single valued sorting * This code should be used if we know that single valued sorting is desired, * but we need some method to get that knowledge... */ /*...
php
public function sorted_as_struct($attrs = array('cn'), $order = SORT_ASC) { /* * Old Code, suitable and fast for single valued sorting * This code should be used if we know that single valued sorting is desired, * but we need some method to get that knowledge... */ /*...
[ "public", "function", "sorted_as_struct", "(", "$", "attrs", "=", "array", "(", "'cn'", ")", ",", "$", "order", "=", "SORT_ASC", ")", "{", "/*\n * Old Code, suitable and fast for single valued sorting\n * This code should be used if we know that single valued sortin...
Return entries sorted as array This returns a array with sorted entries and the values. Sorting is done with PHPs {@link array_multisort()}. This method relies on {@link as_struct()} to fetch the raw data of the entries. Please note that attribute names are case sensitive! Usage example: <code> // to sort entries fi...
[ "Return", "entries", "sorted", "as", "array" ]
38f1b22a96dfbd7ec53852f0e1e7ec1a9a5eb0e8
https://github.com/pear/Net_LDAP2/blob/38f1b22a96dfbd7ec53852f0e1e7ec1a9a5eb0e8/Net/LDAP2/Search.php#L267-L349
228,797
pear/Net_LDAP2
Net/LDAP2/Search.php
Net_LDAP2_Search.sorted
public function sorted($attrs = array('cn'), $order = SORT_ASC) { $return = array(); $sorted = $this->sorted_as_struct($attrs, $order); if (PEAR::isError($sorted)) { return $sorted; } foreach ($sorted as $key => $row) { $entry = $this->_ldap->getEntry(...
php
public function sorted($attrs = array('cn'), $order = SORT_ASC) { $return = array(); $sorted = $this->sorted_as_struct($attrs, $order); if (PEAR::isError($sorted)) { return $sorted; } foreach ($sorted as $key => $row) { $entry = $this->_ldap->getEntry(...
[ "public", "function", "sorted", "(", "$", "attrs", "=", "array", "(", "'cn'", ")", ",", "$", "order", "=", "SORT_ASC", ")", "{", "$", "return", "=", "array", "(", ")", ";", "$", "sorted", "=", "$", "this", "->", "sorted_as_struct", "(", "$", "attrs...
Return entries sorted as objects This returns a array with sorted Net_LDAP2_Entry objects. The sorting is actually done with {@link sorted_as_struct()}. Please note that attribute names are case sensitive! Also note, that it is (depending on server capabilitys) possible to let the server sort your results. This happe...
[ "Return", "entries", "sorted", "as", "objects" ]
38f1b22a96dfbd7ec53852f0e1e7ec1a9a5eb0e8
https://github.com/pear/Net_LDAP2/blob/38f1b22a96dfbd7ec53852f0e1e7ec1a9a5eb0e8/Net/LDAP2/Search.php#L374-L390
228,798
pear/Net_LDAP2
Net/LDAP2/Search.php
Net_LDAP2_Search.as_struct
public function as_struct() { $return = array(); $entries = $this->entries(); foreach ($entries as $entry) { $attrs = array(); $entry_attributes = $entry->attributes(); foreach ($entry_attributes as $attr_name) { $attr_values = ...
php
public function as_struct() { $return = array(); $entries = $this->entries(); foreach ($entries as $entry) { $attrs = array(); $entry_attributes = $entry->attributes(); foreach ($entry_attributes as $attr_name) { $attr_values = ...
[ "public", "function", "as_struct", "(", ")", "{", "$", "return", "=", "array", "(", ")", ";", "$", "entries", "=", "$", "this", "->", "entries", "(", ")", ";", "foreach", "(", "$", "entries", "as", "$", "entry", ")", "{", "$", "attrs", "=", "arra...
Return entries as array This method returns the entries and the selected attributes values as array. The first array level contains all found entries where the keys are the DNs of the entries. The second level arrays contian the entries attributes such that the keys is the lowercased name of the attribute and the valu...
[ "Return", "entries", "as", "array" ]
38f1b22a96dfbd7ec53852f0e1e7ec1a9a5eb0e8
https://github.com/pear/Net_LDAP2/blob/38f1b22a96dfbd7ec53852f0e1e7ec1a9a5eb0e8/Net/LDAP2/Search.php#L419-L436
228,799
pear/Net_LDAP2
Net/LDAP2/Search.php
Net_LDAP2_Search.count
public function count() { // this catches the situation where OL returned errno 32 = no such object! if (!$this->_search) { return 0; } // ldap_count_entries is slow (see pear bug #18752) with large results, // so we cache the result internally. if ($this-...
php
public function count() { // this catches the situation where OL returned errno 32 = no such object! if (!$this->_search) { return 0; } // ldap_count_entries is slow (see pear bug #18752) with large results, // so we cache the result internally. if ($this-...
[ "public", "function", "count", "(", ")", "{", "// this catches the situation where OL returned errno 32 = no such object!", "if", "(", "!", "$", "this", "->", "_search", ")", "{", "return", "0", ";", "}", "// ldap_count_entries is slow (see pear bug #18752) with large results...
Returns the number of entries in the searchresult @return int Number of entries in search.
[ "Returns", "the", "number", "of", "entries", "in", "the", "searchresult" ]
38f1b22a96dfbd7ec53852f0e1e7ec1a9a5eb0e8
https://github.com/pear/Net_LDAP2/blob/38f1b22a96dfbd7ec53852f0e1e7ec1a9a5eb0e8/Net/LDAP2/Search.php#L469-L482