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
27,900
RhubarbPHP/Rhubarb
src/Assets/Asset.php
Asset.writeToFile
public function writeToFile($filePath) { $out = @fopen($filePath,"w"); if (!$out){ throw new AssetException($this->token, "The asset '".$this->token."' could not be written to path '$filePath'. Check the path is valid and the directory exists."); } $stre...
php
public function writeToFile($filePath) { $out = @fopen($filePath,"w"); if (!$out){ throw new AssetException($this->token, "The asset '".$this->token."' could not be written to path '$filePath'. Check the path is valid and the directory exists."); } $stre...
[ "public", "function", "writeToFile", "(", "$", "filePath", ")", "{", "$", "out", "=", "@", "fopen", "(", "$", "filePath", ",", "\"w\"", ")", ";", "if", "(", "!", "$", "out", ")", "{", "throw", "new", "AssetException", "(", "$", "this", "->", "token...
Write the asset out to the corresponding file path. @param $filePath @throws AssetException
[ "Write", "the", "asset", "out", "to", "the", "corresponding", "file", "path", "." ]
327ff1f05d6a7e651d41c8e771f3551acfac18ae
https://github.com/RhubarbPHP/Rhubarb/blob/327ff1f05d6a7e651d41c8e771f3551acfac18ae/src/Assets/Asset.php#L105-L128
27,901
glorpen/GlorpenPropelBundle
src/Dispatcher/EventDispatcherProxy.php
EventDispatcherProxy.trigger
public static function trigger($name, Event $data) { if (self::$dispatcher) { if (!is_array($name)) { $name=array($name); } foreach ($name as $n) { call_user_func_array(self::$dispatcher, self::$dispatcher_args)->dispatch($n, $data); ...
php
public static function trigger($name, Event $data) { if (self::$dispatcher) { if (!is_array($name)) { $name=array($name); } foreach ($name as $n) { call_user_func_array(self::$dispatcher, self::$dispatcher_args)->dispatch($n, $data); ...
[ "public", "static", "function", "trigger", "(", "$", "name", ",", "Event", "$", "data", ")", "{", "if", "(", "self", "::", "$", "dispatcher", ")", "{", "if", "(", "!", "is_array", "(", "$", "name", ")", ")", "{", "$", "name", "=", "array", "(", ...
Triggers event. @param string $name @param Event $data one of Glorpen\Propel\PropelBundle\Events
[ "Triggers", "event", "." ]
b679c83377c81ab582de179f84bc23eaeb1e86aa
https://github.com/glorpen/GlorpenPropelBundle/blob/b679c83377c81ab582de179f84bc23eaeb1e86aa/src/Dispatcher/EventDispatcherProxy.php#L33-L43
27,902
mediact/testing-suite
src/ProjectTypeResolver.php
ProjectTypeResolver.resolve
public function resolve(): string { $packageType = $this->composer->getPackage()->getType(); return array_key_exists($packageType, $this->mapping) ? $this->mapping[$packageType] : 'default'; }
php
public function resolve(): string { $packageType = $this->composer->getPackage()->getType(); return array_key_exists($packageType, $this->mapping) ? $this->mapping[$packageType] : 'default'; }
[ "public", "function", "resolve", "(", ")", ":", "string", "{", "$", "packageType", "=", "$", "this", "->", "composer", "->", "getPackage", "(", ")", "->", "getType", "(", ")", ";", "return", "array_key_exists", "(", "$", "packageType", ",", "$", "this", ...
Get the type. @return string
[ "Get", "the", "type", "." ]
98614fe3b5c174e9bda2ff88d36d30349094dbc2
https://github.com/mediact/testing-suite/blob/98614fe3b5c174e9bda2ff88d36d30349094dbc2/src/ProjectTypeResolver.php#L42-L48
27,903
mediact/testing-suite
src/ConfigResolver.php
ConfigResolver.resolve
public function resolve(): array { $file = sprintf($this->template, $this->typeResolver->resolve()); if (!file_exists($file)) { $file = sprintf($this->template, 'default'); } return json_decode(file_get_contents($file), true); }
php
public function resolve(): array { $file = sprintf($this->template, $this->typeResolver->resolve()); if (!file_exists($file)) { $file = sprintf($this->template, 'default'); } return json_decode(file_get_contents($file), true); }
[ "public", "function", "resolve", "(", ")", ":", "array", "{", "$", "file", "=", "sprintf", "(", "$", "this", "->", "template", ",", "$", "this", "->", "typeResolver", "->", "resolve", "(", ")", ")", ";", "if", "(", "!", "file_exists", "(", "$", "fi...
Resolve config. @return array
[ "Resolve", "config", "." ]
98614fe3b5c174e9bda2ff88d36d30349094dbc2
https://github.com/mediact/testing-suite/blob/98614fe3b5c174e9bda2ff88d36d30349094dbc2/src/ConfigResolver.php#L36-L45
27,904
RhubarbPHP/Rhubarb
src/String/StringTools.php
StringTools.implodeIgnoringBlanks
public static function implodeIgnoringBlanks($glue, $array, $itemCallback = null, $keysToInclude = null) { $array = array_filter($array); if (!empty($itemCallback)) { foreach ($array as $key => $value) { $array[$key] = $itemCallback($value); } } ...
php
public static function implodeIgnoringBlanks($glue, $array, $itemCallback = null, $keysToInclude = null) { $array = array_filter($array); if (!empty($itemCallback)) { foreach ($array as $key => $value) { $array[$key] = $itemCallback($value); } } ...
[ "public", "static", "function", "implodeIgnoringBlanks", "(", "$", "glue", ",", "$", "array", ",", "$", "itemCallback", "=", "null", ",", "$", "keysToInclude", "=", "null", ")", "{", "$", "array", "=", "array_filter", "(", "$", "array", ")", ";", "if", ...
Removes all blanks in an array and merges them into a string @param string $glue String to include between each element @param array $array Array containing elements to be imploded @param string $itemCallback A transformation closure to call on each element of the array @param string $keysToInclude,... Keys of the arr...
[ "Removes", "all", "blanks", "in", "an", "array", "and", "merges", "them", "into", "a", "string" ]
327ff1f05d6a7e651d41c8e771f3551acfac18ae
https://github.com/RhubarbPHP/Rhubarb/blob/327ff1f05d6a7e651d41c8e771f3551acfac18ae/src/String/StringTools.php#L35-L69
27,905
RhubarbPHP/Rhubarb
src/String/StringTools.php
StringTools.makeSingular
public static function makeSingular($plural) { $plurals = ["ies" => "y", "es" => "", "s" => ""]; foreach ($plurals as $pluralEnding => $singularEnding) { $plural = preg_replace("/" . $pluralEnding . "$/i", $singularEnding, $plural); } return $plural; }
php
public static function makeSingular($plural) { $plurals = ["ies" => "y", "es" => "", "s" => ""]; foreach ($plurals as $pluralEnding => $singularEnding) { $plural = preg_replace("/" . $pluralEnding . "$/i", $singularEnding, $plural); } return $plural; }
[ "public", "static", "function", "makeSingular", "(", "$", "plural", ")", "{", "$", "plurals", "=", "[", "\"ies\"", "=>", "\"y\"", ",", "\"es\"", "=>", "\"\"", ",", "\"s\"", "=>", "\"\"", "]", ";", "foreach", "(", "$", "plurals", "as", "$", "pluralEndin...
Returns the English singular form of a plural word. @param $plural @return string
[ "Returns", "the", "English", "singular", "form", "of", "a", "plural", "word", "." ]
327ff1f05d6a7e651d41c8e771f3551acfac18ae
https://github.com/RhubarbPHP/Rhubarb/blob/327ff1f05d6a7e651d41c8e771f3551acfac18ae/src/String/StringTools.php#L89-L98
27,906
RhubarbPHP/Rhubarb
src/String/StringTools.php
StringTools.makePlural
public static function makePlural($singular) { $singulars = [ 'ey' => 'eys', 'day' => 'days', "ch" => "ches", "s" => "ses", "x" => "xes", "y" => "ies", ]; foreach ($singulars as $singularEnding => $pluralEnding) { ...
php
public static function makePlural($singular) { $singulars = [ 'ey' => 'eys', 'day' => 'days', "ch" => "ches", "s" => "ses", "x" => "xes", "y" => "ies", ]; foreach ($singulars as $singularEnding => $pluralEnding) { ...
[ "public", "static", "function", "makePlural", "(", "$", "singular", ")", "{", "$", "singulars", "=", "[", "'ey'", "=>", "'eys'", ",", "'day'", "=>", "'days'", ",", "\"ch\"", "=>", "\"ches\"", ",", "\"s\"", "=>", "\"ses\"", ",", "\"x\"", "=>", "\"xes\"", ...
Returns the English plural form of a singular word. @param $singular @return mixed|string
[ "Returns", "the", "English", "plural", "form", "of", "a", "singular", "word", "." ]
327ff1f05d6a7e651d41c8e771f3551acfac18ae
https://github.com/RhubarbPHP/Rhubarb/blob/327ff1f05d6a7e651d41c8e771f3551acfac18ae/src/String/StringTools.php#L107-L125
27,907
RhubarbPHP/Rhubarb
src/String/StringTools.php
StringTools.replaceFirst
public static function replaceFirst($search, $replace, $subject, $caseSensitive = true) { if ($caseSensitive) { $pos = strpos($subject, $search); } else { $pos = stripos($subject, $search); } if ($pos !== false) { return substr_replace($subject, $r...
php
public static function replaceFirst($search, $replace, $subject, $caseSensitive = true) { if ($caseSensitive) { $pos = strpos($subject, $search); } else { $pos = stripos($subject, $search); } if ($pos !== false) { return substr_replace($subject, $r...
[ "public", "static", "function", "replaceFirst", "(", "$", "search", ",", "$", "replace", ",", "$", "subject", ",", "$", "caseSensitive", "=", "true", ")", "{", "if", "(", "$", "caseSensitive", ")", "{", "$", "pos", "=", "strpos", "(", "$", "subject", ...
Replaces only the first matched instance of a string @param string $search @param string $replace @param string $subject @param bool $caseSensitive @return mixed
[ "Replaces", "only", "the", "first", "matched", "instance", "of", "a", "string" ]
327ff1f05d6a7e651d41c8e771f3551acfac18ae
https://github.com/RhubarbPHP/Rhubarb/blob/327ff1f05d6a7e651d41c8e771f3551acfac18ae/src/String/StringTools.php#L391-L402
27,908
RhubarbPHP/Rhubarb
src/String/StringTools.php
StringTools.camelCaseToSeparated
public static function camelCaseToSeparated($string, $separator = '-', $toLowerCase = true) { $separated = preg_replace(['/([a-z\d])([A-Z])/', '/([^' . preg_quote($separator) . '])([A-Z][a-z])/'], '$1' . $separator . '$2', $string); return $toLowerCase ? strtolower($separated) : $separated; }
php
public static function camelCaseToSeparated($string, $separator = '-', $toLowerCase = true) { $separated = preg_replace(['/([a-z\d])([A-Z])/', '/([^' . preg_quote($separator) . '])([A-Z][a-z])/'], '$1' . $separator . '$2', $string); return $toLowerCase ? strtolower($separated) : $separated; }
[ "public", "static", "function", "camelCaseToSeparated", "(", "$", "string", ",", "$", "separator", "=", "'-'", ",", "$", "toLowerCase", "=", "true", ")", "{", "$", "separated", "=", "preg_replace", "(", "[", "'/([a-z\\d])([A-Z])/'", ",", "'/([^'", ".", "preg...
Converts a string from CamelCasing to separated-words, with specifiable separator and lowercase conversion. @param $string @param string $separator The character to separate the words with @param bool $toLowerCase @return string
[ "Converts", "a", "string", "from", "CamelCasing", "to", "separated", "-", "words", "with", "specifiable", "separator", "and", "lowercase", "conversion", "." ]
327ff1f05d6a7e651d41c8e771f3551acfac18ae
https://github.com/RhubarbPHP/Rhubarb/blob/327ff1f05d6a7e651d41c8e771f3551acfac18ae/src/String/StringTools.php#L412-L416
27,909
RhubarbPHP/Rhubarb
src/String/StringTools.php
StringTools.detectHashTags
public static function detectHashTags($text, callable $formatHashTag = null, $url = '', $openLinksInNewWindow = true) { if ($formatHashTag == null) { $formatHashTag = function ($hashTag) use ($url, $openLinksInNewWindow) { return '<a href="' . $url . urlencode($hashTag) . ($openL...
php
public static function detectHashTags($text, callable $formatHashTag = null, $url = '', $openLinksInNewWindow = true) { if ($formatHashTag == null) { $formatHashTag = function ($hashTag) use ($url, $openLinksInNewWindow) { return '<a href="' . $url . urlencode($hashTag) . ($openL...
[ "public", "static", "function", "detectHashTags", "(", "$", "text", ",", "callable", "$", "formatHashTag", "=", "null", ",", "$", "url", "=", "''", ",", "$", "openLinksInNewWindow", "=", "true", ")", "{", "if", "(", "$", "formatHashTag", "==", "null", ")...
Detects HashTags in a string and calls a callback function for each. Default behaviour is to insert HTML links for each HashTag. @param string $text String to find HashTags in @param callable|null $formatHashTag Will be called for each HashTag detected. If null, default behaviour will happen (inserting a link for ea...
[ "Detects", "HashTags", "in", "a", "string", "and", "calls", "a", "callback", "function", "for", "each", ".", "Default", "behaviour", "is", "to", "insert", "HTML", "links", "for", "each", "HashTag", "." ]
327ff1f05d6a7e651d41c8e771f3551acfac18ae
https://github.com/RhubarbPHP/Rhubarb/blob/327ff1f05d6a7e651d41c8e771f3551acfac18ae/src/String/StringTools.php#L458-L473
27,910
byjg/cache-engine-php
src/Psr16/FileSystemCacheEngine.php
FileSystemCacheEngine.lock
public function lock($key) { $this->logger->info("[Filesystem cache] Lock '$key'"); $lockFile = $this->fixKey($key) . ".lock"; try { file_put_contents($lockFile, date('c')); } catch (Exception $ex) { // Ignoring... Set will cause an error } }
php
public function lock($key) { $this->logger->info("[Filesystem cache] Lock '$key'"); $lockFile = $this->fixKey($key) . ".lock"; try { file_put_contents($lockFile, date('c')); } catch (Exception $ex) { // Ignoring... Set will cause an error } }
[ "public", "function", "lock", "(", "$", "key", ")", "{", "$", "this", "->", "logger", "->", "info", "(", "\"[Filesystem cache] Lock '$key'\"", ")", ";", "$", "lockFile", "=", "$", "this", "->", "fixKey", "(", "$", "key", ")", ".", "\".lock\"", ";", "tr...
Lock resource before set it. @param string $key
[ "Lock", "resource", "before", "set", "it", "." ]
001281edc3be6d908e7865b836cb6b43bd61a5cc
https://github.com/byjg/cache-engine-php/blob/001281edc3be6d908e7865b836cb6b43bd61a5cc/src/Psr16/FileSystemCacheEngine.php#L130-L141
27,911
byjg/cache-engine-php
src/Psr16/FileSystemCacheEngine.php
FileSystemCacheEngine.unlock
public function unlock($key) { $this->logger->info("[Filesystem cache] Unlock '$key'"); $lockFile = $this->fixKey($key) . ".lock"; if (file_exists($lockFile)) { unlink($lockFile); } }
php
public function unlock($key) { $this->logger->info("[Filesystem cache] Unlock '$key'"); $lockFile = $this->fixKey($key) . ".lock"; if (file_exists($lockFile)) { unlink($lockFile); } }
[ "public", "function", "unlock", "(", "$", "key", ")", "{", "$", "this", "->", "logger", "->", "info", "(", "\"[Filesystem cache] Unlock '$key'\"", ")", ";", "$", "lockFile", "=", "$", "this", "->", "fixKey", "(", "$", "key", ")", ".", "\".lock\"", ";", ...
UnLock resource after set it. @param string $key
[ "UnLock", "resource", "after", "set", "it", "." ]
001281edc3be6d908e7865b836cb6b43bd61a5cc
https://github.com/byjg/cache-engine-php/blob/001281edc3be6d908e7865b836cb6b43bd61a5cc/src/Psr16/FileSystemCacheEngine.php#L147-L157
27,912
FoxyCart/foxyclient-php
src/Foxy/FoxyClient/FoxyClient.php
FoxyClient.saveLinks
public function saveLinks($data) { if (isset($data['_links'])) { foreach ($data['_links'] as $rel => $link) { if (!in_array($rel, $this->registered_link_relations) && $rel != 'curies' && $rel.'/' != static::LINK_RELATIONSHIPS_BASE_URI) { ...
php
public function saveLinks($data) { if (isset($data['_links'])) { foreach ($data['_links'] as $rel => $link) { if (!in_array($rel, $this->registered_link_relations) && $rel != 'curies' && $rel.'/' != static::LINK_RELATIONSHIPS_BASE_URI) { ...
[ "public", "function", "saveLinks", "(", "$", "data", ")", "{", "if", "(", "isset", "(", "$", "data", "[", "'_links'", "]", ")", ")", "{", "foreach", "(", "$", "data", "[", "'_links'", "]", "as", "$", "rel", "=>", "$", "link", ")", "{", "if", "(...
Save Links to the Object For Easy Retrieval Later
[ "Save", "Links", "to", "the", "Object", "For", "Easy", "Retrieval", "Later" ]
592fb81ec14afb04d6463682454c4d2263db4a04
https://github.com/FoxyCart/foxyclient-php/blob/592fb81ec14afb04d6463682454c4d2263db4a04/src/Foxy/FoxyClient/FoxyClient.php#L294-L314
27,913
FoxyCart/foxyclient-php
src/Foxy/FoxyClient/FoxyClient.php
FoxyClient.getErrors
public function getErrors($data) { $errors = array(); if ($this->getLastStatusCode() >= 400) { if (isset($data['error_description'])) { $errors[] = $data['error_description']; } elseif (isset($data['_embedded']['fx:errors'])) { foreach ($data['...
php
public function getErrors($data) { $errors = array(); if ($this->getLastStatusCode() >= 400) { if (isset($data['error_description'])) { $errors[] = $data['error_description']; } elseif (isset($data['_embedded']['fx:errors'])) { foreach ($data['...
[ "public", "function", "getErrors", "(", "$", "data", ")", "{", "$", "errors", "=", "array", "(", ")", ";", "if", "(", "$", "this", "->", "getLastStatusCode", "(", ")", ">=", "400", ")", "{", "if", "(", "isset", "(", "$", "data", "[", "'error_descri...
Return any errors that exist in the response data.
[ "Return", "any", "errors", "that", "exist", "in", "the", "response", "data", "." ]
592fb81ec14afb04d6463682454c4d2263db4a04
https://github.com/FoxyCart/foxyclient-php/blob/592fb81ec14afb04d6463682454c4d2263db4a04/src/Foxy/FoxyClient/FoxyClient.php#L356-L371
27,914
FoxyCart/foxyclient-php
src/Foxy/FoxyClient/FoxyClient.php
FoxyClient.getHeaders
public function getHeaders() { $headers = array( 'FOXY-API-VERSION' => 1 ); if ($this->access_token && $this->include_auth_header) { $headers['Authorization'] = "Bearer " . $this->access_token; } $headers['Accept'] = $this->getAcceptContentType(); ...
php
public function getHeaders() { $headers = array( 'FOXY-API-VERSION' => 1 ); if ($this->access_token && $this->include_auth_header) { $headers['Authorization'] = "Bearer " . $this->access_token; } $headers['Accept'] = $this->getAcceptContentType(); ...
[ "public", "function", "getHeaders", "(", ")", "{", "$", "headers", "=", "array", "(", "'FOXY-API-VERSION'", "=>", "1", ")", ";", "if", "(", "$", "this", "->", "access_token", "&&", "$", "this", "->", "include_auth_header", ")", "{", "$", "headers", "[", ...
Get headers for this call
[ "Get", "headers", "for", "this", "call" ]
592fb81ec14afb04d6463682454c4d2263db4a04
https://github.com/FoxyCart/foxyclient-php/blob/592fb81ec14afb04d6463682454c4d2263db4a04/src/Foxy/FoxyClient/FoxyClient.php#L398-L409
27,915
ldaptools/ldaptools
src/LdapTools/Operation/Handler/AuthenticationOperationHandler.php
AuthenticationOperationHandler.getAuthenticationResponse
protected function getAuthenticationResponse(AuthenticationOperation $operation) { $authenticated = false; $errorMessage = null; $errorCode = null; // Only catch a bind failure. Let the others through, as it's probably a sign of other issues. try { $authenticated...
php
protected function getAuthenticationResponse(AuthenticationOperation $operation) { $authenticated = false; $errorMessage = null; $errorCode = null; // Only catch a bind failure. Let the others through, as it's probably a sign of other issues. try { $authenticated...
[ "protected", "function", "getAuthenticationResponse", "(", "AuthenticationOperation", "$", "operation", ")", "{", "$", "authenticated", "=", "false", ";", "$", "errorMessage", "=", "null", ";", "$", "errorCode", "=", "null", ";", "// Only catch a bind failure. Let the...
Attempts to connect with the given credentials and returns the response. @param AuthenticationOperation $operation @return AuthenticationResponse
[ "Attempts", "to", "connect", "with", "the", "given", "credentials", "and", "returns", "the", "response", "." ]
b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7
https://github.com/ldaptools/ldaptools/blob/b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7/src/LdapTools/Operation/Handler/AuthenticationOperationHandler.php#L66-L81
27,916
ldaptools/ldaptools
src/LdapTools/Operation/Handler/AuthenticationOperationHandler.php
AuthenticationOperationHandler.switchCredentials
protected function switchCredentials(AuthenticationOperation $operation) { $this->connection->getConfig()->setUsername($operation->getUsername()); $this->connection->getConfig()->setPassword($operation->getPassword()); }
php
protected function switchCredentials(AuthenticationOperation $operation) { $this->connection->getConfig()->setUsername($operation->getUsername()); $this->connection->getConfig()->setPassword($operation->getPassword()); }
[ "protected", "function", "switchCredentials", "(", "AuthenticationOperation", "$", "operation", ")", "{", "$", "this", "->", "connection", "->", "getConfig", "(", ")", "->", "setUsername", "(", "$", "operation", "->", "getUsername", "(", ")", ")", ";", "$", ...
If the operation requested that the credentials be switched, then update the credential information in the connections config. Otherwise it will switch again on other auth-attempts or re-connects. @param AuthenticationOperation $operation
[ "If", "the", "operation", "requested", "that", "the", "credentials", "be", "switched", "then", "update", "the", "credential", "information", "in", "the", "connections", "config", ".", "Otherwise", "it", "will", "switch", "again", "on", "other", "auth", "-", "a...
b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7
https://github.com/ldaptools/ldaptools/blob/b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7/src/LdapTools/Operation/Handler/AuthenticationOperationHandler.php#L89-L93
27,917
ldaptools/ldaptools
src/LdapTools/Utilities/ADTimeSpan.php
ADTimeSpan.getLdapValue
public function getLdapValue() { if ($this->never) { $value = self::NEVER; } else { $total = 0; foreach (self::UNIT as $unit => $conversion) { $total += $this->$unit * $conversion; } $value = number_format($total, 0, '.', ''...
php
public function getLdapValue() { if ($this->never) { $value = self::NEVER; } else { $total = 0; foreach (self::UNIT as $unit => $conversion) { $total += $this->$unit * $conversion; } $value = number_format($total, 0, '.', ''...
[ "public", "function", "getLdapValue", "(", ")", "{", "if", "(", "$", "this", "->", "never", ")", "{", "$", "value", "=", "self", "::", "NEVER", ";", "}", "else", "{", "$", "total", "=", "0", ";", "foreach", "(", "self", "::", "UNIT", "as", "$", ...
Get the value of all the time units in the format that LDAP expects it in. @return string
[ "Get", "the", "value", "of", "all", "the", "time", "units", "in", "the", "format", "that", "LDAP", "expects", "it", "in", "." ]
b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7
https://github.com/ldaptools/ldaptools/blob/b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7/src/LdapTools/Utilities/ADTimeSpan.php#L214-L227
27,918
ldaptools/ldaptools
src/LdapTools/Utilities/ADTimeSpan.php
ADTimeSpan.getInstance
public static function getInstance($value, $unit) { if (!array_key_exists($unit, self::UNIT)) { throw new InvalidArgumentException('Time unit "%s" is not recognized.', $unit); } $setter = 'set'.ucfirst($unit); return (new self)->$setter($value); }
php
public static function getInstance($value, $unit) { if (!array_key_exists($unit, self::UNIT)) { throw new InvalidArgumentException('Time unit "%s" is not recognized.', $unit); } $setter = 'set'.ucfirst($unit); return (new self)->$setter($value); }
[ "public", "static", "function", "getInstance", "(", "$", "value", ",", "$", "unit", ")", "{", "if", "(", "!", "array_key_exists", "(", "$", "unit", ",", "self", "::", "UNIT", ")", ")", "{", "throw", "new", "InvalidArgumentException", "(", "'Time unit \"%s\...
Get an instance of the class based on a specific time unit as the second parameter. @param int $value The time value. @param string $unit The time unit. One of the constants of this class: DAYS, HOURS, MINUTES, SECONDS. @return $this
[ "Get", "an", "instance", "of", "the", "class", "based", "on", "a", "specific", "time", "unit", "as", "the", "second", "parameter", "." ]
b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7
https://github.com/ldaptools/ldaptools/blob/b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7/src/LdapTools/Utilities/ADTimeSpan.php#L236-L244
27,919
ldaptools/ldaptools
src/LdapTools/Utilities/ADTimeSpan.php
ADTimeSpan.setAndVerify
protected function setAndVerify($value, $interval) { if (!filter_var($value, FILTER_VALIDATE_INT) && $value != '0') { throw new InvalidArgumentException(sprintf("The %s should be an integer.", $interval)); } $this->$interval = $value; }
php
protected function setAndVerify($value, $interval) { if (!filter_var($value, FILTER_VALIDATE_INT) && $value != '0') { throw new InvalidArgumentException(sprintf("The %s should be an integer.", $interval)); } $this->$interval = $value; }
[ "protected", "function", "setAndVerify", "(", "$", "value", ",", "$", "interval", ")", "{", "if", "(", "!", "filter_var", "(", "$", "value", ",", "FILTER_VALIDATE_INT", ")", "&&", "$", "value", "!=", "'0'", ")", "{", "throw", "new", "InvalidArgumentExcepti...
Verify the value is an integer and set the correct interval value. @param int $value @param string $interval
[ "Verify", "the", "value", "is", "an", "integer", "and", "set", "the", "correct", "interval", "value", "." ]
b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7
https://github.com/ldaptools/ldaptools/blob/b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7/src/LdapTools/Utilities/ADTimeSpan.php#L270-L276
27,920
ldaptools/ldaptools
src/LdapTools/Utilities/ADTimeSpan.php
ADTimeSpan.setValuesFromLdap
protected function setValuesFromLdap($time) { if ($time == self::NEVER) { $this->setNever(true); } else { $seconds = $time / self::UNIT[self::SECONDS]; $dtBase = new \DateTime('@0'); $dtSeconds = new \DateTime('@' . $seconds); $this->setD...
php
protected function setValuesFromLdap($time) { if ($time == self::NEVER) { $this->setNever(true); } else { $seconds = $time / self::UNIT[self::SECONDS]; $dtBase = new \DateTime('@0'); $dtSeconds = new \DateTime('@' . $seconds); $this->setD...
[ "protected", "function", "setValuesFromLdap", "(", "$", "time", ")", "{", "if", "(", "$", "time", "==", "self", "::", "NEVER", ")", "{", "$", "this", "->", "setNever", "(", "true", ")", ";", "}", "else", "{", "$", "seconds", "=", "$", "time", "/", ...
Given a time format from LDAP break it down into its individual time units and set them. @param int $time
[ "Given", "a", "time", "format", "from", "LDAP", "break", "it", "down", "into", "its", "individual", "time", "units", "and", "set", "them", "." ]
b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7
https://github.com/ldaptools/ldaptools/blob/b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7/src/LdapTools/Utilities/ADTimeSpan.php#L283-L298
27,921
ldaptools/ldaptools
src/LdapTools/Log/LoggerChain.php
LoggerChain.start
public function start(LogOperation $operation) { foreach ($this->loggers as $logger) { $logger->start($operation); } }
php
public function start(LogOperation $operation) { foreach ($this->loggers as $logger) { $logger->start($operation); } }
[ "public", "function", "start", "(", "LogOperation", "$", "operation", ")", "{", "foreach", "(", "$", "this", "->", "loggers", "as", "$", "logger", ")", "{", "$", "logger", "->", "start", "(", "$", "operation", ")", ";", "}", "}" ]
The start of a logging operation. Initiated on each logger in the chain. @param LogOperation $operation
[ "The", "start", "of", "a", "logging", "operation", ".", "Initiated", "on", "each", "logger", "in", "the", "chain", "." ]
b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7
https://github.com/ldaptools/ldaptools/blob/b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7/src/LdapTools/Log/LoggerChain.php#L40-L45
27,922
ldaptools/ldaptools
src/LdapTools/Log/LoggerChain.php
LoggerChain.end
public function end(LogOperation $operation) { foreach ($this->loggers as $logger) { $logger->end($operation); } }
php
public function end(LogOperation $operation) { foreach ($this->loggers as $logger) { $logger->end($operation); } }
[ "public", "function", "end", "(", "LogOperation", "$", "operation", ")", "{", "foreach", "(", "$", "this", "->", "loggers", "as", "$", "logger", ")", "{", "$", "logger", "->", "end", "(", "$", "operation", ")", ";", "}", "}" ]
The end of a logging operation. Initiated on each logger in the chain. @param LogOperation $operation
[ "The", "end", "of", "a", "logging", "operation", ".", "Initiated", "on", "each", "logger", "in", "the", "chain", "." ]
b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7
https://github.com/ldaptools/ldaptools/blob/b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7/src/LdapTools/Log/LoggerChain.php#L52-L57
27,923
ldaptools/ldaptools
src/LdapTools/Operation/AuthenticationOperation.php
AuthenticationOperation.validateArguments
protected function validateArguments() { if ($this->getIsAnonymousBind()) { return; } if (empty($this->properties['username']) || empty($this->properties['password'])) { throw new LdapBindException("You must specify a username and password."); } }
php
protected function validateArguments() { if ($this->getIsAnonymousBind()) { return; } if (empty($this->properties['username']) || empty($this->properties['password'])) { throw new LdapBindException("You must specify a username and password."); } }
[ "protected", "function", "validateArguments", "(", ")", "{", "if", "(", "$", "this", "->", "getIsAnonymousBind", "(", ")", ")", "{", "return", ";", "}", "if", "(", "empty", "(", "$", "this", "->", "properties", "[", "'username'", "]", ")", "||", "empty...
Validates that the arguments given don't have any issues. @throws LdapBindException
[ "Validates", "that", "the", "arguments", "given", "don", "t", "have", "any", "issues", "." ]
b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7
https://github.com/ldaptools/ldaptools/blob/b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7/src/LdapTools/Operation/AuthenticationOperation.php#L190-L198
27,924
ldaptools/ldaptools
src/LdapTools/Query/Operator/bNot.php
bNot.isOperatorAllowed
protected function isOperatorAllowed(BaseOperator $operator) { if (!empty($this->children)) { throw new \RuntimeException('The "Not" operator can only have 1 child operator.'); } if ($operator instanceof ContainsOperatorsInterface) { throw new LdapQueryException('Cann...
php
protected function isOperatorAllowed(BaseOperator $operator) { if (!empty($this->children)) { throw new \RuntimeException('The "Not" operator can only have 1 child operator.'); } if ($operator instanceof ContainsOperatorsInterface) { throw new LdapQueryException('Cann...
[ "protected", "function", "isOperatorAllowed", "(", "BaseOperator", "$", "operator", ")", "{", "if", "(", "!", "empty", "(", "$", "this", "->", "children", ")", ")", "{", "throw", "new", "\\", "RuntimeException", "(", "'The \"Not\" operator can only have 1 child op...
The 'Not' operator has a few specific requirements. Check these here. @param BaseOperator $operator @throws LdapQueryException
[ "The", "Not", "operator", "has", "a", "few", "specific", "requirements", ".", "Check", "these", "here", "." ]
b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7
https://github.com/ldaptools/ldaptools/blob/b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7/src/LdapTools/Query/Operator/bNot.php#L53-L61
27,925
ldaptools/ldaptools
src/LdapTools/Ldif/Entry/LdifEntryModify.php
LdifEntryModify.add
public function add($attribute, $value) { $this->batches->add(new Batch(Batch::TYPE['ADD'], $attribute, $value)); return $this; }
php
public function add($attribute, $value) { $this->batches->add(new Batch(Batch::TYPE['ADD'], $attribute, $value)); return $this; }
[ "public", "function", "add", "(", "$", "attribute", ",", "$", "value", ")", "{", "$", "this", "->", "batches", "->", "add", "(", "new", "Batch", "(", "Batch", "::", "TYPE", "[", "'ADD'", "]", ",", "$", "attribute", ",", "$", "value", ")", ")", ";...
Add a value to the attribute for the LDAP object. @param $attribute @param $value @return $this
[ "Add", "a", "value", "to", "the", "attribute", "for", "the", "LDAP", "object", "." ]
b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7
https://github.com/ldaptools/ldaptools/blob/b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7/src/LdapTools/Ldif/Entry/LdifEntryModify.php#L87-L92
27,926
ldaptools/ldaptools
src/LdapTools/Security/Acl/Acl.php
Acl.setRevision
public function setRevision($revision) { if (!in_array((int) $revision, self::REVISION)) { throw new InvalidArgumentException(sprintf( 'The value "%s" is not a recognized revision number. Allowed revisions are: %s', $revision, implode(', ', self::R...
php
public function setRevision($revision) { if (!in_array((int) $revision, self::REVISION)) { throw new InvalidArgumentException(sprintf( 'The value "%s" is not a recognized revision number. Allowed revisions are: %s', $revision, implode(', ', self::R...
[ "public", "function", "setRevision", "(", "$", "revision", ")", "{", "if", "(", "!", "in_array", "(", "(", "int", ")", "$", "revision", ",", "self", "::", "REVISION", ")", ")", "{", "throw", "new", "InvalidArgumentException", "(", "sprintf", "(", "'The v...
Set the revision of the ACL. @param int $revision @return $this
[ "Set", "the", "revision", "of", "the", "ACL", "." ]
b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7
https://github.com/ldaptools/ldaptools/blob/b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7/src/LdapTools/Security/Acl/Acl.php#L89-L101
27,927
ldaptools/ldaptools
src/LdapTools/Security/Acl/Acl.php
Acl.addAce
public function addAce(Ace ...$aces) { foreach ($aces as $ace) { $this->validateAce($ace); if (!$this->hasAce($ace)) { $this->aces[] = $ace; } } return $this; }
php
public function addAce(Ace ...$aces) { foreach ($aces as $ace) { $this->validateAce($ace); if (!$this->hasAce($ace)) { $this->aces[] = $ace; } } return $this; }
[ "public", "function", "addAce", "(", "Ace", "...", "$", "aces", ")", "{", "foreach", "(", "$", "aces", "as", "$", "ace", ")", "{", "$", "this", "->", "validateAce", "(", "$", "ace", ")", ";", "if", "(", "!", "$", "this", "->", "hasAce", "(", "$...
Add one or more ACEs to the ACL. @param Ace[] ...$aces @return $this
[ "Add", "one", "or", "more", "ACEs", "to", "the", "ACL", "." ]
b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7
https://github.com/ldaptools/ldaptools/blob/b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7/src/LdapTools/Security/Acl/Acl.php#L168-L178
27,928
ldaptools/ldaptools
src/LdapTools/Security/Acl/Acl.php
Acl.removeAce
public function removeAce(Ace ...$aces) { foreach ($aces as $ace) { if ($this->hasAce($ace)) { unset($this->aces[array_search($ace, $this->aces)]); } } return $this; }
php
public function removeAce(Ace ...$aces) { foreach ($aces as $ace) { if ($this->hasAce($ace)) { unset($this->aces[array_search($ace, $this->aces)]); } } return $this; }
[ "public", "function", "removeAce", "(", "Ace", "...", "$", "aces", ")", "{", "foreach", "(", "$", "aces", "as", "$", "ace", ")", "{", "if", "(", "$", "this", "->", "hasAce", "(", "$", "ace", ")", ")", "{", "unset", "(", "$", "this", "->", "aces...
Remove one or more ACEs from the ACL. @param Ace[] ...$aces @return $this
[ "Remove", "one", "or", "more", "ACEs", "from", "the", "ACL", "." ]
b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7
https://github.com/ldaptools/ldaptools/blob/b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7/src/LdapTools/Security/Acl/Acl.php#L186-L195
27,929
ldaptools/ldaptools
src/LdapTools/Security/Acl/Acl.php
Acl.hasAce
public function hasAce(Ace ...$aces) { $inArray = false; foreach ($aces as $ace) { $inArray = in_array($ace, $this->aces, true); } return $inArray; }
php
public function hasAce(Ace ...$aces) { $inArray = false; foreach ($aces as $ace) { $inArray = in_array($ace, $this->aces, true); } return $inArray; }
[ "public", "function", "hasAce", "(", "Ace", "...", "$", "aces", ")", "{", "$", "inArray", "=", "false", ";", "foreach", "(", "$", "aces", "as", "$", "ace", ")", "{", "$", "inArray", "=", "in_array", "(", "$", "ace", ",", "$", "this", "->", "aces"...
Check if an ACE, or multiple ACEs, exist within this ACL. @param Ace[] ...$aces @return bool
[ "Check", "if", "an", "ACE", "or", "multiple", "ACEs", "exist", "within", "this", "ACL", "." ]
b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7
https://github.com/ldaptools/ldaptools/blob/b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7/src/LdapTools/Security/Acl/Acl.php#L203-L212
27,930
ldaptools/ldaptools
src/LdapTools/Security/Acl/Acl.php
Acl.toBinary
public function toBinary() { $aces = ''; foreach ($this->aces as $ace) { $aces .= $ace->toBinary(); } return pack( 'C1C1v1v1v1', $this->revision, $this->sbz1, ((16 + (strlen(bin2hex($aces)))) / 2), count($this->...
php
public function toBinary() { $aces = ''; foreach ($this->aces as $ace) { $aces .= $ace->toBinary(); } return pack( 'C1C1v1v1v1', $this->revision, $this->sbz1, ((16 + (strlen(bin2hex($aces)))) / 2), count($this->...
[ "public", "function", "toBinary", "(", ")", "{", "$", "aces", "=", "''", ";", "foreach", "(", "$", "this", "->", "aces", "as", "$", "ace", ")", "{", "$", "aces", ".=", "$", "ace", "->", "toBinary", "(", ")", ";", "}", "return", "pack", "(", "'C...
Get the binary string representation of the ACL. @return string
[ "Get", "the", "binary", "string", "representation", "of", "the", "ACL", "." ]
b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7
https://github.com/ldaptools/ldaptools/blob/b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7/src/LdapTools/Security/Acl/Acl.php#L229-L244
27,931
ldaptools/ldaptools
src/LdapTools/Connection/RootDse.php
RootDse.get
public function get() { $anonymous = !$this->connection->isBound(); try { $rootDse = self::doLdapQuery($anonymous); } catch (\Exception $e) { throw new LdapConnectionException(sprintf( 'Unable to query the RootDSE. %s', $e->getMessage(...
php
public function get() { $anonymous = !$this->connection->isBound(); try { $rootDse = self::doLdapQuery($anonymous); } catch (\Exception $e) { throw new LdapConnectionException(sprintf( 'Unable to query the RootDSE. %s', $e->getMessage(...
[ "public", "function", "get", "(", ")", "{", "$", "anonymous", "=", "!", "$", "this", "->", "connection", "->", "isBound", "(", ")", ";", "try", "{", "$", "rootDse", "=", "self", "::", "doLdapQuery", "(", "$", "anonymous", ")", ";", "}", "catch", "(...
Get the RootDSE LdapObject while accounting for the state of the connection. @return \LdapTools\Object\LdapObject @throws LdapConnectionException
[ "Get", "the", "RootDSE", "LdapObject", "while", "accounting", "for", "the", "state", "of", "the", "connection", "." ]
b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7
https://github.com/ldaptools/ldaptools/blob/b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7/src/LdapTools/Connection/RootDse.php#L73-L92
27,932
ldaptools/ldaptools
src/LdapTools/Connection/RootDse.php
RootDse.doLdapQuery
protected function doLdapQuery($anonymous) { if ($anonymous) { $this->connection->connect('', '', true); } $schema = $this->schemaFactory->get(self::SCHEMA_ROOTDSE_NAME, $this->connection->getConfig()->getLdapType()); return (new LdapQueryBuilder($this->connectio...
php
protected function doLdapQuery($anonymous) { if ($anonymous) { $this->connection->connect('', '', true); } $schema = $this->schemaFactory->get(self::SCHEMA_ROOTDSE_NAME, $this->connection->getConfig()->getLdapType()); return (new LdapQueryBuilder($this->connectio...
[ "protected", "function", "doLdapQuery", "(", "$", "anonymous", ")", "{", "if", "(", "$", "anonymous", ")", "{", "$", "this", "->", "connection", "->", "connect", "(", "''", ",", "''", ",", "true", ")", ";", "}", "$", "schema", "=", "$", "this", "->...
Do the LDAP query to get the LDAP object. @param bool $anonymous @return \LdapTools\Object\LdapObject
[ "Do", "the", "LDAP", "query", "to", "get", "the", "LDAP", "object", "." ]
b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7
https://github.com/ldaptools/ldaptools/blob/b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7/src/LdapTools/Connection/RootDse.php#L100-L108
27,933
ldaptools/ldaptools
src/LdapTools/Utilities/TSPropertyArray.php
TSPropertyArray.toBinary
public function toBinary() { $binary = hex2bin(str_pad(dechex(ord($this->signature)), 2, 0, STR_PAD_LEFT)); $binary .= hex2bin(str_pad(dechex(count($this->tsProperty)), 2, 0, STR_PAD_LEFT)); foreach ($this->tsProperty as $tsProperty) { $binary .= $tsProperty->toBinary(); ...
php
public function toBinary() { $binary = hex2bin(str_pad(dechex(ord($this->signature)), 2, 0, STR_PAD_LEFT)); $binary .= hex2bin(str_pad(dechex(count($this->tsProperty)), 2, 0, STR_PAD_LEFT)); foreach ($this->tsProperty as $tsProperty) { $binary .= $tsProperty->toBinary(); ...
[ "public", "function", "toBinary", "(", ")", "{", "$", "binary", "=", "hex2bin", "(", "str_pad", "(", "dechex", "(", "ord", "(", "$", "this", "->", "signature", ")", ")", ",", "2", ",", "0", ",", "STR_PAD_LEFT", ")", ")", ";", "$", "binary", ".=", ...
Get the full binary representation of the userParameters containing the TSPropertyArray data. @return string
[ "Get", "the", "full", "binary", "representation", "of", "the", "userParameters", "containing", "the", "TSPropertyArray", "data", "." ]
b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7
https://github.com/ldaptools/ldaptools/blob/b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7/src/LdapTools/Utilities/TSPropertyArray.php#L163-L172
27,934
ldaptools/ldaptools
src/LdapTools/Utilities/TSPropertyArray.php
TSPropertyArray.decode
protected function decode($tsPropArray) { $tsPropArray = bin2hex($tsPropArray); // The signature is a 2-byte unicode character at the front $this->signature = chr(hexdec(substr($tsPropArray, 0, 2))); // The property count is a 2-byte unsigned integer indicating the number of elements...
php
protected function decode($tsPropArray) { $tsPropArray = bin2hex($tsPropArray); // The signature is a 2-byte unicode character at the front $this->signature = chr(hexdec(substr($tsPropArray, 0, 2))); // The property count is a 2-byte unsigned integer indicating the number of elements...
[ "protected", "function", "decode", "(", "$", "tsPropArray", ")", "{", "$", "tsPropArray", "=", "bin2hex", "(", "$", "tsPropArray", ")", ";", "// The signature is a 2-byte unicode character at the front", "$", "this", "->", "signature", "=", "chr", "(", "hexdec", "...
Given the TSPropertyArray binary data, extract out all of the TSProperty values. @param string $tsPropArray @return array
[ "Given", "the", "TSPropertyArray", "binary", "data", "extract", "out", "all", "of", "the", "TSProperty", "values", "." ]
b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7
https://github.com/ldaptools/ldaptools/blob/b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7/src/LdapTools/Utilities/TSPropertyArray.php#L255-L268
27,935
ldaptools/ldaptools
src/LdapTools/Query/OperatorCollection.php
OperatorCollection.add
public function add(BaseOperator ...$operators) { foreach ($operators as $operator) { if ($operator instanceof bAnd) { $this->operators['and'][] = $operator; } elseif ($operator instanceof bOr) { $this->operators['or'][] = $operator; } else...
php
public function add(BaseOperator ...$operators) { foreach ($operators as $operator) { if ($operator instanceof bAnd) { $this->operators['and'][] = $operator; } elseif ($operator instanceof bOr) { $this->operators['or'][] = $operator; } else...
[ "public", "function", "add", "(", "BaseOperator", "...", "$", "operators", ")", "{", "foreach", "(", "$", "operators", "as", "$", "operator", ")", "{", "if", "(", "$", "operator", "instanceof", "bAnd", ")", "{", "$", "this", "->", "operators", "[", "'a...
Add an Operator to the collection. @param BaseOperator[] ...$operators @return $this @throws LdapQueryException
[ "Add", "an", "Operator", "to", "the", "collection", "." ]
b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7
https://github.com/ldaptools/ldaptools/blob/b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7/src/LdapTools/Query/OperatorCollection.php#L65-L86
27,936
ldaptools/ldaptools
src/LdapTools/Query/OperatorCollection.php
OperatorCollection.addLdapObjectSchema
public function addLdapObjectSchema(LdapObjectSchema $schema, $alias = null) { if (!is_null($alias) && !is_string($alias)) { throw new InvalidArgumentException(sprintf( 'The alias for type "%s" must be a string, but "%s" was given.', $schema->getObjectType(), ...
php
public function addLdapObjectSchema(LdapObjectSchema $schema, $alias = null) { if (!is_null($alias) && !is_string($alias)) { throw new InvalidArgumentException(sprintf( 'The alias for type "%s" must be a string, but "%s" was given.', $schema->getObjectType(), ...
[ "public", "function", "addLdapObjectSchema", "(", "LdapObjectSchema", "$", "schema", ",", "$", "alias", "=", "null", ")", "{", "if", "(", "!", "is_null", "(", "$", "alias", ")", "&&", "!", "is_string", "(", "$", "alias", ")", ")", "{", "throw", "new", ...
Add a LdapObjectSchema for a object type that will be selected for. Optionally specify a specific alias that is used to reference it. If no alias is specified, then it uses the object type name for the schema. @param LdapObjectSchema $schema @param null|string $alias
[ "Add", "a", "LdapObjectSchema", "for", "a", "object", "type", "that", "will", "be", "selected", "for", ".", "Optionally", "specify", "a", "specific", "alias", "that", "is", "used", "to", "reference", "it", ".", "If", "no", "alias", "is", "specified", "then...
b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7
https://github.com/ldaptools/ldaptools/blob/b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7/src/LdapTools/Query/OperatorCollection.php#L95-L114
27,937
ldaptools/ldaptools
src/LdapTools/Query/OperatorCollection.php
OperatorCollection.toLdapFilter
public function toLdapFilter($alias = null) { if (is_null($alias) && !empty($this->aliases)) { $filter = $this->getLdapFilterForAliases(); } else { $filter = $this->getLdapFilter($alias); } return $filter; }
php
public function toLdapFilter($alias = null) { if (is_null($alias) && !empty($this->aliases)) { $filter = $this->getLdapFilterForAliases(); } else { $filter = $this->getLdapFilter($alias); } return $filter; }
[ "public", "function", "toLdapFilter", "(", "$", "alias", "=", "null", ")", "{", "if", "(", "is_null", "(", "$", "alias", ")", "&&", "!", "empty", "(", "$", "this", "->", "aliases", ")", ")", "{", "$", "filter", "=", "$", "this", "->", "getLdapFilte...
Get the LDAP filter string representation of all the operators in the collection. @param string|null $alias The alias to narrow the filter to. @return string
[ "Get", "the", "LDAP", "filter", "string", "representation", "of", "all", "the", "operators", "in", "the", "collection", "." ]
b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7
https://github.com/ldaptools/ldaptools/blob/b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7/src/LdapTools/Query/OperatorCollection.php#L212-L221
27,938
ldaptools/ldaptools
src/LdapTools/Query/OperatorCollection.php
OperatorCollection.sortOperatorsToArray
protected function sortOperatorsToArray() { return array_merge( $this->operators['and'], $this->operators['or'], $this->operators['not'], $this->operators['comparison'], $this->operators['wildcard'], $this->operators['matchingrule'] ...
php
protected function sortOperatorsToArray() { return array_merge( $this->operators['and'], $this->operators['or'], $this->operators['not'], $this->operators['comparison'], $this->operators['wildcard'], $this->operators['matchingrule'] ...
[ "protected", "function", "sortOperatorsToArray", "(", ")", "{", "return", "array_merge", "(", "$", "this", "->", "operators", "[", "'and'", "]", ",", "$", "this", "->", "operators", "[", "'or'", "]", ",", "$", "this", "->", "operators", "[", "'not'", "]"...
Merges all the Operators into one large array in a specific order. Before doing so, it will apply any schemas that exist. @return BaseOperator[] @throws LdapQueryException
[ "Merges", "all", "the", "Operators", "into", "one", "large", "array", "in", "a", "specific", "order", ".", "Before", "doing", "so", "it", "will", "apply", "any", "schemas", "that", "exist", "." ]
b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7
https://github.com/ldaptools/ldaptools/blob/b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7/src/LdapTools/Query/OperatorCollection.php#L242-L252
27,939
ldaptools/ldaptools
src/LdapTools/Query/OperatorCollection.php
OperatorCollection.getLdapFilterForAliases
protected function getLdapFilterForAliases() { $filters = []; foreach (array_keys($this->aliases) as $alias) { $filters[] = $this->getLdapFilter($alias); } if (count($filters) == 1) { return $filters[0]; } else { return bOr::SEPARATOR_STA...
php
protected function getLdapFilterForAliases() { $filters = []; foreach (array_keys($this->aliases) as $alias) { $filters[] = $this->getLdapFilter($alias); } if (count($filters) == 1) { return $filters[0]; } else { return bOr::SEPARATOR_STA...
[ "protected", "function", "getLdapFilterForAliases", "(", ")", "{", "$", "filters", "=", "[", "]", ";", "foreach", "(", "array_keys", "(", "$", "this", "->", "aliases", ")", "as", "$", "alias", ")", "{", "$", "filters", "[", "]", "=", "$", "this", "->...
Constructs a filter for multiple aliases that would return the requested LDAP objects in a single query. @return string
[ "Constructs", "a", "filter", "for", "multiple", "aliases", "that", "would", "return", "the", "requested", "LDAP", "objects", "in", "a", "single", "query", "." ]
b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7
https://github.com/ldaptools/ldaptools/blob/b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7/src/LdapTools/Query/OperatorCollection.php#L286-L299
27,940
ldaptools/ldaptools
src/LdapTools/Utilities/ConverterUtilitiesTrait.php
ConverterUtilitiesTrait.getCurrentLdapAttributeValue
protected function getCurrentLdapAttributeValue($attribute) { if (!$this->getDn() || !$this->getLdapConnection()) { throw new AttributeConverterException(sprintf('Unable to query for the current "%s" attribute.', $attribute)); } $query = new LdapQueryBuilder($this->getLdapConnec...
php
protected function getCurrentLdapAttributeValue($attribute) { if (!$this->getDn() || !$this->getLdapConnection()) { throw new AttributeConverterException(sprintf('Unable to query for the current "%s" attribute.', $attribute)); } $query = new LdapQueryBuilder($this->getLdapConnec...
[ "protected", "function", "getCurrentLdapAttributeValue", "(", "$", "attribute", ")", "{", "if", "(", "!", "$", "this", "->", "getDn", "(", ")", "||", "!", "$", "this", "->", "getLdapConnection", "(", ")", ")", "{", "throw", "new", "AttributeConverterExceptio...
This can be called to retrieve the current value of an attribute from LDAP. @param string $attribute The attribute name to query for a value from the converter context @return array|string|null @throws AttributeConverterException
[ "This", "can", "be", "called", "to", "retrieve", "the", "current", "value", "of", "an", "attribute", "from", "LDAP", "." ]
b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7
https://github.com/ldaptools/ldaptools/blob/b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7/src/LdapTools/Utilities/ConverterUtilitiesTrait.php#L69-L86
27,941
ldaptools/ldaptools
src/LdapTools/Utilities/ConverterUtilitiesTrait.php
ConverterUtilitiesTrait.modifyMultivaluedAttribute
protected function modifyMultivaluedAttribute(array $values, array $newValues) { if ($this->getOperationType() == AttributeConverterInterface::TYPE_CREATE || ($this->getBatch() && $this->getBatch()->isTypeAdd())) { $values = array_merge($values, $newValues); } elseif ($this->getBatch() &...
php
protected function modifyMultivaluedAttribute(array $values, array $newValues) { if ($this->getOperationType() == AttributeConverterInterface::TYPE_CREATE || ($this->getBatch() && $this->getBatch()->isTypeAdd())) { $values = array_merge($values, $newValues); } elseif ($this->getBatch() &...
[ "protected", "function", "modifyMultivaluedAttribute", "(", "array", "$", "values", ",", "array", "$", "newValues", ")", "{", "if", "(", "$", "this", "->", "getOperationType", "(", ")", "==", "AttributeConverterInterface", "::", "TYPE_CREATE", "||", "(", "$", ...
Modifies a multivalued attribute array based off the original values, the new values, and the modification type. @param array $values @param array $newValues @return array
[ "Modifies", "a", "multivalued", "attribute", "array", "based", "off", "the", "original", "values", "the", "new", "values", "and", "the", "modification", "type", "." ]
b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7
https://github.com/ldaptools/ldaptools/blob/b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7/src/LdapTools/Utilities/ConverterUtilitiesTrait.php#L112-L123
27,942
ldaptools/ldaptools
src/LdapTools/Configuration.php
Configuration.getDomainConfiguration
public function getDomainConfiguration($domain = null) { if ($domain && isset($this->domains[$domain])) { return $this->domains[$domain]; } elseif ($domain) { throw new InvalidArgumentException(sprintf('Domain "%s" not found.', $domain)); } else { return $...
php
public function getDomainConfiguration($domain = null) { if ($domain && isset($this->domains[$domain])) { return $this->domains[$domain]; } elseif ($domain) { throw new InvalidArgumentException(sprintf('Domain "%s" not found.', $domain)); } else { return $...
[ "public", "function", "getDomainConfiguration", "(", "$", "domain", "=", "null", ")", "{", "if", "(", "$", "domain", "&&", "isset", "(", "$", "this", "->", "domains", "[", "$", "domain", "]", ")", ")", "{", "return", "$", "this", "->", "domains", "["...
Get the DomainConfiguration for a specific domain, or an array of all DomainConfiguration objects if none is specified. @param null|string $domain @return DomainConfiguration[]|DomainConfiguration
[ "Get", "the", "DomainConfiguration", "for", "a", "specific", "domain", "or", "an", "array", "of", "all", "DomainConfiguration", "objects", "if", "none", "is", "specified", "." ]
b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7
https://github.com/ldaptools/ldaptools/blob/b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7/src/LdapTools/Configuration.php#L98-L107
27,943
ldaptools/ldaptools
src/LdapTools/Configuration.php
Configuration.addDomain
public function addDomain(DomainConfiguration ...$domains) { foreach ($domains as $domain) { $this->domains[$domain->getDomainName()] = $domain; } return $this; }
php
public function addDomain(DomainConfiguration ...$domains) { foreach ($domains as $domain) { $this->domains[$domain->getDomainName()] = $domain; } return $this; }
[ "public", "function", "addDomain", "(", "DomainConfiguration", "...", "$", "domains", ")", "{", "foreach", "(", "$", "domains", "as", "$", "domain", ")", "{", "$", "this", "->", "domains", "[", "$", "domain", "->", "getDomainName", "(", ")", "]", "=", ...
Add domain configurations. Accepts an arbitrary amount of domain configurations. @param DomainConfiguration $domains,... @return $this
[ "Add", "domain", "configurations", ".", "Accepts", "an", "arbitrary", "amount", "of", "domain", "configurations", "." ]
b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7
https://github.com/ldaptools/ldaptools/blob/b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7/src/LdapTools/Configuration.php#L115-L122
27,944
ldaptools/ldaptools
src/LdapTools/Configuration.php
Configuration.setSchemaFormat
public function setSchemaFormat($type) { if (!defined('\LdapTools\Factory\SchemaParserFactory::TYPE_'.strtoupper($type))) { throw new ConfigurationException(sprintf('Unknown schema format "%s".', $type)); } $this->config['schemaFormat'] = $type; return $this; }
php
public function setSchemaFormat($type) { if (!defined('\LdapTools\Factory\SchemaParserFactory::TYPE_'.strtoupper($type))) { throw new ConfigurationException(sprintf('Unknown schema format "%s".', $type)); } $this->config['schemaFormat'] = $type; return $this; }
[ "public", "function", "setSchemaFormat", "(", "$", "type", ")", "{", "if", "(", "!", "defined", "(", "'\\LdapTools\\Factory\\SchemaParserFactory::TYPE_'", ".", "strtoupper", "(", "$", "type", ")", ")", ")", "{", "throw", "new", "ConfigurationException", "(", "sp...
Set the schema definition format. @param $type string The schema type (ie. yml). @return $this @throws ConfigurationException
[ "Set", "the", "schema", "definition", "format", "." ]
b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7
https://github.com/ldaptools/ldaptools/blob/b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7/src/LdapTools/Configuration.php#L181-L189
27,945
ldaptools/ldaptools
src/LdapTools/Configuration.php
Configuration.setCacheType
public function setCacheType($type) { trigger_error('The '.__METHOD__.' method is deprecated and will be removed in a later version. Use setCache() instead.', E_USER_DEPRECATED); if (!defined('\LdapTools\Factory\CacheFactory::TYPE_'.strtoupper($type))) { throw new ConfigurationException...
php
public function setCacheType($type) { trigger_error('The '.__METHOD__.' method is deprecated and will be removed in a later version. Use setCache() instead.', E_USER_DEPRECATED); if (!defined('\LdapTools\Factory\CacheFactory::TYPE_'.strtoupper($type))) { throw new ConfigurationException...
[ "public", "function", "setCacheType", "(", "$", "type", ")", "{", "trigger_error", "(", "'The '", ".", "__METHOD__", ".", "' method is deprecated and will be removed in a later version. Use setCache() instead.'", ",", "E_USER_DEPRECATED", ")", ";", "if", "(", "!", "define...
Set the cache type to use. @param $type @return $this @throws ConfigurationException @deprecated This function will be removed in a later version. Use setCache() instead.
[ "Set", "the", "cache", "type", "to", "use", "." ]
b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7
https://github.com/ldaptools/ldaptools/blob/b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7/src/LdapTools/Configuration.php#L232-L242
27,946
ldaptools/ldaptools
src/LdapTools/Configuration.php
Configuration.loadDomainConfiguration
protected function loadDomainConfiguration(array $config) { try { foreach ($config['domains'] as $domain => $options) { $domain = new DomainConfiguration(); $domain->load($options); $this->addDomain($domain); } } catch (Configur...
php
protected function loadDomainConfiguration(array $config) { try { foreach ($config['domains'] as $domain => $options) { $domain = new DomainConfiguration(); $domain->load($options); $this->addDomain($domain); } } catch (Configur...
[ "protected", "function", "loadDomainConfiguration", "(", "array", "$", "config", ")", "{", "try", "{", "foreach", "(", "$", "config", "[", "'domains'", "]", "as", "$", "domain", "=>", "$", "options", ")", "{", "$", "domain", "=", "new", "DomainConfiguratio...
Iterates through and loads the domain section of the configuration. @param $config @throws ConfigurationException
[ "Iterates", "through", "and", "loads", "the", "domain", "section", "of", "the", "configuration", "." ]
b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7
https://github.com/ldaptools/ldaptools/blob/b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7/src/LdapTools/Configuration.php#L410-L421
27,947
ldaptools/ldaptools
src/LdapTools/Factory/AttributeConverterFactory.php
AttributeConverterFactory.get
public static function get($name) { if (!isset(self::$converterMap[$name])) { throw new InvalidArgumentException(sprintf('Attribute converter "%s" is not valid.', $name)); } return self::getInstanceOfConverter($name); }
php
public static function get($name) { if (!isset(self::$converterMap[$name])) { throw new InvalidArgumentException(sprintf('Attribute converter "%s" is not valid.', $name)); } return self::getInstanceOfConverter($name); }
[ "public", "static", "function", "get", "(", "$", "name", ")", "{", "if", "(", "!", "isset", "(", "self", "::", "$", "converterMap", "[", "$", "name", "]", ")", ")", "{", "throw", "new", "InvalidArgumentException", "(", "sprintf", "(", "'Attribute convert...
Retrieve a registered attribute converter by name. @param $name @return AttributeConverterInterface
[ "Retrieve", "a", "registered", "attribute", "converter", "by", "name", "." ]
b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7
https://github.com/ldaptools/ldaptools/blob/b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7/src/LdapTools/Factory/AttributeConverterFactory.php#L66-L73
27,948
ldaptools/ldaptools
src/LdapTools/Factory/AttributeConverterFactory.php
AttributeConverterFactory.register
public static function register($name, $class) { if (isset(self::$converterMap[$name])) { throw new InvalidArgumentException( sprintf('The attribute converter name "%s" is already registered.', $name) ); } self::$converterMap[$name] = $class; }
php
public static function register($name, $class) { if (isset(self::$converterMap[$name])) { throw new InvalidArgumentException( sprintf('The attribute converter name "%s" is already registered.', $name) ); } self::$converterMap[$name] = $class; }
[ "public", "static", "function", "register", "(", "$", "name", ",", "$", "class", ")", "{", "if", "(", "isset", "(", "self", "::", "$", "converterMap", "[", "$", "name", "]", ")", ")", "{", "throw", "new", "InvalidArgumentException", "(", "sprintf", "("...
Registers a converter so it can be retrieved by its name. @param string $name The actual name for the converter in the schema. @param string $class The fully qualified class name (ie. '\Foo\Bar\Converter')
[ "Registers", "a", "converter", "so", "it", "can", "be", "retrieved", "by", "its", "name", "." ]
b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7
https://github.com/ldaptools/ldaptools/blob/b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7/src/LdapTools/Factory/AttributeConverterFactory.php#L81-L90
27,949
ldaptools/ldaptools
src/LdapTools/Factory/AttributeConverterFactory.php
AttributeConverterFactory.getInstanceOfConverter
protected static function getInstanceOfConverter($name) { try { $converter = new self::$converterMap[$name](); } catch (\Exception $e) { throw new \RuntimeException( sprintf('Unable to load attribute converter "%s": %s', $name, $e->getMessage()) );...
php
protected static function getInstanceOfConverter($name) { try { $converter = new self::$converterMap[$name](); } catch (\Exception $e) { throw new \RuntimeException( sprintf('Unable to load attribute converter "%s": %s', $name, $e->getMessage()) );...
[ "protected", "static", "function", "getInstanceOfConverter", "(", "$", "name", ")", "{", "try", "{", "$", "converter", "=", "new", "self", "::", "$", "converterMap", "[", "$", "name", "]", "(", ")", ";", "}", "catch", "(", "\\", "Exception", "$", "e", ...
Load a specific converter if needed and send it back. @param string $name @return AttributeConverterInterface
[ "Load", "a", "specific", "converter", "if", "needed", "and", "send", "it", "back", "." ]
b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7
https://github.com/ldaptools/ldaptools/blob/b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7/src/LdapTools/Factory/AttributeConverterFactory.php#L98-L115
27,950
ldaptools/ldaptools
src/LdapTools/Ldif/Entry/LdifEntryTrait.php
LdifEntryTrait.addControlsToString
protected function addControlsToString($ldif) { foreach ($this->controls as $control) { $value = $control->getOid().' '.$control->getCriticality(); if (!is_null($control->getValue())) { $value .= ' '.$control->getValue(); } $ldif .= $this->getL...
php
protected function addControlsToString($ldif) { foreach ($this->controls as $control) { $value = $control->getOid().' '.$control->getCriticality(); if (!is_null($control->getValue())) { $value .= ' '.$control->getValue(); } $ldif .= $this->getL...
[ "protected", "function", "addControlsToString", "(", "$", "ldif", ")", "{", "foreach", "(", "$", "this", "->", "controls", "as", "$", "control", ")", "{", "$", "value", "=", "$", "control", "->", "getOid", "(", ")", ".", "' '", ".", "$", "control", "...
Add any LDAP controls to the specified LDIF. @param string $ldif @return string
[ "Add", "any", "LDAP", "controls", "to", "the", "specified", "LDIF", "." ]
b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7
https://github.com/ldaptools/ldaptools/blob/b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7/src/LdapTools/Ldif/Entry/LdifEntryTrait.php#L145-L156
27,951
ldaptools/ldaptools
src/LdapTools/Ldif/Entry/LdifEntryTrait.php
LdifEntryTrait.isUnicodePwdHackNeeded
protected function isUnicodePwdHackNeeded() { if (!(isset($this->connection) && $this->connection->getConfig()->getLdapType() == LdapConnection::TYPE_AD && isset($this->schema))) { return false; } return $this->schema->hasNamesMappedToAttribute('unicodePwd'); }
php
protected function isUnicodePwdHackNeeded() { if (!(isset($this->connection) && $this->connection->getConfig()->getLdapType() == LdapConnection::TYPE_AD && isset($this->schema))) { return false; } return $this->schema->hasNamesMappedToAttribute('unicodePwd'); }
[ "protected", "function", "isUnicodePwdHackNeeded", "(", ")", "{", "if", "(", "!", "(", "isset", "(", "$", "this", "->", "connection", ")", "&&", "$", "this", "->", "connection", "->", "getConfig", "(", ")", "->", "getLdapType", "(", ")", "==", "LdapConne...
Determine if we might need to work around the unusual formatting for unicodePwd. This is pretty much the only attribute that will ever need a special case for conversion for LDIF creation. @todo How to get around this? Implementing another attribute conversion type for just a single attribute seems silly. @link https:...
[ "Determine", "if", "we", "might", "need", "to", "work", "around", "the", "unusual", "formatting", "for", "unicodePwd", ".", "This", "is", "pretty", "much", "the", "only", "attribute", "that", "will", "ever", "need", "a", "special", "case", "for", "conversion...
b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7
https://github.com/ldaptools/ldaptools/blob/b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7/src/LdapTools/Ldif/Entry/LdifEntryTrait.php#L183-L190
27,952
ldaptools/ldaptools
src/LdapTools/Security/Ace/AceType.php
AceType.setValue
public function setValue($type) { if (is_numeric($type) && in_array($type, self::TYPE)) { $this->type = (int) $type; } elseif (is_string($type) && array_key_exists(strtoupper($type), self::TYPE)) { $this->type = self::TYPE[strtoupper($type)]; } elseif (is_string($type...
php
public function setValue($type) { if (is_numeric($type) && in_array($type, self::TYPE)) { $this->type = (int) $type; } elseif (is_string($type) && array_key_exists(strtoupper($type), self::TYPE)) { $this->type = self::TYPE[strtoupper($type)]; } elseif (is_string($type...
[ "public", "function", "setValue", "(", "$", "type", ")", "{", "if", "(", "is_numeric", "(", "$", "type", ")", "&&", "in_array", "(", "$", "type", ",", "self", "::", "TYPE", ")", ")", "{", "$", "this", "->", "type", "=", "(", "int", ")", "$", "t...
Set the type of the Ace. @param string|int $type @return $this
[ "Set", "the", "type", "of", "the", "Ace", "." ]
b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7
https://github.com/ldaptools/ldaptools/blob/b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7/src/LdapTools/Security/Ace/AceType.php#L103-L116
27,953
ldaptools/ldaptools
src/LdapTools/Connection/LdapServerPool.php
LdapServerPool.getServer
public function getServer() { $servers = $this->getSortedServersArray(); foreach ($servers as $server) { if ($this->isServerAvailable($server)) { return $server; } } throw new LdapConnectionException('No LDAP server is available.'); }
php
public function getServer() { $servers = $this->getSortedServersArray(); foreach ($servers as $server) { if ($this->isServerAvailable($server)) { return $server; } } throw new LdapConnectionException('No LDAP server is available.'); }
[ "public", "function", "getServer", "(", ")", "{", "$", "servers", "=", "$", "this", "->", "getSortedServersArray", "(", ")", ";", "foreach", "(", "$", "servers", "as", "$", "server", ")", "{", "if", "(", "$", "this", "->", "isServerAvailable", "(", "$"...
Retrieve the first available LDAP server. @return string @throws LdapConnectionException
[ "Retrieve", "the", "first", "available", "LDAP", "server", "." ]
b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7
https://github.com/ldaptools/ldaptools/blob/b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7/src/LdapTools/Connection/LdapServerPool.php#L88-L99
27,954
ldaptools/ldaptools
src/LdapTools/Connection/LdapServerPool.php
LdapServerPool.isServerAvailable
public function isServerAvailable($server) { $result = $this->tcp->connect($server, $this->config->getPort(), $this->config->getConnectTimeout()); if ($result) { $this->tcp->close(); } return $result; }
php
public function isServerAvailable($server) { $result = $this->tcp->connect($server, $this->config->getPort(), $this->config->getConnectTimeout()); if ($result) { $this->tcp->close(); } return $result; }
[ "public", "function", "isServerAvailable", "(", "$", "server", ")", "{", "$", "result", "=", "$", "this", "->", "tcp", "->", "connect", "(", "$", "server", ",", "$", "this", "->", "config", "->", "getPort", "(", ")", ",", "$", "this", "->", "config",...
Check if a LDAP server is up and available. @param string $server @return bool
[ "Check", "if", "a", "LDAP", "server", "is", "up", "and", "available", "." ]
b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7
https://github.com/ldaptools/ldaptools/blob/b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7/src/LdapTools/Connection/LdapServerPool.php#L107-L115
27,955
ldaptools/ldaptools
src/LdapTools/Connection/LdapServerPool.php
LdapServerPool.getSortedServersArray
public function getSortedServersArray() { $servers = empty($this->config->getServers()) ? $this->getServersFromDns() : $this->config->getServers(); if (self::SELECT_RANDOM == $this->selectionMethod) { $servers = $this->shuffleServers($servers); } return $servers; }
php
public function getSortedServersArray() { $servers = empty($this->config->getServers()) ? $this->getServersFromDns() : $this->config->getServers(); if (self::SELECT_RANDOM == $this->selectionMethod) { $servers = $this->shuffleServers($servers); } return $servers; }
[ "public", "function", "getSortedServersArray", "(", ")", "{", "$", "servers", "=", "empty", "(", "$", "this", "->", "config", "->", "getServers", "(", ")", ")", "?", "$", "this", "->", "getServersFromDns", "(", ")", ":", "$", "this", "->", "config", "-...
Uses the selected method to decide how to return the server array for the check. @return array
[ "Uses", "the", "selected", "method", "to", "decide", "how", "to", "return", "the", "server", "array", "for", "the", "check", "." ]
b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7
https://github.com/ldaptools/ldaptools/blob/b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7/src/LdapTools/Connection/LdapServerPool.php#L146-L155
27,956
ldaptools/ldaptools
src/LdapTools/Connection/LdapServerPool.php
LdapServerPool.getServersFromDns
protected function getServersFromDns() { $servers = $this->dns->getRecord(LdapUtilities::SRV_PREFIX.$this->config->getDomainName(), DNS_SRV); if ($servers === false || empty($servers)) { throw new LdapConnectionException(sprintf( 'No LDAP servers found via DNS for "%s".'...
php
protected function getServersFromDns() { $servers = $this->dns->getRecord(LdapUtilities::SRV_PREFIX.$this->config->getDomainName(), DNS_SRV); if ($servers === false || empty($servers)) { throw new LdapConnectionException(sprintf( 'No LDAP servers found via DNS for "%s".'...
[ "protected", "function", "getServersFromDns", "(", ")", "{", "$", "servers", "=", "$", "this", "->", "dns", "->", "getRecord", "(", "LdapUtilities", "::", "SRV_PREFIX", ".", "$", "this", "->", "config", "->", "getDomainName", "(", ")", ",", "DNS_SRV", ")",...
Attempt to lookup the LDAP servers from the DNS name. @return array The LDAP servers. @throws LdapConnectionException
[ "Attempt", "to", "lookup", "the", "LDAP", "servers", "from", "the", "DNS", "name", "." ]
b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7
https://github.com/ldaptools/ldaptools/blob/b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7/src/LdapTools/Connection/LdapServerPool.php#L176-L193
27,957
ldaptools/ldaptools
src/LdapTools/Schema/Parser/SchemaYamlParser.php
SchemaYamlParser.parseYamlForObject
protected function parseYamlForObject(array $schema, $schemaName, $objectType) { $objectSchema = $this->getObjectFromSchema($schema, $objectType); $objectSchema = $this->mergeAnyExtendedSchemas($objectSchema, $schemaName); $objectSchema = $this->cleanObjectArray($objectSchema); $this...
php
protected function parseYamlForObject(array $schema, $schemaName, $objectType) { $objectSchema = $this->getObjectFromSchema($schema, $objectType); $objectSchema = $this->mergeAnyExtendedSchemas($objectSchema, $schemaName); $objectSchema = $this->cleanObjectArray($objectSchema); $this...
[ "protected", "function", "parseYamlForObject", "(", "array", "$", "schema", ",", "$", "schemaName", ",", "$", "objectType", ")", "{", "$", "objectSchema", "=", "$", "this", "->", "getObjectFromSchema", "(", "$", "schema", ",", "$", "objectType", ")", ";", ...
Attempt to find the object type definition in the schema and create its object representation. @param array $schema @param string $schemaName @param string $objectType @return LdapObjectSchema @throws SchemaParserException
[ "Attempt", "to", "find", "the", "object", "type", "definition", "in", "the", "schema", "and", "create", "its", "object", "representation", "." ]
b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7
https://github.com/ldaptools/ldaptools/blob/b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7/src/LdapTools/Schema/Parser/SchemaYamlParser.php#L179-L206
27,958
ldaptools/ldaptools
src/LdapTools/Schema/Parser/SchemaYamlParser.php
SchemaYamlParser.validateSchemaType
protected function validateSchemaType(LdapObjectSchema $schema, array $schemaArray) { if (!((bool)count(array_filter(array_keys($schemaArray['attributes']), 'is_string')))) { throw new SchemaParserException('The attributes for a schema should be an associative array.'); } if ($sc...
php
protected function validateSchemaType(LdapObjectSchema $schema, array $schemaArray) { if (!((bool)count(array_filter(array_keys($schemaArray['attributes']), 'is_string')))) { throw new SchemaParserException('The attributes for a schema should be an associative array.'); } if ($sc...
[ "protected", "function", "validateSchemaType", "(", "LdapObjectSchema", "$", "schema", ",", "array", "$", "schemaArray", ")", "{", "if", "(", "!", "(", "(", "bool", ")", "count", "(", "array_filter", "(", "array_keys", "(", "$", "schemaArray", "[", "'attribu...
Validates some of the schema values to check that they are allowed. @param LdapObjectSchema $schema @param array $schemaArray @throws SchemaParserException
[ "Validates", "some", "of", "the", "schema", "values", "to", "check", "that", "they", "are", "allowed", "." ]
b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7
https://github.com/ldaptools/ldaptools/blob/b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7/src/LdapTools/Schema/Parser/SchemaYamlParser.php#L261-L273
27,959
ldaptools/ldaptools
src/LdapTools/Schema/Parser/SchemaYamlParser.php
SchemaYamlParser.getObjectFromSchema
protected function getObjectFromSchema(array $schema, $objectType) { $objectSchema = null; foreach ($schema['objects'] as $ldapObject) { if (array_key_exists('type', $ldapObject) && strtolower($ldapObject['type']) == strtolower($objectType)) { $objectSchema = $ldapObject;...
php
protected function getObjectFromSchema(array $schema, $objectType) { $objectSchema = null; foreach ($schema['objects'] as $ldapObject) { if (array_key_exists('type', $ldapObject) && strtolower($ldapObject['type']) == strtolower($objectType)) { $objectSchema = $ldapObject;...
[ "protected", "function", "getObjectFromSchema", "(", "array", "$", "schema", ",", "$", "objectType", ")", "{", "$", "objectSchema", "=", "null", ";", "foreach", "(", "$", "schema", "[", "'objects'", "]", "as", "$", "ldapObject", ")", "{", "if", "(", "arr...
Check for a specific object type in the schema and validate it. @param array $schema @param string $objectType @return array @throws SchemaParserException
[ "Check", "for", "a", "specific", "object", "type", "in", "the", "schema", "and", "validate", "it", "." ]
b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7
https://github.com/ldaptools/ldaptools/blob/b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7/src/LdapTools/Schema/Parser/SchemaYamlParser.php#L283-L296
27,960
ldaptools/ldaptools
src/LdapTools/Schema/Parser/SchemaYamlParser.php
SchemaYamlParser.updateObjectArray
protected function updateObjectArray($schemaName, $schemaObject) { foreach ($this->schemas[$this->schemaFolder][$schemaName]['objects'] as $name => $value) { if (array_key_exists('type', $value) && $value['type'] == $schemaObject['type']) { $this->schemas[$this->schemaFolder][$sc...
php
protected function updateObjectArray($schemaName, $schemaObject) { foreach ($this->schemas[$this->schemaFolder][$schemaName]['objects'] as $name => $value) { if (array_key_exists('type', $value) && $value['type'] == $schemaObject['type']) { $this->schemas[$this->schemaFolder][$sc...
[ "protected", "function", "updateObjectArray", "(", "$", "schemaName", ",", "$", "schemaObject", ")", "{", "foreach", "(", "$", "this", "->", "schemas", "[", "$", "this", "->", "schemaFolder", "]", "[", "$", "schemaName", "]", "[", "'objects'", "]", "as", ...
Update the object in the schema array in case it extended a different object type. @param string $schemaName @param array $schemaObject
[ "Update", "the", "object", "in", "the", "schema", "array", "in", "case", "it", "extended", "a", "different", "object", "type", "." ]
b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7
https://github.com/ldaptools/ldaptools/blob/b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7/src/LdapTools/Schema/Parser/SchemaYamlParser.php#L304-L311
27,961
ldaptools/ldaptools
src/LdapTools/Schema/Parser/SchemaYamlParser.php
SchemaYamlParser.parseConverterMap
protected function parseConverterMap(array $objectSchema) { $converterMap = []; if (array_key_exists('converters', $objectSchema)) { foreach ($objectSchema['converters'] as $converter => $attributes) { if (is_array($attributes)) { foreach ($attributes...
php
protected function parseConverterMap(array $objectSchema) { $converterMap = []; if (array_key_exists('converters', $objectSchema)) { foreach ($objectSchema['converters'] as $converter => $attributes) { if (is_array($attributes)) { foreach ($attributes...
[ "protected", "function", "parseConverterMap", "(", "array", "$", "objectSchema", ")", "{", "$", "converterMap", "=", "[", "]", ";", "if", "(", "array_key_exists", "(", "'converters'", ",", "$", "objectSchema", ")", ")", "{", "foreach", "(", "$", "objectSchem...
Parse the converters section of an object schema definition to generate the attribute converter map. @param array $objectSchema @return array
[ "Parse", "the", "converters", "section", "of", "an", "object", "schema", "definition", "to", "generate", "the", "attribute", "converter", "map", "." ]
b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7
https://github.com/ldaptools/ldaptools/blob/b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7/src/LdapTools/Schema/Parser/SchemaYamlParser.php#L333-L350
27,962
ldaptools/ldaptools
src/LdapTools/Schema/Parser/SchemaYamlParser.php
SchemaYamlParser.parseFilter
protected function parseFilter(LdapObjectSchema $objectSchema, array $objectArray) { $filter = array_key_exists('filter', $objectArray) ? $objectArray['filter'] : []; if (empty($filter) && empty($objectSchema->getObjectClass()) && empty($objectSchema->getObjectCategory())) { thr...
php
protected function parseFilter(LdapObjectSchema $objectSchema, array $objectArray) { $filter = array_key_exists('filter', $objectArray) ? $objectArray['filter'] : []; if (empty($filter) && empty($objectSchema->getObjectClass()) && empty($objectSchema->getObjectCategory())) { thr...
[ "protected", "function", "parseFilter", "(", "LdapObjectSchema", "$", "objectSchema", ",", "array", "$", "objectArray", ")", "{", "$", "filter", "=", "array_key_exists", "(", "'filter'", ",", "$", "objectArray", ")", "?", "$", "objectArray", "[", "'filter'", "...
Get the filter for the schema object. @param LdapObjectSchema $objectSchema @param array $objectArray @return \LdapTools\Query\Operator\BaseOperator @throws SchemaParserException
[ "Get", "the", "filter", "for", "the", "schema", "object", "." ]
b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7
https://github.com/ldaptools/ldaptools/blob/b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7/src/LdapTools/Schema/Parser/SchemaYamlParser.php#L360-L373
27,963
ldaptools/ldaptools
src/LdapTools/Schema/Parser/SchemaYamlParser.php
SchemaYamlParser.validateObjectSchema
protected function validateObjectSchema($schema) { if (empty($schema->getAttributeMap())) { throw new SchemaParserException(sprintf('Object type "%s" has no attributes defined.', $schema->getObjectType())); } elseif (!((bool)count(array_filter(array_keys($schema->getAttributeMap()), 'is_...
php
protected function validateObjectSchema($schema) { if (empty($schema->getAttributeMap())) { throw new SchemaParserException(sprintf('Object type "%s" has no attributes defined.', $schema->getObjectType())); } elseif (!((bool)count(array_filter(array_keys($schema->getAttributeMap()), 'is_...
[ "protected", "function", "validateObjectSchema", "(", "$", "schema", ")", "{", "if", "(", "empty", "(", "$", "schema", "->", "getAttributeMap", "(", ")", ")", ")", "{", "throw", "new", "SchemaParserException", "(", "sprintf", "(", "'Object type \"%s\" has no att...
Validate that an object schema meets the minimum requirements. @param LdapObjectSchema $schema @throws SchemaParserException
[ "Validate", "that", "an", "object", "schema", "meets", "the", "minimum", "requirements", "." ]
b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7
https://github.com/ldaptools/ldaptools/blob/b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7/src/LdapTools/Schema/Parser/SchemaYamlParser.php#L419-L434
27,964
ldaptools/ldaptools
src/LdapTools/Schema/Parser/SchemaYamlParser.php
SchemaYamlParser.parseSchemaNameToArray
protected function parseSchemaNameToArray($schemaName) { if (!isset($this->schemas[$this->schemaFolder][$schemaName])) { $file = $this->getSchemaFileName($this->schemaFolder, $schemaName); try { $this->schemas[$this->schemaFolder][$schemaName] = Yaml::parse(file_get_c...
php
protected function parseSchemaNameToArray($schemaName) { if (!isset($this->schemas[$this->schemaFolder][$schemaName])) { $file = $this->getSchemaFileName($this->schemaFolder, $schemaName); try { $this->schemas[$this->schemaFolder][$schemaName] = Yaml::parse(file_get_c...
[ "protected", "function", "parseSchemaNameToArray", "(", "$", "schemaName", ")", "{", "if", "(", "!", "isset", "(", "$", "this", "->", "schemas", "[", "$", "this", "->", "schemaFolder", "]", "[", "$", "schemaName", "]", ")", ")", "{", "$", "file", "=", ...
Given a schema name, parse it into the array. @param string $schemaName @throws SchemaParserException
[ "Given", "a", "schema", "name", "parse", "it", "into", "the", "array", "." ]
b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7
https://github.com/ldaptools/ldaptools/blob/b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7/src/LdapTools/Schema/Parser/SchemaYamlParser.php#L442-L455
27,965
ldaptools/ldaptools
src/LdapTools/Schema/Parser/SchemaYamlParser.php
SchemaYamlParser.mergeIncludedSchemas
protected function mergeIncludedSchemas($schemaName) { $include = ['include' => [], 'include_default' => []]; foreach (array_keys($include) as $key) { if (isset($this->schemas[$this->schemaFolder][$schemaName][$key])) { $include[$key] = $this->schemas[$this->schemaFolder...
php
protected function mergeIncludedSchemas($schemaName) { $include = ['include' => [], 'include_default' => []]; foreach (array_keys($include) as $key) { if (isset($this->schemas[$this->schemaFolder][$schemaName][$key])) { $include[$key] = $this->schemas[$this->schemaFolder...
[ "protected", "function", "mergeIncludedSchemas", "(", "$", "schemaName", ")", "{", "$", "include", "=", "[", "'include'", "=>", "[", "]", ",", "'include_default'", "=>", "[", "]", "]", ";", "foreach", "(", "array_keys", "(", "$", "include", ")", "as", "$...
If the 'include' directive is used, then merge the specified schemas into the current one. @param string $schemaName @throws SchemaParserException
[ "If", "the", "include", "directive", "is", "used", "then", "merge", "the", "specified", "schemas", "into", "the", "current", "one", "." ]
b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7
https://github.com/ldaptools/ldaptools/blob/b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7/src/LdapTools/Schema/Parser/SchemaYamlParser.php#L463-L492
27,966
ldaptools/ldaptools
src/LdapTools/Schema/Parser/SchemaYamlParser.php
SchemaYamlParser.mergeDefaultSchemaFile
protected function mergeDefaultSchemaFile($schemaName) { if (!isset($this->schemas[$this->schemaFolder][$schemaName]['extends_default'])) { return; } $defaultSchemaName = $this->schemas[$this->schemaFolder][$schemaName]['extends_default']; $folder = $this->schemaFolder; ...
php
protected function mergeDefaultSchemaFile($schemaName) { if (!isset($this->schemas[$this->schemaFolder][$schemaName]['extends_default'])) { return; } $defaultSchemaName = $this->schemas[$this->schemaFolder][$schemaName]['extends_default']; $folder = $this->schemaFolder; ...
[ "protected", "function", "mergeDefaultSchemaFile", "(", "$", "schemaName", ")", "{", "if", "(", "!", "isset", "(", "$", "this", "->", "schemas", "[", "$", "this", "->", "schemaFolder", "]", "[", "$", "schemaName", "]", "[", "'extends_default'", "]", ")", ...
If the 'extends_default' directive is used, then merge the specified default schema. @param string $schemaName @throws SchemaParserException
[ "If", "the", "extends_default", "directive", "is", "used", "then", "merge", "the", "specified", "default", "schema", "." ]
b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7
https://github.com/ldaptools/ldaptools/blob/b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7/src/LdapTools/Schema/Parser/SchemaYamlParser.php#L500-L517
27,967
ldaptools/ldaptools
src/LdapTools/Schema/Parser/SchemaYamlParser.php
SchemaYamlParser.mergeAnyExtendedSchemas
protected function mergeAnyExtendedSchemas(array $objectSchema, $schemaName) { if (!(isset($objectSchema['extends']) || isset($objectSchema['extends_default']))) { return $objectSchema; } return $this->mergeSchemaObjectArrays($this->getParentSchemaObject($objectSchema, $schemaNa...
php
protected function mergeAnyExtendedSchemas(array $objectSchema, $schemaName) { if (!(isset($objectSchema['extends']) || isset($objectSchema['extends_default']))) { return $objectSchema; } return $this->mergeSchemaObjectArrays($this->getParentSchemaObject($objectSchema, $schemaNa...
[ "protected", "function", "mergeAnyExtendedSchemas", "(", "array", "$", "objectSchema", ",", "$", "schemaName", ")", "{", "if", "(", "!", "(", "isset", "(", "$", "objectSchema", "[", "'extends'", "]", ")", "||", "isset", "(", "$", "objectSchema", "[", "'ext...
If the 'extends' option is given, then merge this schema object with the requested schema object. @param array $objectSchema @param string $schemaName @return array @throws SchemaParserException
[ "If", "the", "extends", "option", "is", "given", "then", "merge", "this", "schema", "object", "with", "the", "requested", "schema", "object", "." ]
b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7
https://github.com/ldaptools/ldaptools/blob/b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7/src/LdapTools/Schema/Parser/SchemaYamlParser.php#L527-L534
27,968
ldaptools/ldaptools
src/LdapTools/Schema/Parser/SchemaYamlParser.php
SchemaYamlParser.mergeSchemaObjectArrays
protected function mergeSchemaObjectArrays($parent, $schema) { // Directives used that exist in the schema being extended, that are arrays, should be merged. foreach (array_intersect_key($schema, $parent) as $key => $value) { # Simple merge on non-multidimensional arrays... i...
php
protected function mergeSchemaObjectArrays($parent, $schema) { // Directives used that exist in the schema being extended, that are arrays, should be merged. foreach (array_intersect_key($schema, $parent) as $key => $value) { # Simple merge on non-multidimensional arrays... i...
[ "protected", "function", "mergeSchemaObjectArrays", "(", "$", "parent", ",", "$", "schema", ")", "{", "// Directives used that exist in the schema being extended, that are arrays, should be merged.", "foreach", "(", "array_intersect_key", "(", "$", "schema", ",", "$", "parent...
Performs the logic for merging one schema object array with another. @param array $parent The parent schema object being extended. @param array $schema The base schema object being defined. @return array
[ "Performs", "the", "logic", "for", "merging", "one", "schema", "object", "array", "with", "another", "." ]
b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7
https://github.com/ldaptools/ldaptools/blob/b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7/src/LdapTools/Schema/Parser/SchemaYamlParser.php#L543-L558
27,969
ldaptools/ldaptools
src/LdapTools/Schema/Parser/SchemaYamlParser.php
SchemaYamlParser.getExtendedDefaultSchemaObject
protected function getExtendedDefaultSchemaObject(array $objectSchema) { if (!(is_array($objectSchema['extends_default']) && 2 == count($objectSchema['extends_default']))) { throw new SchemaParserException('The "extends_default" directive should be an array with exactly 2 values.'); } ...
php
protected function getExtendedDefaultSchemaObject(array $objectSchema) { if (!(is_array($objectSchema['extends_default']) && 2 == count($objectSchema['extends_default']))) { throw new SchemaParserException('The "extends_default" directive should be an array with exactly 2 values.'); } ...
[ "protected", "function", "getExtendedDefaultSchemaObject", "(", "array", "$", "objectSchema", ")", "{", "if", "(", "!", "(", "is_array", "(", "$", "objectSchema", "[", "'extends_default'", "]", ")", "&&", "2", "==", "count", "(", "$", "objectSchema", "[", "'...
If we need to retrieve one of the default schemas, then it's probably the case that the schema folder path was manually defined. So retrieve the default schema object by parsing the name from the default folder path and then reset the schema folder back to what it originally was. @param array $objectSchema @return arr...
[ "If", "we", "need", "to", "retrieve", "one", "of", "the", "default", "schemas", "then", "it", "s", "probably", "the", "case", "that", "the", "schema", "folder", "path", "was", "manually", "defined", ".", "So", "retrieve", "the", "default", "schema", "objec...
b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7
https://github.com/ldaptools/ldaptools/blob/b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7/src/LdapTools/Schema/Parser/SchemaYamlParser.php#L569-L586
27,970
ldaptools/ldaptools
src/LdapTools/Schema/Parser/SchemaYamlParser.php
SchemaYamlParser.getParentSchemaObject
protected function getParentSchemaObject(array $objectSchema, $schemaName) { if (isset($objectSchema['extends_default'])) { $parent = $this->getExtendedDefaultSchemaObject($objectSchema); } elseif (isset($objectSchema['extends']) && is_string($objectSchema['extends'])) { $par...
php
protected function getParentSchemaObject(array $objectSchema, $schemaName) { if (isset($objectSchema['extends_default'])) { $parent = $this->getExtendedDefaultSchemaObject($objectSchema); } elseif (isset($objectSchema['extends']) && is_string($objectSchema['extends'])) { $par...
[ "protected", "function", "getParentSchemaObject", "(", "array", "$", "objectSchema", ",", "$", "schemaName", ")", "{", "if", "(", "isset", "(", "$", "objectSchema", "[", "'extends_default'", "]", ")", ")", "{", "$", "parent", "=", "$", "this", "->", "getEx...
Determines what parent array object to get based on the directive used. @param array $objectSchema @param string $schemaName @return array @throws SchemaParserException
[ "Determines", "what", "parent", "array", "object", "to", "get", "based", "on", "the", "directive", "used", "." ]
b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7
https://github.com/ldaptools/ldaptools/blob/b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7/src/LdapTools/Schema/Parser/SchemaYamlParser.php#L596-L612
27,971
ldaptools/ldaptools
src/LdapTools/Schema/Parser/SchemaYamlParser.php
SchemaYamlParser.getSchemaFileName
protected function getSchemaFileName($folder, $schema) { $file = null; foreach (['yml', 'yaml'] as $ext) { $fileCheck = $folder.'/'.$schema.'.'.$ext; if (is_readable($fileCheck)) { $file = $fileCheck; break; } } if...
php
protected function getSchemaFileName($folder, $schema) { $file = null; foreach (['yml', 'yaml'] as $ext) { $fileCheck = $folder.'/'.$schema.'.'.$ext; if (is_readable($fileCheck)) { $file = $fileCheck; break; } } if...
[ "protected", "function", "getSchemaFileName", "(", "$", "folder", ",", "$", "schema", ")", "{", "$", "file", "=", "null", ";", "foreach", "(", "[", "'yml'", ",", "'yaml'", "]", "as", "$", "ext", ")", "{", "$", "fileCheck", "=", "$", "folder", ".", ...
Check for a YML file of the specified schema name and return the full path. @param string $folder @param string $schema @return string @throws SchemaParserException
[ "Check", "for", "a", "YML", "file", "of", "the", "specified", "schema", "name", "and", "return", "the", "full", "path", "." ]
b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7
https://github.com/ldaptools/ldaptools/blob/b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7/src/LdapTools/Schema/Parser/SchemaYamlParser.php#L622-L639
27,972
ldaptools/ldaptools
src/LdapTools/AttributeConverter/ConvertPrimaryGroup.php
ConvertPrimaryGroup.validateAndGetGroupSID
protected function validateAndGetGroupSID($name) { $query = new LdapQueryBuilder($this->getLdapConnection()); $query->select('objectSid')->where(['objectClass' => 'group', 'cn' => $name]); // Only validate group group membership on modification. if ($this->getOperationType() == Attr...
php
protected function validateAndGetGroupSID($name) { $query = new LdapQueryBuilder($this->getLdapConnection()); $query->select('objectSid')->where(['objectClass' => 'group', 'cn' => $name]); // Only validate group group membership on modification. if ($this->getOperationType() == Attr...
[ "protected", "function", "validateAndGetGroupSID", "(", "$", "name", ")", "{", "$", "query", "=", "new", "LdapQueryBuilder", "(", "$", "this", "->", "getLdapConnection", "(", ")", ")", ";", "$", "query", "->", "select", "(", "'objectSid'", ")", "->", "wher...
Make sure that the group exists and that the user is already a member of it. If not, at least give an informative message. @param string $name The group name. @return string The text SID of the group. @throws AttributeConverterException
[ "Make", "sure", "that", "the", "group", "exists", "and", "that", "the", "user", "is", "already", "a", "member", "of", "it", ".", "If", "not", "at", "least", "give", "an", "informative", "message", "." ]
b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7
https://github.com/ldaptools/ldaptools/blob/b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7/src/LdapTools/AttributeConverter/ConvertPrimaryGroup.php#L73-L94
27,973
ldaptools/ldaptools
src/LdapTools/BatchModify/BatchCollection.php
BatchCollection.add
public function add(Batch ...$batches) { foreach ($batches as $batch) { if (!$this->has($batch)) { $this->batches[] = $batch; } } return $this; }
php
public function add(Batch ...$batches) { foreach ($batches as $batch) { if (!$this->has($batch)) { $this->batches[] = $batch; } } return $this; }
[ "public", "function", "add", "(", "Batch", "...", "$", "batches", ")", "{", "foreach", "(", "$", "batches", "as", "$", "batch", ")", "{", "if", "(", "!", "$", "this", "->", "has", "(", "$", "batch", ")", ")", "{", "$", "this", "->", "batches", ...
Add an individual batch action to the collection. @param Batch[] ...$batches @return $this
[ "Add", "an", "individual", "batch", "action", "to", "the", "collection", "." ]
b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7
https://github.com/ldaptools/ldaptools/blob/b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7/src/LdapTools/BatchModify/BatchCollection.php#L59-L68
27,974
ldaptools/ldaptools
src/LdapTools/BatchModify/BatchCollection.php
BatchCollection.remove
public function remove(Batch ...$batches) { foreach ($batches as $batch) { foreach ($this->batches as $i => $batchItem) { if ($batchItem === $batch) { unset($this->batches[$i]); } } } return $this; }
php
public function remove(Batch ...$batches) { foreach ($batches as $batch) { foreach ($this->batches as $i => $batchItem) { if ($batchItem === $batch) { unset($this->batches[$i]); } } } return $this; }
[ "public", "function", "remove", "(", "Batch", "...", "$", "batches", ")", "{", "foreach", "(", "$", "batches", "as", "$", "batch", ")", "{", "foreach", "(", "$", "this", "->", "batches", "as", "$", "i", "=>", "$", "batchItem", ")", "{", "if", "(", ...
Remove a specific batch from the collection. @param Batch[] ...$batches @return $this
[ "Remove", "a", "specific", "batch", "from", "the", "collection", "." ]
b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7
https://github.com/ldaptools/ldaptools/blob/b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7/src/LdapTools/BatchModify/BatchCollection.php#L76-L87
27,975
ldaptools/ldaptools
src/LdapTools/BatchModify/BatchCollection.php
BatchCollection.has
public function has(Batch $batch) { foreach ($this->batches as $batchItem) { if ($batchItem === $batch) { return true; } } return false; }
php
public function has(Batch $batch) { foreach ($this->batches as $batchItem) { if ($batchItem === $batch) { return true; } } return false; }
[ "public", "function", "has", "(", "Batch", "$", "batch", ")", "{", "foreach", "(", "$", "this", "->", "batches", "as", "$", "batchItem", ")", "{", "if", "(", "$", "batchItem", "===", "$", "batch", ")", "{", "return", "true", ";", "}", "}", "return"...
Check if a specific batch index exists. @param Batch $batch @return bool
[ "Check", "if", "a", "specific", "batch", "index", "exists", "." ]
b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7
https://github.com/ldaptools/ldaptools/blob/b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7/src/LdapTools/BatchModify/BatchCollection.php#L95-L103
27,976
ldaptools/ldaptools
src/LdapTools/BatchModify/BatchCollection.php
BatchCollection.getBatchArray
public function getBatchArray() { $batchEntry = []; foreach ($this->batches as $batch) { $batchEntry[] = $batch->toArray(); } return $batchEntry; }
php
public function getBatchArray() { $batchEntry = []; foreach ($this->batches as $batch) { $batchEntry[] = $batch->toArray(); } return $batchEntry; }
[ "public", "function", "getBatchArray", "(", ")", "{", "$", "batchEntry", "=", "[", "]", ";", "foreach", "(", "$", "this", "->", "batches", "as", "$", "batch", ")", "{", "$", "batchEntry", "[", "]", "=", "$", "batch", "->", "toArray", "(", ")", ";",...
Get an array that represents the array form of each batch action to be sent to LDAP. @return array
[ "Get", "an", "array", "that", "represents", "the", "array", "form", "of", "each", "batch", "action", "to", "be", "sent", "to", "LDAP", "." ]
b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7
https://github.com/ldaptools/ldaptools/blob/b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7/src/LdapTools/BatchModify/BatchCollection.php#L143-L152
27,977
ldaptools/ldaptools
src/LdapTools/Utilities/ArrayToOperator.php
ArrayToOperator.getOperatorForSchema
public function getOperatorForSchema(LdapObjectSchema $schema, array $filter) { $operator = null; $categoryOperator = $this->getCategoryOperator($schema->getObjectCategory()); $classOperator = $this->getClassOperator($schema->getObjectClass()); if ($classOperator && $catego...
php
public function getOperatorForSchema(LdapObjectSchema $schema, array $filter) { $operator = null; $categoryOperator = $this->getCategoryOperator($schema->getObjectCategory()); $classOperator = $this->getClassOperator($schema->getObjectClass()); if ($classOperator && $catego...
[ "public", "function", "getOperatorForSchema", "(", "LdapObjectSchema", "$", "schema", ",", "array", "$", "filter", ")", "{", "$", "operator", "=", "null", ";", "$", "categoryOperator", "=", "$", "this", "->", "getCategoryOperator", "(", "$", "schema", "->", ...
Given a schema object and a filter array, construct the operator to be used for the schema. @param LdapObjectSchema $schema @param array $filter @return BaseOperator
[ "Given", "a", "schema", "object", "and", "a", "filter", "array", "construct", "the", "operator", "to", "be", "used", "for", "the", "schema", "." ]
b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7
https://github.com/ldaptools/ldaptools/blob/b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7/src/LdapTools/Utilities/ArrayToOperator.php#L80-L96
27,978
ldaptools/ldaptools
src/LdapTools/Query/Builder/FilterBuilder.php
FilterBuilder.getInstance
public static function getInstance(LdapConnectionInterface $connection = null) { if ($connection && $connection->getConfig()->getLdapType() == LdapConnection::TYPE_AD) { $filterBuilder = new ADFilterBuilder(); } else { $filterBuilder = new self(); } r...
php
public static function getInstance(LdapConnectionInterface $connection = null) { if ($connection && $connection->getConfig()->getLdapType() == LdapConnection::TYPE_AD) { $filterBuilder = new ADFilterBuilder(); } else { $filterBuilder = new self(); } r...
[ "public", "static", "function", "getInstance", "(", "LdapConnectionInterface", "$", "connection", "=", "null", ")", "{", "if", "(", "$", "connection", "&&", "$", "connection", "->", "getConfig", "(", ")", "->", "getLdapType", "(", ")", "==", "LdapConnection", ...
Get a FilterBuilder instance based on the connection. @param LdapConnectionInterface|null $connection @return ADFilterBuilder|FilterBuilder
[ "Get", "a", "FilterBuilder", "instance", "based", "on", "the", "connection", "." ]
b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7
https://github.com/ldaptools/ldaptools/blob/b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7/src/LdapTools/Query/Builder/FilterBuilder.php#L37-L46
27,979
ldaptools/ldaptools
src/LdapTools/Query/Builder/FilterBuilder.php
FilterBuilder.in
public function in($attribute, array $values) { return new bOr(...array_map(function($v) use ($attribute) { return $this->eq($attribute, $v); }, $values)); }
php
public function in($attribute, array $values) { return new bOr(...array_map(function($v) use ($attribute) { return $this->eq($attribute, $v); }, $values)); }
[ "public", "function", "in", "(", "$", "attribute", ",", "array", "$", "values", ")", "{", "return", "new", "bOr", "(", "...", "array_map", "(", "function", "(", "$", "v", ")", "use", "(", "$", "attribute", ")", "{", "return", "$", "this", "->", "eq...
Check if an attribute value matches any of the values in the list of values provided. @param string $attribute @param array $values @return bOr
[ "Check", "if", "an", "attribute", "value", "matches", "any", "of", "the", "values", "in", "the", "list", "of", "values", "provided", "." ]
b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7
https://github.com/ldaptools/ldaptools/blob/b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7/src/LdapTools/Query/Builder/FilterBuilder.php#L88-L93
27,980
ldaptools/ldaptools
src/LdapTools/Query/Builder/FilterBuilder.php
FilterBuilder.match
public function match($attribute, $rule, $value, $dnFlag = false) { return new MatchingRule($attribute, $rule, $value, $dnFlag); }
php
public function match($attribute, $rule, $value, $dnFlag = false) { return new MatchingRule($attribute, $rule, $value, $dnFlag); }
[ "public", "function", "match", "(", "$", "attribute", ",", "$", "rule", ",", "$", "value", ",", "$", "dnFlag", "=", "false", ")", "{", "return", "new", "MatchingRule", "(", "$", "attribute", ",", "$", "rule", ",", "$", "value", ",", "$", "dnFlag", ...
Perform an extensible match. @param string|null $attribute @param string|null $rule @param mixed $value @param bool $dnFlag @return MatchingRule
[ "Perform", "an", "extensible", "match", "." ]
b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7
https://github.com/ldaptools/ldaptools/blob/b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7/src/LdapTools/Query/Builder/FilterBuilder.php#L263-L266
27,981
ldaptools/ldaptools
src/LdapTools/Utilities/TcpSocket.php
TcpSocket.connect
public function connect($host, $port, $timeout = 1) { $this->socket = @stream_socket_client( "tcp://$host:$port", $errorNumber, $errorMessage, $timeout, STREAM_CLIENT_CONNECT, stream_context_create($this->options) ); re...
php
public function connect($host, $port, $timeout = 1) { $this->socket = @stream_socket_client( "tcp://$host:$port", $errorNumber, $errorMessage, $timeout, STREAM_CLIENT_CONNECT, stream_context_create($this->options) ); re...
[ "public", "function", "connect", "(", "$", "host", ",", "$", "port", ",", "$", "timeout", "=", "1", ")", "{", "$", "this", "->", "socket", "=", "@", "stream_socket_client", "(", "\"tcp://$host:$port\"", ",", "$", "errorNumber", ",", "$", "errorMessage", ...
Connect to the host on the port defined for this TCP socket. @param string $host @param int $port @param int $timeout @return bool
[ "Connect", "to", "the", "host", "on", "the", "port", "defined", "for", "this", "TCP", "socket", "." ]
b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7
https://github.com/ldaptools/ldaptools/blob/b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7/src/LdapTools/Utilities/TcpSocket.php#L46-L58
27,982
ldaptools/ldaptools
src/LdapTools/ConfigurationParseTrait.php
ConfigurationParseTrait.getParsedConfig
protected function getParsedConfig(array $config, array $existingConfig, array $configMap, array $required) { $parsedConfig = []; foreach ($config as $key => $value) { $cfgKey = strtolower($key); if (!isset($configMap[$cfgKey])) { throw new ConfigurationExcep...
php
protected function getParsedConfig(array $config, array $existingConfig, array $configMap, array $required) { $parsedConfig = []; foreach ($config as $key => $value) { $cfgKey = strtolower($key); if (!isset($configMap[$cfgKey])) { throw new ConfigurationExcep...
[ "protected", "function", "getParsedConfig", "(", "array", "$", "config", ",", "array", "$", "existingConfig", ",", "array", "$", "configMap", ",", "array", "$", "required", ")", "{", "$", "parsedConfig", "=", "[", "]", ";", "foreach", "(", "$", "config", ...
Parses a YAML config section and sends it back as the correct config values as an array. @param array $config The YAML config section as an array. @param array $existingConfig The config before merging the YAML config. @param array $configMap The YAML to config key map array. @param array $required The required option...
[ "Parses", "a", "YAML", "config", "section", "and", "sends", "it", "back", "as", "the", "correct", "config", "values", "as", "an", "array", "." ]
b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7
https://github.com/ldaptools/ldaptools/blob/b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7/src/LdapTools/ConfigurationParseTrait.php#L32-L60
27,983
ldaptools/ldaptools
src/LdapTools/ConfigurationParseTrait.php
ConfigurationParseTrait.isParsedConfigValid
protected function isParsedConfigValid(array $config, array $required) { $inConfig = count(array_intersect_key(array_flip($required), array_filter($config))); return $inConfig === count($required); }
php
protected function isParsedConfigValid(array $config, array $required) { $inConfig = count(array_intersect_key(array_flip($required), array_filter($config))); return $inConfig === count($required); }
[ "protected", "function", "isParsedConfigValid", "(", "array", "$", "config", ",", "array", "$", "required", ")", "{", "$", "inConfig", "=", "count", "(", "array_intersect_key", "(", "array_flip", "(", "$", "required", ")", ",", "array_filter", "(", "$", "con...
Checks whether all required values for the configuration have been set after the merge. @param array $config @param array $required @return bool
[ "Checks", "whether", "all", "required", "values", "for", "the", "configuration", "have", "been", "set", "after", "the", "merge", "." ]
b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7
https://github.com/ldaptools/ldaptools/blob/b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7/src/LdapTools/ConfigurationParseTrait.php#L69-L74
27,984
ldaptools/ldaptools
src/LdapTools/ConfigurationParseTrait.php
ConfigurationParseTrait.setParsedConfig
protected function setParsedConfig(array $config) { foreach ($config as $key => $value) { $setter = 'set'.ucfirst($key); $this->$setter($value); } }
php
protected function setParsedConfig(array $config) { foreach ($config as $key => $value) { $setter = 'set'.ucfirst($key); $this->$setter($value); } }
[ "protected", "function", "setParsedConfig", "(", "array", "$", "config", ")", "{", "foreach", "(", "$", "config", "as", "$", "key", "=>", "$", "value", ")", "{", "$", "setter", "=", "'set'", ".", "ucfirst", "(", "$", "key", ")", ";", "$", "this", "...
Given a config that has been parsed to what the config values should be, call the setters to make sure all values are validated by any additional logic in the setters. @param array $config
[ "Given", "a", "config", "that", "has", "been", "parsed", "to", "what", "the", "config", "values", "should", "be", "call", "the", "setters", "to", "make", "sure", "all", "values", "are", "validated", "by", "any", "additional", "logic", "in", "the", "setters...
b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7
https://github.com/ldaptools/ldaptools/blob/b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7/src/LdapTools/ConfigurationParseTrait.php#L82-L88
27,985
ldaptools/ldaptools
src/LdapTools/Utilities/UserParameters.php
UserParameters.toBinary
public function toBinary() { /** * @todo There is no documentation on the reserved data, but this is how it seems to act. May need to change this. */ if (!$this->tsPropertyArray && !$this->dialInData) { $binary = $this->encodeReservedData(''); } elseif ($this->t...
php
public function toBinary() { /** * @todo There is no documentation on the reserved data, but this is how it seems to act. May need to change this. */ if (!$this->tsPropertyArray && !$this->dialInData) { $binary = $this->encodeReservedData(''); } elseif ($this->t...
[ "public", "function", "toBinary", "(", ")", "{", "/**\n * @todo There is no documentation on the reserved data, but this is how it seems to act. May need to change this.\n */", "if", "(", "!", "$", "this", "->", "tsPropertyArray", "&&", "!", "$", "this", "->", "...
Get the userParameters in binary form that can be saved back to LDAP. @return string
[ "Get", "the", "userParameters", "in", "binary", "form", "that", "can", "be", "saved", "back", "to", "LDAP", "." ]
b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7
https://github.com/ldaptools/ldaptools/blob/b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7/src/LdapTools/Utilities/UserParameters.php#L115-L124
27,986
ldaptools/ldaptools
src/LdapTools/Hydrator/OperationHydrator.php
OperationHydrator.setDnToUse
protected function setDnToUse(AddOperation $operation) { // If the DN was explicitly set, don't do anything. if ($operation->getDn()) { return; } if (!$this->schema) { throw new LogicException("You must explicitly set the DN or specify a schema type."); ...
php
protected function setDnToUse(AddOperation $operation) { // If the DN was explicitly set, don't do anything. if ($operation->getDn()) { return; } if (!$this->schema) { throw new LogicException("You must explicitly set the DN or specify a schema type."); ...
[ "protected", "function", "setDnToUse", "(", "AddOperation", "$", "operation", ")", "{", "// If the DN was explicitly set, don't do anything.", "if", "(", "$", "operation", "->", "getDn", "(", ")", ")", "{", "return", ";", "}", "if", "(", "!", "$", "this", "->"...
Builds the DN based off of the "name" attribute. The name attribute should be mapped to the "cn" attribute in pretty much all cases except for creating an OU object. Then the "name" attribute should be mapped to "ou". @param AddOperation $operation
[ "Builds", "the", "DN", "based", "off", "of", "the", "name", "attribute", ".", "The", "name", "attribute", "should", "be", "mapped", "to", "the", "cn", "attribute", "in", "pretty", "much", "all", "cases", "except", "for", "creating", "an", "OU", "object", ...
b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7
https://github.com/ldaptools/ldaptools/blob/b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7/src/LdapTools/Hydrator/OperationHydrator.php#L158-L176
27,987
ldaptools/ldaptools
src/LdapTools/Hydrator/OperationHydrator.php
OperationHydrator.getRdnFromAttributes
protected function getRdnFromAttributes(array $attributes) { $rdn = []; $rdnAttributes = array_map('strtolower', $this->schema->getRdn()); foreach ($rdnAttributes as $rdnAttribute) { $rdnAttribute = $this->schema->getAttributeToLdap($rdnAttribute); foreach ($attributes a...
php
protected function getRdnFromAttributes(array $attributes) { $rdn = []; $rdnAttributes = array_map('strtolower', $this->schema->getRdn()); foreach ($rdnAttributes as $rdnAttribute) { $rdnAttribute = $this->schema->getAttributeToLdap($rdnAttribute); foreach ($attributes a...
[ "protected", "function", "getRdnFromAttributes", "(", "array", "$", "attributes", ")", "{", "$", "rdn", "=", "[", "]", ";", "$", "rdnAttributes", "=", "array_map", "(", "'strtolower'", ",", "$", "this", "->", "schema", "->", "getRdn", "(", ")", ")", ";",...
Get the RDN attribute used to form the DN. @param array $attributes The attribute names. @return array
[ "Get", "the", "RDN", "attribute", "used", "to", "form", "the", "DN", "." ]
b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7
https://github.com/ldaptools/ldaptools/blob/b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7/src/LdapTools/Hydrator/OperationHydrator.php#L184-L205
27,988
ldaptools/ldaptools
src/LdapTools/Hydrator/OperationHydrator.php
OperationHydrator.setDefaultParameters
protected function setDefaultParameters() { if (!$this->connection) { return; } $this->parameters['_domainname_'] = $this->connection->getConfig()->getDomainName(); $rootDse = $this->connection->getRootDse(); // Would this ever not be true? I'm unable to find any...
php
protected function setDefaultParameters() { if (!$this->connection) { return; } $this->parameters['_domainname_'] = $this->connection->getConfig()->getDomainName(); $rootDse = $this->connection->getRootDse(); // Would this ever not be true? I'm unable to find any...
[ "protected", "function", "setDefaultParameters", "(", ")", "{", "if", "(", "!", "$", "this", "->", "connection", ")", "{", "return", ";", "}", "$", "this", "->", "parameters", "[", "'_domainname_'", "]", "=", "$", "this", "->", "connection", "->", "getCo...
Set some default parameters based off the connection.
[ "Set", "some", "default", "parameters", "based", "off", "the", "connection", "." ]
b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7
https://github.com/ldaptools/ldaptools/blob/b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7/src/LdapTools/Hydrator/OperationHydrator.php#L238-L253
27,989
ldaptools/ldaptools
src/LdapTools/Hydrator/OperationHydrator.php
OperationHydrator.filterAttributeValues
protected function filterAttributeValues(array $attributes) { return array_filter($attributes, function ($value) { if (is_array($value) && empty($value)) { return false; } return !($value === '' || $value === null); }); }
php
protected function filterAttributeValues(array $attributes) { return array_filter($attributes, function ($value) { if (is_array($value) && empty($value)) { return false; } return !($value === '' || $value === null); }); }
[ "protected", "function", "filterAttributeValues", "(", "array", "$", "attributes", ")", "{", "return", "array_filter", "(", "$", "attributes", ",", "function", "(", "$", "value", ")", "{", "if", "(", "is_array", "(", "$", "value", ")", "&&", "empty", "(", ...
Remove empty strings and null values from attribute value arrays. This prevents errors when saving to LDAP and these are present for some reason. @param array $attributes @return array
[ "Remove", "empty", "strings", "and", "null", "values", "from", "attribute", "value", "arrays", ".", "This", "prevents", "errors", "when", "saving", "to", "LDAP", "and", "these", "are", "present", "for", "some", "reason", "." ]
b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7
https://github.com/ldaptools/ldaptools/blob/b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7/src/LdapTools/Hydrator/OperationHydrator.php#L271-L280
27,990
ldaptools/ldaptools
src/LdapTools/Connection/PageControl.php
PageControl.start
public function start($pageSize, $sizeLimit = 0) { if ($this->isEnabled) { $this->cookie = ''; $this->pageSize = ($sizeLimit && $sizeLimit < $pageSize) ? $sizeLimit : $pageSize; $this->sizeLimit = $sizeLimit; } }
php
public function start($pageSize, $sizeLimit = 0) { if ($this->isEnabled) { $this->cookie = ''; $this->pageSize = ($sizeLimit && $sizeLimit < $pageSize) ? $sizeLimit : $pageSize; $this->sizeLimit = $sizeLimit; } }
[ "public", "function", "start", "(", "$", "pageSize", ",", "$", "sizeLimit", "=", "0", ")", "{", "if", "(", "$", "this", "->", "isEnabled", ")", "{", "$", "this", "->", "cookie", "=", "''", ";", "$", "this", "->", "pageSize", "=", "(", "$", "sizeL...
Start a paging operation by setting up the cookie and the page size. Optionally set a size limit. @param int $pageSize @param int $sizeLimit @throws LdapConnectionException
[ "Start", "a", "paging", "operation", "by", "setting", "up", "the", "cookie", "and", "the", "page", "size", ".", "Optionally", "set", "a", "size", "limit", "." ]
b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7
https://github.com/ldaptools/ldaptools/blob/b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7/src/LdapTools/Connection/PageControl.php#L67-L74
27,991
ldaptools/ldaptools
src/LdapTools/Connection/PageControl.php
PageControl.end
public function end() { if ($this->isEnabled) { $this->resetPagingControl(); $this->cookie = null; $this->resultNumber = 0; } }
php
public function end() { if ($this->isEnabled) { $this->resetPagingControl(); $this->cookie = null; $this->resultNumber = 0; } }
[ "public", "function", "end", "(", ")", "{", "if", "(", "$", "this", "->", "isEnabled", ")", "{", "$", "this", "->", "resetPagingControl", "(", ")", ";", "$", "this", "->", "cookie", "=", "null", ";", "$", "this", "->", "resultNumber", "=", "0", ";"...
End a paging operation. @throws LdapConnectionException
[ "End", "a", "paging", "operation", "." ]
b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7
https://github.com/ldaptools/ldaptools/blob/b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7/src/LdapTools/Connection/PageControl.php#L81-L88
27,992
ldaptools/ldaptools
src/LdapTools/Connection/PageControl.php
PageControl.next
public function next() { if (!$this->isEnabled) { return; } // If the size limit exceeds the page size, and the next page would exceed the limit, reduce the page size... if ($this->sizeLimit && ($this->resultNumber + $this->pageSize) > $this->sizeLimit) { $thi...
php
public function next() { if (!$this->isEnabled) { return; } // If the size limit exceeds the page size, and the next page would exceed the limit, reduce the page size... if ($this->sizeLimit && ($this->resultNumber + $this->pageSize) > $this->sizeLimit) { $thi...
[ "public", "function", "next", "(", ")", "{", "if", "(", "!", "$", "this", "->", "isEnabled", ")", "{", "return", ";", "}", "// If the size limit exceeds the page size, and the next page would exceed the limit, reduce the page size...", "if", "(", "$", "this", "->", "s...
Signifies to the connection to expect the next paged result with the current cookie and page size. @throws LdapConnectionException
[ "Signifies", "to", "the", "connection", "to", "expect", "the", "next", "paged", "result", "with", "the", "current", "cookie", "and", "page", "size", "." ]
b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7
https://github.com/ldaptools/ldaptools/blob/b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7/src/LdapTools/Connection/PageControl.php#L95-L111
27,993
ldaptools/ldaptools
src/LdapTools/Connection/PageControl.php
PageControl.update
public function update($result) { if (!$this->isEnabled) { return; } $this->resultNumber += $this->pageSize; if (!@ldap_control_paged_result_response($this->connection->getResource(), $result, $this->cookie)) { throw new LdapConnectionException( ...
php
public function update($result) { if (!$this->isEnabled) { return; } $this->resultNumber += $this->pageSize; if (!@ldap_control_paged_result_response($this->connection->getResource(), $result, $this->cookie)) { throw new LdapConnectionException( ...
[ "public", "function", "update", "(", "$", "result", ")", "{", "if", "(", "!", "$", "this", "->", "isEnabled", ")", "{", "return", ";", "}", "$", "this", "->", "resultNumber", "+=", "$", "this", "->", "pageSize", ";", "if", "(", "!", "@", "ldap_cont...
Updating the paging operation based on the result resource returned from a query. @param resource $result @throws LdapConnectionException
[ "Updating", "the", "paging", "operation", "based", "on", "the", "result", "resource", "returned", "from", "a", "query", "." ]
b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7
https://github.com/ldaptools/ldaptools/blob/b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7/src/LdapTools/Connection/PageControl.php#L119-L130
27,994
ldaptools/ldaptools
src/LdapTools/Connection/PageControl.php
PageControl.resetPagingControl
public function resetPagingControl() { // Per RFC 2696, to abandon a paged search you should send a size of 0 along with the cookie used in the search. // However, testing this it doesn't seem to completely work. Perhaps a PHP bug? if (!@ldap_control_paged_result($this->connection->getResour...
php
public function resetPagingControl() { // Per RFC 2696, to abandon a paged search you should send a size of 0 along with the cookie used in the search. // However, testing this it doesn't seem to completely work. Perhaps a PHP bug? if (!@ldap_control_paged_result($this->connection->getResour...
[ "public", "function", "resetPagingControl", "(", ")", "{", "// Per RFC 2696, to abandon a paged search you should send a size of 0 along with the cookie used in the search.", "// However, testing this it doesn't seem to completely work. Perhaps a PHP bug?", "if", "(", "!", "@", "ldap_control...
Resets the paging control so that read operations work after a paging operation is used. @throws LdapConnectionException
[ "Resets", "the", "paging", "control", "so", "that", "read", "operations", "work", "after", "a", "paging", "operation", "is", "used", "." ]
b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7
https://github.com/ldaptools/ldaptools/blob/b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7/src/LdapTools/Connection/PageControl.php#L137-L147
27,995
ldaptools/ldaptools
src/LdapTools/Query/Operator/BaseOperator.php
BaseOperator.getConvertedValue
public function getConvertedValue($alias = null) { if ($alias && isset($this->convertedAliasValue[$alias])) { return $this->convertedAliasValue[$alias]; } else { return $this->convertedValue; } }
php
public function getConvertedValue($alias = null) { if ($alias && isset($this->convertedAliasValue[$alias])) { return $this->convertedAliasValue[$alias]; } else { return $this->convertedValue; } }
[ "public", "function", "getConvertedValue", "(", "$", "alias", "=", "null", ")", "{", "if", "(", "$", "alias", "&&", "isset", "(", "$", "this", "->", "convertedAliasValue", "[", "$", "alias", "]", ")", ")", "{", "return", "$", "this", "->", "convertedAl...
Get the converted value. @param string|null $alias @return mixed
[ "Get", "the", "converted", "value", "." ]
b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7
https://github.com/ldaptools/ldaptools/blob/b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7/src/LdapTools/Query/Operator/BaseOperator.php#L124-L131
27,996
ldaptools/ldaptools
src/LdapTools/Query/Operator/BaseOperator.php
BaseOperator.setConvertedValue
public function setConvertedValue($value, $alias = null) { if ($alias) { $this->convertedAliasValue[$alias] = $value; } else { $this->convertedValue = $value; } }
php
public function setConvertedValue($value, $alias = null) { if ($alias) { $this->convertedAliasValue[$alias] = $value; } else { $this->convertedValue = $value; } }
[ "public", "function", "setConvertedValue", "(", "$", "value", ",", "$", "alias", "=", "null", ")", "{", "if", "(", "$", "alias", ")", "{", "$", "this", "->", "convertedAliasValue", "[", "$", "alias", "]", "=", "$", "value", ";", "}", "else", "{", "...
Set the converted value. @param string|null $alias @param mixed $value
[ "Set", "the", "converted", "value", "." ]
b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7
https://github.com/ldaptools/ldaptools/blob/b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7/src/LdapTools/Query/Operator/BaseOperator.php#L139-L146
27,997
ldaptools/ldaptools
src/LdapTools/Query/Operator/BaseOperator.php
BaseOperator.setAttribute
public function setAttribute($attribute) { if (strpos($attribute, '.') !== false) { $pieces = explode('.', $attribute, 2); $this->setAlias($pieces[0]); $attribute = $pieces[1]; // If an alias was already set then this must be set back to null. } else { ...
php
public function setAttribute($attribute) { if (strpos($attribute, '.') !== false) { $pieces = explode('.', $attribute, 2); $this->setAlias($pieces[0]); $attribute = $pieces[1]; // If an alias was already set then this must be set back to null. } else { ...
[ "public", "function", "setAttribute", "(", "$", "attribute", ")", "{", "if", "(", "strpos", "(", "$", "attribute", ",", "'.'", ")", "!==", "false", ")", "{", "$", "pieces", "=", "explode", "(", "'.'", ",", "$", "attribute", ",", "2", ")", ";", "$",...
Set the attribute. @param string $attribute
[ "Set", "the", "attribute", "." ]
b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7
https://github.com/ldaptools/ldaptools/blob/b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7/src/LdapTools/Query/Operator/BaseOperator.php#L163-L174
27,998
ldaptools/ldaptools
src/LdapTools/Query/Operator/BaseOperator.php
BaseOperator.setOperatorSymbol
public function setOperatorSymbol($symbol) { if (!in_array($symbol, $this->validOperators)) { throw new LdapQueryException(sprintf( 'Invalid operator symbol "%s". Valid operator symbols are: %s', $symbol, implode(', ', $this->validOperators) ...
php
public function setOperatorSymbol($symbol) { if (!in_array($symbol, $this->validOperators)) { throw new LdapQueryException(sprintf( 'Invalid operator symbol "%s". Valid operator symbols are: %s', $symbol, implode(', ', $this->validOperators) ...
[ "public", "function", "setOperatorSymbol", "(", "$", "symbol", ")", "{", "if", "(", "!", "in_array", "(", "$", "symbol", ",", "$", "this", "->", "validOperators", ")", ")", "{", "throw", "new", "LdapQueryException", "(", "sprintf", "(", "'Invalid operator sy...
Set the operator symbol in use. @param $symbol @throws LdapQueryException
[ "Set", "the", "operator", "symbol", "in", "use", "." ]
b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7
https://github.com/ldaptools/ldaptools/blob/b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7/src/LdapTools/Query/Operator/BaseOperator.php#L222-L233
27,999
ldaptools/ldaptools
src/LdapTools/Query/Operator/BaseOperator.php
BaseOperator.setWasConverterUsed
public function setWasConverterUsed($value, $alias = null) { if ($alias) { $this->converterAliasUsed[$alias] = (bool) $value; } else { $this->converterUsed = (bool) $value; } }
php
public function setWasConverterUsed($value, $alias = null) { if ($alias) { $this->converterAliasUsed[$alias] = (bool) $value; } else { $this->converterUsed = (bool) $value; } }
[ "public", "function", "setWasConverterUsed", "(", "$", "value", ",", "$", "alias", "=", "null", ")", "{", "if", "(", "$", "alias", ")", "{", "$", "this", "->", "converterAliasUsed", "[", "$", "alias", "]", "=", "(", "bool", ")", "$", "value", ";", ...
Set whether a converter was used or not. @param bool $value @param string|null $alias
[ "Set", "whether", "a", "converter", "was", "used", "or", "not", "." ]
b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7
https://github.com/ldaptools/ldaptools/blob/b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7/src/LdapTools/Query/Operator/BaseOperator.php#L281-L288