repository_name
stringlengths
5
67
func_path_in_repository
stringlengths
4
234
func_name
stringlengths
0
314
whole_func_string
stringlengths
52
3.87M
language
stringclasses
6 values
func_code_string
stringlengths
52
3.87M
func_code_tokens
listlengths
15
672k
func_documentation_string
stringlengths
1
47.2k
func_documentation_tokens
listlengths
1
3.92k
split_name
stringclasses
1 value
func_code_url
stringlengths
85
339
Eresus/EresusCMS
src/core/framework/core/3rdparty/ezcomponents/Translation/src/translation.php
ezcTranslation.parameterCallback
private function parameterCallback( $key, array $params ) { if ( !isset( $params[strtolower( $key )] ) ) { throw new ezcTranslationParameterMissingException( $key ); } $string = $params[strtolower( $key )]; // We use ctype_upper() here to check if the first charac...
php
private function parameterCallback( $key, array $params ) { if ( !isset( $params[strtolower( $key )] ) ) { throw new ezcTranslationParameterMissingException( $key ); } $string = $params[strtolower( $key )]; // We use ctype_upper() here to check if the first charac...
[ "private", "function", "parameterCallback", "(", "$", "key", ",", "array", "$", "params", ")", "{", "if", "(", "!", "isset", "(", "$", "params", "[", "strtolower", "(", "$", "key", ")", "]", ")", ")", "{", "throw", "new", "ezcTranslationParameterMissingE...
Returns the replacement for the key $key from the parameters $params. The params array is an associative array in the form array('key'=>'value'). This is a callback function used by the getTranslation() method for each matched parameter in the translated string. @param string $key @param array $params @return strin...
[ "Returns", "the", "replacement", "for", "the", "key", "$key", "from", "the", "parameters", "$params", "." ]
train
https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/Translation/src/translation.php#L64-L83
Eresus/EresusCMS
src/core/framework/core/3rdparty/ezcomponents/Translation/src/translation.php
ezcTranslation.getTranslation
public function getTranslation( $key, array $params = array() ) { if ( !isset( $this->translationMap[$key] ) ) { throw new ezcTranslationKeyNotAvailableException( $key ); } $translatedString = $this->translationMap[$key]->translation; // Little optimization to pre...
php
public function getTranslation( $key, array $params = array() ) { if ( !isset( $this->translationMap[$key] ) ) { throw new ezcTranslationKeyNotAvailableException( $key ); } $translatedString = $this->translationMap[$key]->translation; // Little optimization to pre...
[ "public", "function", "getTranslation", "(", "$", "key", ",", "array", "$", "params", "=", "array", "(", ")", ")", "{", "if", "(", "!", "isset", "(", "$", "this", "->", "translationMap", "[", "$", "key", "]", ")", ")", "{", "throw", "new", "ezcTran...
Returns the translated version of the original string $key. This method returns a translated string and substitutes the parameters $param in the localized string. @throws ezcTranslationKeyNotAvailableException when the key is not available in the translation definitions @throws ezcTranslationParameterMissingException...
[ "Returns", "the", "translated", "version", "of", "the", "original", "string", "$key", "." ]
train
https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/Translation/src/translation.php#L99-L117
Eresus/EresusCMS
src/core/framework/core/3rdparty/ezcomponents/Translation/src/translation.php
ezcTranslation.parameterCallbackCompile
private function parameterCallbackCompile( $key, array $params ) { if ( !isset( $params[strtolower( $key )] ) ) { throw new ezcTranslationParameterMissingException( $key ); } // We use ctype_upper() here to check if the first character of the key // is an uppercas...
php
private function parameterCallbackCompile( $key, array $params ) { if ( !isset( $params[strtolower( $key )] ) ) { throw new ezcTranslationParameterMissingException( $key ); } // We use ctype_upper() here to check if the first character of the key // is an uppercas...
[ "private", "function", "parameterCallbackCompile", "(", "$", "key", ",", "array", "$", "params", ")", "{", "if", "(", "!", "isset", "(", "$", "params", "[", "strtolower", "(", "$", "key", ")", "]", ")", ")", "{", "throw", "new", "ezcTranslationParameterM...
Returns the replacement for the key $key from the parameters $params. The params array is an associative array in the form array('key'=>'value'). This is a callback function used by the compileTranslation() method for each matched parameter in the translated string. @param string $key @param array $params @return s...
[ "Returns", "the", "replacement", "for", "the", "key", "$key", "from", "the", "parameters", "$params", "." ]
train
https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/Translation/src/translation.php#L131-L153
Eresus/EresusCMS
src/core/framework/core/3rdparty/ezcomponents/Translation/src/translation.php
ezcTranslation.compileTranslation
public function compileTranslation( $key, array $params = array() ) { if ( !isset( $this->translationMap[$key] ) ) { throw new ezcTranslationKeyNotAvailableException( $key ); } $translatedString = var_export( $this->translationMap[$key]->translation, true ); // Li...
php
public function compileTranslation( $key, array $params = array() ) { if ( !isset( $this->translationMap[$key] ) ) { throw new ezcTranslationKeyNotAvailableException( $key ); } $translatedString = var_export( $this->translationMap[$key]->translation, true ); // Li...
[ "public", "function", "compileTranslation", "(", "$", "key", ",", "array", "$", "params", "=", "array", "(", ")", ")", "{", "if", "(", "!", "isset", "(", "$", "this", "->", "translationMap", "[", "$", "key", "]", ")", ")", "{", "throw", "new", "ezc...
Returns the translated version of the original string $key. This method returns a translated string and substitutes the parameters $param in the localized string with PHP code to place the variable data into the string at a later moment. Instead of the values for each of the parameters, an expression to get to the dat...
[ "Returns", "the", "translated", "version", "of", "the", "original", "string", "$key", "." ]
train
https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/Translation/src/translation.php#L177-L195
thupan/framework
src/Service/Session.php
Session.getInstance
public static function getInstance() { if (self::$instance == false) { self::$config = autoload_config(); ini_set('session.cookie_httponly', self::$config['app']['SESSION_COOKIE_HTTPONLY']); self::$instance = self::generateToken(); @session_name(self::$inst...
php
public static function getInstance() { if (self::$instance == false) { self::$config = autoload_config(); ini_set('session.cookie_httponly', self::$config['app']['SESSION_COOKIE_HTTPONLY']); self::$instance = self::generateToken(); @session_name(self::$inst...
[ "public", "static", "function", "getInstance", "(", ")", "{", "if", "(", "self", "::", "$", "instance", "==", "false", ")", "{", "self", "::", "$", "config", "=", "autoload_config", "(", ")", ";", "ini_set", "(", "'session.cookie_httponly'", ",", "self", ...
Método público para inicializar a classe de sessão. @method init() @param none @return none
[ "Método", "público", "para", "inicializar", "a", "classe", "de", "sessão", "." ]
train
https://github.com/thupan/framework/blob/43193c67e87942930fb0cbc53aa069b60b27e749/src/Service/Session.php#L50-L67
thupan/framework
src/Service/Session.php
Session.flash
public static function flash($key = false) { $value = self::get($key ? $key : 'flash'); self::remove($key ? $key : 'flash'); return $value ? $value : false; }
php
public static function flash($key = false) { $value = self::get($key ? $key : 'flash'); self::remove($key ? $key : 'flash'); return $value ? $value : false; }
[ "public", "static", "function", "flash", "(", "$", "key", "=", "false", ")", "{", "$", "value", "=", "self", "::", "get", "(", "$", "key", "?", "$", "key", ":", "'flash'", ")", ";", "self", "::", "remove", "(", "$", "key", "?", "$", "key", ":",...
Método público retorna valor de uma determinada sessão e se auto-destroi. @method flash() @param string @return string / Bool
[ "Método", "público", "retorna", "valor", "de", "uma", "determinada", "sessão", "e", "se", "auto", "-", "destroi", "." ]
train
https://github.com/thupan/framework/blob/43193c67e87942930fb0cbc53aa069b60b27e749/src/Service/Session.php#L155-L161
thupan/framework
src/Service/Session.php
Session.getArray
public static function getArray() { $data = []; foreach ($_SESSION as $key => $val) { $data[$key] = $val; } return $data; }
php
public static function getArray() { $data = []; foreach ($_SESSION as $key => $val) { $data[$key] = $val; } return $data; }
[ "public", "static", "function", "getArray", "(", ")", "{", "$", "data", "=", "[", "]", ";", "foreach", "(", "$", "_SESSION", "as", "$", "key", "=>", "$", "val", ")", "{", "$", "data", "[", "$", "key", "]", "=", "$", "val", ";", "}", "return", ...
Método público retorna toda sessão em array. @method getArray() @param none @retun Array
[ "Método", "público", "retorna", "toda", "sessão", "em", "array", "." ]
train
https://github.com/thupan/framework/blob/43193c67e87942930fb0cbc53aa069b60b27e749/src/Service/Session.php#L171-L180
mothership-ec/composer
src/Composer/Package/Version/VersionSelector.php
VersionSelector.findBestCandidate
public function findBestCandidate($packageName, $targetPackageVersion = null) { $constraint = $targetPackageVersion ? $this->getParser()->parseConstraints($targetPackageVersion) : null; $candidates = $this->pool->whatProvides(strtolower($packageName), $constraint, true); if (!$candidates) {...
php
public function findBestCandidate($packageName, $targetPackageVersion = null) { $constraint = $targetPackageVersion ? $this->getParser()->parseConstraints($targetPackageVersion) : null; $candidates = $this->pool->whatProvides(strtolower($packageName), $constraint, true); if (!$candidates) {...
[ "public", "function", "findBestCandidate", "(", "$", "packageName", ",", "$", "targetPackageVersion", "=", "null", ")", "{", "$", "constraint", "=", "$", "targetPackageVersion", "?", "$", "this", "->", "getParser", "(", ")", "->", "parseConstraints", "(", "$",...
Given a package name and optional version, returns the latest PackageInterface that matches. @param string $packageName @param string $targetPackageVersion @return PackageInterface|bool
[ "Given", "a", "package", "name", "and", "optional", "version", "returns", "the", "latest", "PackageInterface", "that", "matches", "." ]
train
https://github.com/mothership-ec/composer/blob/fa6ad031a939d8d33b211e428fdbdd28cfce238c/src/Composer/Package/Version/VersionSelector.php#L45-L63
j-d/draggy
src/Draggy/Autocode/Project.php
Project.&
public function &getEntityByFullyQualifiedName($name) { if (!isset( $this->entities[$name] )) { throw new \RuntimeException( 'An entity by the name of ' . $name . ' could not be located.' ); } return $this->entities[$name]; }
php
public function &getEntityByFullyQualifiedName($name) { if (!isset( $this->entities[$name] )) { throw new \RuntimeException( 'An entity by the name of ' . $name . ' could not be located.' ); } return $this->entities[$name]; }
[ "public", "function", "&", "getEntityByFullyQualifiedName", "(", "$", "name", ")", "{", "if", "(", "!", "isset", "(", "$", "this", "->", "entities", "[", "$", "name", "]", ")", ")", "{", "throw", "new", "\\", "RuntimeException", "(", "'An entity by the nam...
<user-additions part="otherMethods">
[ "<user", "-", "additions", "part", "=", "otherMethods", ">" ]
train
https://github.com/j-d/draggy/blob/97ffc66e1aacb5f685d7aac5251c4abb8888d4bb/src/Draggy/Autocode/Project.php#L175-L182
j-d/draggy
src/Draggy/Autocode/Project.php
Project.getAutocodeProperty
public function getAutocodeProperty($property) { return isset($this->autocodeProperties[$property]) ? $this->autocodeProperties[$property] : null; }
php
public function getAutocodeProperty($property) { return isset($this->autocodeProperties[$property]) ? $this->autocodeProperties[$property] : null; }
[ "public", "function", "getAutocodeProperty", "(", "$", "property", ")", "{", "return", "isset", "(", "$", "this", "->", "autocodeProperties", "[", "$", "property", "]", ")", "?", "$", "this", "->", "autocodeProperties", "[", "$", "property", "]", ":", "nul...
@param $property @return bool
[ "@param", "$property" ]
train
https://github.com/j-d/draggy/blob/97ffc66e1aacb5f685d7aac5251c4abb8888d4bb/src/Draggy/Autocode/Project.php#L378-L383
j-d/draggy
src/Draggy/Autocode/Project.php
Project.loadDesign
public function loadDesign(\SimpleXMLElement $xmlDesign) { // Load project properties $projectProperties = (array) $xmlDesign->xpath('project')[0]; $this->setLanguage((string) $projectProperties['language']); $this->setFramework((string) $projectProperties['framework']); $th...
php
public function loadDesign(\SimpleXMLElement $xmlDesign) { // Load project properties $projectProperties = (array) $xmlDesign->xpath('project')[0]; $this->setLanguage((string) $projectProperties['language']); $this->setFramework((string) $projectProperties['framework']); $th...
[ "public", "function", "loadDesign", "(", "\\", "SimpleXMLElement", "$", "xmlDesign", ")", "{", "// Load project properties", "$", "projectProperties", "=", "(", "array", ")", "$", "xmlDesign", "->", "xpath", "(", "'project'", ")", "[", "0", "]", ";", "$", "t...
Loads the XML design to the project @param \SimpleXMLElement $xmlDesign @return $this @throws \RuntimeException @throws \Exception
[ "Loads", "the", "XML", "design", "to", "the", "project" ]
train
https://github.com/j-d/draggy/blob/97ffc66e1aacb5f685d7aac5251c4abb8888d4bb/src/Draggy/Autocode/Project.php#L643-L1158
j-d/draggy
src/Draggy/Autocode/Project.php
Project.getActualAttributeName
public function getActualAttributeName(Entity $entity, $name, $hint = '', $force = false) { if ($entity->hasAttributeByName($name) || $force) { if (!$entity->hasAttributeByName($name . $hint)) { return [$name, $hint]; } $append = 1; while ($e...
php
public function getActualAttributeName(Entity $entity, $name, $hint = '', $force = false) { if ($entity->hasAttributeByName($name) || $force) { if (!$entity->hasAttributeByName($name . $hint)) { return [$name, $hint]; } $append = 1; while ($e...
[ "public", "function", "getActualAttributeName", "(", "Entity", "$", "entity", ",", "$", "name", ",", "$", "hint", "=", "''", ",", "$", "force", "=", "false", ")", "{", "if", "(", "$", "entity", "->", "hasAttributeByName", "(", "$", "name", ")", "||", ...
Sometimes the automatic name cannot be used because the entity already has an attribute with that name or because is linked many times. This method gives an actual final name that will be unique. @param Entity $entity @param string $name @param string $hint @param boolean $force If it should force the use of the hi...
[ "Sometimes", "the", "automatic", "name", "cannot", "be", "used", "because", "the", "entity", "already", "has", "an", "attribute", "with", "that", "name", "or", "because", "is", "linked", "many", "times", ".", "This", "method", "gives", "an", "actual", "final...
train
https://github.com/j-d/draggy/blob/97ffc66e1aacb5f685d7aac5251c4abb8888d4bb/src/Draggy/Autocode/Project.php#L1171-L1188
j-d/draggy
src/Draggy/Autocode/Project.php
Project.getModelFiles
public function getModelFiles($path) { $fileCollection = new FileCollection(); $namespacePath = str_replace('\\', '/', $path . $this->getNamespace() . '/'); $targetPath = $namespacePath; foreach ($this->getEntities() as $entity) { if ($entity->getRenderizable()) { ...
php
public function getModelFiles($path) { $fileCollection = new FileCollection(); $namespacePath = str_replace('\\', '/', $path . $this->getNamespace() . '/'); $targetPath = $namespacePath; foreach ($this->getEntities() as $entity) { if ($entity->getRenderizable()) { ...
[ "public", "function", "getModelFiles", "(", "$", "path", ")", "{", "$", "fileCollection", "=", "new", "FileCollection", "(", ")", ";", "$", "namespacePath", "=", "str_replace", "(", "'\\\\'", ",", "'/'", ",", "$", "path", ".", "$", "this", "->", "getName...
Returns a collection of files @param string $path The path where they would be saved @return FileCollection
[ "Returns", "a", "collection", "of", "files" ]
train
https://github.com/j-d/draggy/blob/97ffc66e1aacb5f685d7aac5251c4abb8888d4bb/src/Draggy/Autocode/Project.php#L1238-L1275
j-d/draggy
src/Draggy/Autocode/Project.php
Project.renderEntityTemplate
public function renderEntityTemplate(EntityTemplate $template, Entity $entity, $path) { $template->setEntity($entity); $fileCollection = new FileCollection(); $entityPath = $path . $template->getPath(); $entityName = $template->getFilename(); if ($entity->shouldRender($te...
php
public function renderEntityTemplate(EntityTemplate $template, Entity $entity, $path) { $template->setEntity($entity); $fileCollection = new FileCollection(); $entityPath = $path . $template->getPath(); $entityName = $template->getFilename(); if ($entity->shouldRender($te...
[ "public", "function", "renderEntityTemplate", "(", "EntityTemplate", "$", "template", ",", "Entity", "$", "entity", ",", "$", "path", ")", "{", "$", "template", "->", "setEntity", "(", "$", "entity", ")", ";", "$", "fileCollection", "=", "new", "FileCollecti...
@param EntityTemplate $template @param Entity $entity @param string $path @return FileInterface
[ "@param", "EntityTemplate", "$template", "@param", "Entity", "$entity", "@param", "string", "$path" ]
train
https://github.com/j-d/draggy/blob/97ffc66e1aacb5f685d7aac5251c4abb8888d4bb/src/Draggy/Autocode/Project.php#L1284-L1301
j-d/draggy
src/Draggy/Autocode/Project.php
Project.renderModuleTemplate
public function renderModuleTemplate(Project $project, ModuleTemplate $template, $module, $path) { $template->setModule($module); $template->setProject($project); $fileCollection = new FileCollection(); $modulePath = $path . $template->getPath(); $moduleName = $template->g...
php
public function renderModuleTemplate(Project $project, ModuleTemplate $template, $module, $path) { $template->setModule($module); $template->setProject($project); $fileCollection = new FileCollection(); $modulePath = $path . $template->getPath(); $moduleName = $template->g...
[ "public", "function", "renderModuleTemplate", "(", "Project", "$", "project", ",", "ModuleTemplate", "$", "template", ",", "$", "module", ",", "$", "path", ")", "{", "$", "template", "->", "setModule", "(", "$", "module", ")", ";", "$", "template", "->", ...
@param Project $project @param ModuleTemplate $template @param string $module @param string $path @return FileInterface
[ "@param", "Project", "$project", "@param", "ModuleTemplate", "$template", "@param", "string", "$module", "@param", "string", "$path" ]
train
https://github.com/j-d/draggy/blob/97ffc66e1aacb5f685d7aac5251c4abb8888d4bb/src/Draggy/Autocode/Project.php#L1311-L1328
j-d/draggy
src/Draggy/Autocode/Project.php
Project.singlelise
public static function singlelise($string) { $rules = [ 'ies' => 'y', 'ves' => 'f', 's' => '', ]; foreach ($rules as $ending => $replacement) { if ($ending === substr($string, -strlen($ending))) { return substr($string, 0, -s...
php
public static function singlelise($string) { $rules = [ 'ies' => 'y', 'ves' => 'f', 's' => '', ]; foreach ($rules as $ending => $replacement) { if ($ending === substr($string, -strlen($ending))) { return substr($string, 0, -s...
[ "public", "static", "function", "singlelise", "(", "$", "string", ")", "{", "$", "rules", "=", "[", "'ies'", "=>", "'y'", ",", "'ves'", "=>", "'f'", ",", "'s'", "=>", "''", ",", "]", ";", "foreach", "(", "$", "rules", "as", "$", "ending", "=>", "...
Get the plural name from a singular @param string $string @return string
[ "Get", "the", "plural", "name", "from", "a", "singular" ]
train
https://github.com/j-d/draggy/blob/97ffc66e1aacb5f685d7aac5251c4abb8888d4bb/src/Draggy/Autocode/Project.php#L1370-L1385
j-d/draggy
src/Draggy/Autocode/Project.php
Project.pluralise
public static function pluralise($string) { $rules = [ 'tus' => 'tuses', // status to statuses 'ss' => 'sses', // kiss to kissess 'sh' => 'shes', // dish to dishes 'ch' => 'ches', // witch to witches 'oy' => 'oys', // boy to boys ...
php
public static function pluralise($string) { $rules = [ 'tus' => 'tuses', // status to statuses 'ss' => 'sses', // kiss to kissess 'sh' => 'shes', // dish to dishes 'ch' => 'ches', // witch to witches 'oy' => 'oys', // boy to boys ...
[ "public", "static", "function", "pluralise", "(", "$", "string", ")", "{", "$", "rules", "=", "[", "'tus'", "=>", "'tuses'", ",", "// status to statuses", "'ss'", "=>", "'sses'", ",", "// kiss to kissess", "'sh'", "=>", "'shes'", ",", "// dish to dishes", "'ch...
Get the plural name from a singular Source: http://en.wikipedia.org/wiki/English_plurals @param string $string @return string
[ "Get", "the", "plural", "name", "from", "a", "singular", "Source", ":", "http", ":", "//", "en", ".", "wikipedia", ".", "org", "/", "wiki", "/", "English_plurals" ]
train
https://github.com/j-d/draggy/blob/97ffc66e1aacb5f685d7aac5251c4abb8888d4bb/src/Draggy/Autocode/Project.php#L1395-L1419
adrenalinkin/config-helper
Extension/AbstractExtension.php
AbstractExtension.getConfigurationsFromFile
protected function getConfigurationsFromFile($fileName, ContainerBuilder $container, $merge = true) { $configs = []; /** @var \Symfony\Component\Finder\SplFileInfo $file */ foreach ($this->getFinder($fileName, $container) as $file) { $currentConfiguration = Yaml::parse($file->ge...
php
protected function getConfigurationsFromFile($fileName, ContainerBuilder $container, $merge = true) { $configs = []; /** @var \Symfony\Component\Finder\SplFileInfo $file */ foreach ($this->getFinder($fileName, $container) as $file) { $currentConfiguration = Yaml::parse($file->ge...
[ "protected", "function", "getConfigurationsFromFile", "(", "$", "fileName", ",", "ContainerBuilder", "$", "container", ",", "$", "merge", "=", "true", ")", "{", "$", "configs", "=", "[", "]", ";", "/** @var \\Symfony\\Component\\Finder\\SplFileInfo $file */", "foreach...
Returns all configurations registered in the specific yaml file. @param string $fileName Name of the file with extension @param ContainerBuilder $container Container builder @param bool $merge Merge configuration recursively or just stack @return array
[ "Returns", "all", "configurations", "registered", "in", "the", "specific", "yaml", "file", "." ]
train
https://github.com/adrenalinkin/config-helper/blob/97dfdb81aa2ed1878e411f76e0d723003b80062b/Extension/AbstractExtension.php#L40-L62
adrenalinkin/config-helper
Extension/AbstractExtension.php
AbstractExtension.getFinder
private function getFinder($fileName, ContainerBuilder $container) { $finder = (new Finder())->files()->name($fileName); $resourcesDir = 'Resources'.DIRECTORY_SEPARATOR.'config'; if (self::$directoriesCache) { return $finder->in(self::$directoriesCache); } ...
php
private function getFinder($fileName, ContainerBuilder $container) { $finder = (new Finder())->files()->name($fileName); $resourcesDir = 'Resources'.DIRECTORY_SEPARATOR.'config'; if (self::$directoriesCache) { return $finder->in(self::$directoriesCache); } ...
[ "private", "function", "getFinder", "(", "$", "fileName", ",", "ContainerBuilder", "$", "container", ")", "{", "$", "finder", "=", "(", "new", "Finder", "(", ")", ")", "->", "files", "(", ")", "->", "name", "(", "$", "fileName", ")", ";", "$", "resou...
Build and return finder @param string $fileName @param ContainerBuilder $container @return Finder
[ "Build", "and", "return", "finder" ]
train
https://github.com/adrenalinkin/config-helper/blob/97dfdb81aa2ed1878e411f76e0d723003b80062b/Extension/AbstractExtension.php#L72-L101
keboola/php-filter
src/Keboola/Filter/Filter.php
Filter.compareObject
public function compareObject(\stdClass $object) { $value = \Keboola\Utils\getDataFromPath($this->columnName, $object, "."); return $this->compare($value); }
php
public function compareObject(\stdClass $object) { $value = \Keboola\Utils\getDataFromPath($this->columnName, $object, "."); return $this->compare($value); }
[ "public", "function", "compareObject", "(", "\\", "stdClass", "$", "object", ")", "{", "$", "value", "=", "\\", "Keboola", "\\", "Utils", "\\", "getDataFromPath", "(", "$", "this", "->", "columnName", ",", "$", "object", ",", "\".\"", ")", ";", "return",...
Compare a value from within an object using the $columnName, $operator and $value @param \stdClass $object @return bool @throws FilterException
[ "Compare", "a", "value", "from", "within", "an", "object", "using", "the", "$columnName", "$operator", "and", "$value" ]
train
https://github.com/keboola/php-filter/blob/8e38d4b19722824f528a8a4395caa8b2e2cf66e1/src/Keboola/Filter/Filter.php#L92-L96
keboola/php-filter
src/Keboola/Filter/Filter.php
Filter.compare
protected function compare($value) { if (!method_exists($this, self::$methodList[$this->operator])) { throw new FilterException("Method for {$this->operator} does not exist!"); } return $this->{self::$methodList[$this->operator]}($value, $this->value); }
php
protected function compare($value) { if (!method_exists($this, self::$methodList[$this->operator])) { throw new FilterException("Method for {$this->operator} does not exist!"); } return $this->{self::$methodList[$this->operator]}($value, $this->value); }
[ "protected", "function", "compare", "(", "$", "value", ")", "{", "if", "(", "!", "method_exists", "(", "$", "this", ",", "self", "::", "$", "methodList", "[", "$", "this", "->", "operator", "]", ")", ")", "{", "throw", "new", "FilterException", "(", ...
Compare a single value against $this->value using $this->operator @param string $value @return bool @throws FilterException
[ "Compare", "a", "single", "value", "against", "$this", "-", ">", "value", "using", "$this", "-", ">", "operator" ]
train
https://github.com/keboola/php-filter/blob/8e38d4b19722824f528a8a4395caa8b2e2cf66e1/src/Keboola/Filter/Filter.php#L128-L135
oroinc/OroLayoutComponent
Loader/Generator/Extension/ImportsAwareLayoutUpdateVisitor.php
ImportsAwareLayoutUpdateVisitor.startVisit
public function startVisit(VisitContext $visitContext) { $writer = $visitContext->createWriter(); $class = $visitContext->getClass(); $class->addInterfaceName('Oro\Component\Layout\ImportsAwareLayoutUpdateInterface'); $setFactoryMethod = PhpMethod::create('getImports'); $setF...
php
public function startVisit(VisitContext $visitContext) { $writer = $visitContext->createWriter(); $class = $visitContext->getClass(); $class->addInterfaceName('Oro\Component\Layout\ImportsAwareLayoutUpdateInterface'); $setFactoryMethod = PhpMethod::create('getImports'); $setF...
[ "public", "function", "startVisit", "(", "VisitContext", "$", "visitContext", ")", "{", "$", "writer", "=", "$", "visitContext", "->", "createWriter", "(", ")", ";", "$", "class", "=", "$", "visitContext", "->", "getClass", "(", ")", ";", "$", "class", "...
{@inheritdoc}
[ "{" ]
train
https://github.com/oroinc/OroLayoutComponent/blob/682a96672393d81c63728e47c4a4c3618c515be0/Loader/Generator/Extension/ImportsAwareLayoutUpdateVisitor.php#L27-L35
Eresus/EresusCMS
src/core/framework/core/3rdparty/ezcomponents/Database/src/sqlabstraction/query.php
ezcQuery.getIdentifiers
protected function getIdentifiers( array $aliasList ) { if ( $this->aliases !== null ) { foreach ( $aliasList as $key => $alias ) { $aliasList[$key] = $this->getIdentifier( $alias ); } } return $aliasList; }
php
protected function getIdentifiers( array $aliasList ) { if ( $this->aliases !== null ) { foreach ( $aliasList as $key => $alias ) { $aliasList[$key] = $this->getIdentifier( $alias ); } } return $aliasList; }
[ "protected", "function", "getIdentifiers", "(", "array", "$", "aliasList", ")", "{", "if", "(", "$", "this", "->", "aliases", "!==", "null", ")", "{", "foreach", "(", "$", "aliasList", "as", "$", "key", "=>", "$", "alias", ")", "{", "$", "aliasList", ...
Returns the correct identifiers for the aliases found in $aliases. This method is similar to getIdentifier except that it works on an array. @param array(string) $aliasList @return array(string)
[ "Returns", "the", "correct", "identifiers", "for", "the", "aliases", "found", "in", "$aliases", "." ]
train
https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/Database/src/sqlabstraction/query.php#L271-L281
Eresus/EresusCMS
src/core/framework/core/3rdparty/ezcomponents/Database/src/sqlabstraction/query.php
ezcQuery.getPrefixedTableNames
protected function getPrefixedTableNames($tableNames) { if ($this->db->options && $this->db->options->tableNamePrefix) { switch (true) { case is_string($tableNames): $tableNames = $this->db->options->tableNamePrefix . $tableNames; break; case is_array($tableNames)...
php
protected function getPrefixedTableNames($tableNames) { if ($this->db->options && $this->db->options->tableNamePrefix) { switch (true) { case is_string($tableNames): $tableNames = $this->db->options->tableNamePrefix . $tableNames; break; case is_array($tableNames)...
[ "protected", "function", "getPrefixedTableNames", "(", "$", "tableNames", ")", "{", "if", "(", "$", "this", "->", "db", "->", "options", "&&", "$", "this", "->", "db", "->", "options", "->", "tableNamePrefix", ")", "{", "switch", "(", "true", ")", "{", ...
Returns prefixed table names if "tableNamePrefix" option not empty otherwise return untouched names @param array|string $tableNames @return array|string
[ "Returns", "prefixed", "table", "names", "if", "tableNamePrefix", "option", "not", "empty", "otherwise", "return", "untouched", "names" ]
train
https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/Database/src/sqlabstraction/query.php#L290-L308
Eresus/EresusCMS
src/core/framework/core/3rdparty/ezcomponents/Database/src/sqlabstraction/query.php
ezcQuery.doBind
public function doBind( PDOStatement $stmt ) { foreach ( $this->boundValues as $key => $value ) { try { $stmt->bindValue( $key, $value, $this->boundValuesType[$key] ); } catch ( PDOException $e ) { // see com...
php
public function doBind( PDOStatement $stmt ) { foreach ( $this->boundValues as $key => $value ) { try { $stmt->bindValue( $key, $value, $this->boundValuesType[$key] ); } catch ( PDOException $e ) { // see com...
[ "public", "function", "doBind", "(", "PDOStatement", "$", "stmt", ")", "{", "foreach", "(", "$", "this", "->", "boundValues", "as", "$", "key", "=>", "$", "value", ")", "{", "try", "{", "$", "stmt", "->", "bindValue", "(", "$", "key", ",", "$", "va...
Performs binding of variables bound with bindValue and bindParam on the statement $stmt. This method must be called if you have used the bind methods in your query and you build the method yourself using build. @param PDOStatement $stmt @return void
[ "Performs", "binding", "of", "variables", "bound", "with", "bindValue", "and", "bindParam", "on", "the", "statement", "$stmt", "." ]
train
https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/Database/src/sqlabstraction/query.php#L416-L447
Eresus/EresusCMS
src/core/framework/core/3rdparty/ezcomponents/Database/src/sqlabstraction/query.php
ezcQuery.prepare
public function prepare() { $stmt = $this->db->prepare( $this->getQuery() ); $this->doBind( $stmt ); return $stmt; }
php
public function prepare() { $stmt = $this->db->prepare( $this->getQuery() ); $this->doBind( $stmt ); return $stmt; }
[ "public", "function", "prepare", "(", ")", "{", "$", "stmt", "=", "$", "this", "->", "db", "->", "prepare", "(", "$", "this", "->", "getQuery", "(", ")", ")", ";", "$", "this", "->", "doBind", "(", "$", "stmt", ")", ";", "return", "$", "stmt", ...
Returns a prepared statement from this query which can be used for execution. The returned object is a PDOStatement for which you can find extensive documentation in the PHP manual: {@link http://php.net/pdostatement-bindcolumn} prepare() automatically calls doBind() on the statement. @return PDOStatement
[ "Returns", "a", "prepared", "statement", "from", "this", "query", "which", "can", "be", "used", "for", "execution", "." ]
train
https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/Database/src/sqlabstraction/query.php#L459-L464
Eresus/EresusCMS
src/core/framework/core/3rdparty/ezcomponents/Database/src/sqlabstraction/query.php
ezcQuery.execute
public function execute() { try { $stmt = $this->prepare(); if (LOG_DEBUG == Eresus_Kernel::$logLevel) { $insider = new DBQueryInsider; $this->doBind($insider); $s = $insider->subst($this); Eresus_Ker...
php
public function execute() { try { $stmt = $this->prepare(); if (LOG_DEBUG == Eresus_Kernel::$logLevel) { $insider = new DBQueryInsider; $this->doBind($insider); $s = $insider->subst($this); Eresus_Ker...
[ "public", "function", "execute", "(", ")", "{", "try", "{", "$", "stmt", "=", "$", "this", "->", "prepare", "(", ")", ";", "if", "(", "LOG_DEBUG", "==", "Eresus_Kernel", "::", "$", "logLevel", ")", "{", "$", "insider", "=", "new", "DBQueryInsider", "...
Execute query @throws Eresus_DB_Exception_QueryFailed @return PDOStatement
[ "Execute", "query" ]
train
https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/Database/src/sqlabstraction/query.php#L543-L564
yeaha/owl-core
src/Container.php
Container.get
public function get($id) { if (isset($this->values[$id])) { return $this->values[$id]; } $callback = $this->getCallback($id); $value = call_user_func($callback); return $this->values[$id] = $value; }
php
public function get($id) { if (isset($this->values[$id])) { return $this->values[$id]; } $callback = $this->getCallback($id); $value = call_user_func($callback); return $this->values[$id] = $value; }
[ "public", "function", "get", "(", "$", "id", ")", "{", "if", "(", "isset", "(", "$", "this", "->", "values", "[", "$", "id", "]", ")", ")", "{", "return", "$", "this", "->", "values", "[", "$", "id", "]", ";", "}", "$", "callback", "=", "$", ...
从容器内获得注册的回调方法执行结果. 注意: 注册的回调方法只会执行一次,即每次get都拿到同样的结果 @param string $id @return mixed @throws 指定的$id不存在时
[ "从容器内获得注册的回调方法执行结果", "." ]
train
https://github.com/yeaha/owl-core/blob/fd7531c0a5c0142300a96160bd079f2e2d92fe4c/src/Container.php#L67-L77
yeaha/owl-core
src/Container.php
Container.getCallback
public function getCallback($id) { if ($this->has($id)) { return $this->callbacks[$id]; } throw new \UnexpectedValueException(sprintf('"%s" does not exists in container', $id)); }
php
public function getCallback($id) { if ($this->has($id)) { return $this->callbacks[$id]; } throw new \UnexpectedValueException(sprintf('"%s" does not exists in container', $id)); }
[ "public", "function", "getCallback", "(", "$", "id", ")", "{", "if", "(", "$", "this", "->", "has", "(", "$", "id", ")", ")", "{", "return", "$", "this", "->", "callbacks", "[", "$", "id", "]", ";", "}", "throw", "new", "\\", "UnexpectedValueExcept...
获得指定名字的回调函数. @param string $id @return Closuer @throws 指定的$id不存在时
[ "获得指定名字的回调函数", "." ]
train
https://github.com/yeaha/owl-core/blob/fd7531c0a5c0142300a96160bd079f2e2d92fe4c/src/Container.php#L103-L110
mothership-ec/composer
src/Composer/DependencyResolver/Request.php
Request.fix
public function fix($packageName, LinkConstraintInterface $constraint = null) { $this->addJob($packageName, 'install', $constraint, true); }
php
public function fix($packageName, LinkConstraintInterface $constraint = null) { $this->addJob($packageName, 'install', $constraint, true); }
[ "public", "function", "fix", "(", "$", "packageName", ",", "LinkConstraintInterface", "$", "constraint", "=", "null", ")", "{", "$", "this", "->", "addJob", "(", "$", "packageName", ",", "'install'", ",", "$", "constraint", ",", "true", ")", ";", "}" ]
Mark an existing package as being installed and having to remain installed These jobs will not be tempered with by the solver
[ "Mark", "an", "existing", "package", "as", "being", "installed", "and", "having", "to", "remain", "installed" ]
train
https://github.com/mothership-ec/composer/blob/fa6ad031a939d8d33b211e428fdbdd28cfce238c/src/Composer/DependencyResolver/Request.php#L49-L52
php-lug/lug
src/Component/Grid/Column/Type/JsonType.php
JsonType.render
public function render($data, array $options) { $json = $this->getValue($data, $options); if ($json === null) { return; } if (is_resource($json)) { throw new InvalidTypeException(sprintf( 'The "%s" %s column type expects anything except a res...
php
public function render($data, array $options) { $json = $this->getValue($data, $options); if ($json === null) { return; } if (is_resource($json)) { throw new InvalidTypeException(sprintf( 'The "%s" %s column type expects anything except a res...
[ "public", "function", "render", "(", "$", "data", ",", "array", "$", "options", ")", "{", "$", "json", "=", "$", "this", "->", "getValue", "(", "$", "data", ",", "$", "options", ")", ";", "if", "(", "$", "json", "===", "null", ")", "{", "return",...
{@inheritdoc}
[ "{" ]
train
https://github.com/php-lug/lug/blob/81c109f187eba0a60f17e8cc59984ebb31841db7/src/Component/Grid/Column/Type/JsonType.php#L51-L68
php-lug/lug
src/Component/Grid/Column/Type/JsonType.php
JsonType.configureOptions
public function configureOptions(OptionsResolver $resolver) { parent::configureOptions($resolver); $resolver ->setDefaults([ 'options' => $this->options, 'depth' => $this->depth, ]) ->setAllowedTypes('options', 'integer') ...
php
public function configureOptions(OptionsResolver $resolver) { parent::configureOptions($resolver); $resolver ->setDefaults([ 'options' => $this->options, 'depth' => $this->depth, ]) ->setAllowedTypes('options', 'integer') ...
[ "public", "function", "configureOptions", "(", "OptionsResolver", "$", "resolver", ")", "{", "parent", "::", "configureOptions", "(", "$", "resolver", ")", ";", "$", "resolver", "->", "setDefaults", "(", "[", "'options'", "=>", "$", "this", "->", "options", ...
{@inheritdoc}
[ "{" ]
train
https://github.com/php-lug/lug/blob/81c109f187eba0a60f17e8cc59984ebb31841db7/src/Component/Grid/Column/Type/JsonType.php#L73-L84
hametuha/wpametu
src/WPametu/API/Ajax/AjaxBase.php
AjaxBase.register
public function register(){ switch( $this->target ){ case 'all': add_action('wp_ajax_nopriv_'.$this->action, [$this, 'ajax']); add_action('wp_ajax_'.$this->action, [$this, 'ajax']); break; case 'guest': add_action('wp_ajax_n...
php
public function register(){ switch( $this->target ){ case 'all': add_action('wp_ajax_nopriv_'.$this->action, [$this, 'ajax']); add_action('wp_ajax_'.$this->action, [$this, 'ajax']); break; case 'guest': add_action('wp_ajax_n...
[ "public", "function", "register", "(", ")", "{", "switch", "(", "$", "this", "->", "target", ")", "{", "case", "'all'", ":", "add_action", "(", "'wp_ajax_nopriv_'", ".", "$", "this", "->", "action", ",", "[", "$", "this", ",", "'ajax'", "]", ")", ";"...
Register ajax.
[ "Register", "ajax", "." ]
train
https://github.com/hametuha/wpametu/blob/0939373800815a8396291143d2a57967340da5aa/src/WPametu/API/Ajax/AjaxBase.php#L86-L99
hametuha/wpametu
src/WPametu/API/Ajax/AjaxBase.php
AjaxBase.ajax
public function ajax(){ if( 'post' == $this->method || $this->always_nocache ){ nocache_headers(); } try{ // Authenticate if( !$this->auth() ){ $this->error($this->__('Sorry, but you have no permission.'), 403); } // Val...
php
public function ajax(){ if( 'post' == $this->method || $this->always_nocache ){ nocache_headers(); } try{ // Authenticate if( !$this->auth() ){ $this->error($this->__('Sorry, but you have no permission.'), 403); } // Val...
[ "public", "function", "ajax", "(", ")", "{", "if", "(", "'post'", "==", "$", "this", "->", "method", "||", "$", "this", "->", "always_nocache", ")", "{", "nocache_headers", "(", ")", ";", "}", "try", "{", "// Authenticate", "if", "(", "!", "$", "this...
Do Ajax
[ "Do", "Ajax" ]
train
https://github.com/hametuha/wpametu/blob/0939373800815a8396291143d2a57967340da5aa/src/WPametu/API/Ajax/AjaxBase.php#L104-L133
hametuha/wpametu
src/WPametu/API/Ajax/AjaxBase.php
AjaxBase.ajax_url
protected function ajax_url(){ $url = admin_url('admin-ajax.php'); if( is_ssl() ){ $url = str_replace('http://', 'https://', $url); }else{ $url = str_replace('https://', 'http://', $url); } return $url; }
php
protected function ajax_url(){ $url = admin_url('admin-ajax.php'); if( is_ssl() ){ $url = str_replace('http://', 'https://', $url); }else{ $url = str_replace('https://', 'http://', $url); } return $url; }
[ "protected", "function", "ajax_url", "(", ")", "{", "$", "url", "=", "admin_url", "(", "'admin-ajax.php'", ")", ";", "if", "(", "is_ssl", "(", ")", ")", "{", "$", "url", "=", "str_replace", "(", "'http://'", ",", "'https://'", ",", "$", "url", ")", "...
Returns Ajax endpoint @return string
[ "Returns", "Ajax", "endpoint" ]
train
https://github.com/hametuha/wpametu/blob/0939373800815a8396291143d2a57967340da5aa/src/WPametu/API/Ajax/AjaxBase.php#L141-L149
rhosocial/yii2-user
forms/RegisterForm.php
RegisterForm.register
public function register() { if ($this->validate()) { $class = $this->userClass; $user = new $class(['password' => $this->password]); /* @var $user User */ $profile = $user->createProfile(['nickname' => $this->nickname, 'first_name' => $this->first_name, 'last...
php
public function register() { if ($this->validate()) { $class = $this->userClass; $user = new $class(['password' => $this->password]); /* @var $user User */ $profile = $user->createProfile(['nickname' => $this->nickname, 'first_name' => $this->first_name, 'last...
[ "public", "function", "register", "(", ")", "{", "if", "(", "$", "this", "->", "validate", "(", ")", ")", "{", "$", "class", "=", "$", "this", "->", "userClass", ";", "$", "user", "=", "new", "$", "class", "(", "[", "'password'", "=>", "$", "this...
Register user with current model. @return bool
[ "Register", "user", "with", "current", "model", "." ]
train
https://github.com/rhosocial/yii2-user/blob/96737a9d8ca7e9c42cd2b7736d6c0a90ede6e5bc/forms/RegisterForm.php#L128-L147
oroinc/OroLayoutComponent
Extension/Theme/PathProvider/ThemePathProvider.php
ThemePathProvider.getPaths
public function getPaths(array $existingPaths) { $themeName = $this->context->getOr('theme'); if ($themeName) { $themePaths = []; $themes = $this->getThemesHierarchy($themeName); foreach ($themes as $theme) { $existingPaths[] = $themePaths[] = $th...
php
public function getPaths(array $existingPaths) { $themeName = $this->context->getOr('theme'); if ($themeName) { $themePaths = []; $themes = $this->getThemesHierarchy($themeName); foreach ($themes as $theme) { $existingPaths[] = $themePaths[] = $th...
[ "public", "function", "getPaths", "(", "array", "$", "existingPaths", ")", "{", "$", "themeName", "=", "$", "this", "->", "context", "->", "getOr", "(", "'theme'", ")", ";", "if", "(", "$", "themeName", ")", "{", "$", "themePaths", "=", "[", "]", ";"...
{@inheritdoc}
[ "{" ]
train
https://github.com/oroinc/OroLayoutComponent/blob/682a96672393d81c63728e47c4a4c3618c515be0/Extension/Theme/PathProvider/ThemePathProvider.php#L37-L75
oroinc/OroLayoutComponent
Extension/Theme/PathProvider/ThemePathProvider.php
ThemePathProvider.getThemesHierarchy
protected function getThemesHierarchy($themeName) { $hierarchy = []; while (null !== $themeName) { $theme = $this->themeManager->getTheme($themeName); $hierarchy[] = $theme; $themeName = $theme->getParentTheme(); } return array_reverse($hierar...
php
protected function getThemesHierarchy($themeName) { $hierarchy = []; while (null !== $themeName) { $theme = $this->themeManager->getTheme($themeName); $hierarchy[] = $theme; $themeName = $theme->getParentTheme(); } return array_reverse($hierar...
[ "protected", "function", "getThemesHierarchy", "(", "$", "themeName", ")", "{", "$", "hierarchy", "=", "[", "]", ";", "while", "(", "null", "!==", "$", "themeName", ")", "{", "$", "theme", "=", "$", "this", "->", "themeManager", "->", "getTheme", "(", ...
Returns theme inheritance hierarchy with root theme as first item @param string $themeName @return Theme[]
[ "Returns", "theme", "inheritance", "hierarchy", "with", "root", "theme", "as", "first", "item" ]
train
https://github.com/oroinc/OroLayoutComponent/blob/682a96672393d81c63728e47c4a4c3618c515be0/Extension/Theme/PathProvider/ThemePathProvider.php#L84-L96
husccexo/php-handlersocket-core
src/HSCore/Driver.php
Driver.send
public function send($command) { $string = $command; $timer = microtime(true); while ($string) { $bytes = fwrite($this->socket, $string); if ($bytes === false) { $this->close(); throw new HSException('Cannot write to socket'); ...
php
public function send($command) { $string = $command; $timer = microtime(true); while ($string) { $bytes = fwrite($this->socket, $string); if ($bytes === false) { $this->close(); throw new HSException('Cannot write to socket'); ...
[ "public", "function", "send", "(", "$", "command", ")", "{", "$", "string", "=", "$", "command", ";", "$", "timer", "=", "microtime", "(", "true", ")", ";", "while", "(", "$", "string", ")", "{", "$", "bytes", "=", "fwrite", "(", "$", "this", "->...
Send string command to server @param string $command @return string @throws HSException
[ "Send", "string", "command", "to", "server" ]
train
https://github.com/husccexo/php-handlersocket-core/blob/aaeeece9c90a89bbc861a6fe390bc0c892496bf0/src/HSCore/Driver.php#L78-L106
husccexo/php-handlersocket-core
src/HSCore/Driver.php
Driver.encode
public static function encode($string) { return is_null($string) ? self::NULL : strtr($string, self::$encodeMap); }
php
public static function encode($string) { return is_null($string) ? self::NULL : strtr($string, self::$encodeMap); }
[ "public", "static", "function", "encode", "(", "$", "string", ")", "{", "return", "is_null", "(", "$", "string", ")", "?", "self", "::", "NULL", ":", "strtr", "(", "$", "string", ",", "self", "::", "$", "encodeMap", ")", ";", "}" ]
Encode string for sending to server @param $string @return string
[ "Encode", "string", "for", "sending", "to", "server" ]
train
https://github.com/husccexo/php-handlersocket-core/blob/aaeeece9c90a89bbc861a6fe390bc0c892496bf0/src/HSCore/Driver.php#L126-L129
husccexo/php-handlersocket-core
src/HSCore/Driver.php
Driver.decode
public static function decode($string) { return ($string === self::NULL) ? null : strtr($string, self::$decodeMap); }
php
public static function decode($string) { return ($string === self::NULL) ? null : strtr($string, self::$decodeMap); }
[ "public", "static", "function", "decode", "(", "$", "string", ")", "{", "return", "(", "$", "string", "===", "self", "::", "NULL", ")", "?", "null", ":", "strtr", "(", "$", "string", ",", "self", "::", "$", "decodeMap", ")", ";", "}" ]
Decode string from server @param $string @return null|string
[ "Decode", "string", "from", "server" ]
train
https://github.com/husccexo/php-handlersocket-core/blob/aaeeece9c90a89bbc861a6fe390bc0c892496bf0/src/HSCore/Driver.php#L138-L141
husccexo/php-handlersocket-core
src/HSCore/Driver.php
Driver.open
public function open() { $this->socket = stream_socket_client('tcp://'.$this->address, $errc, $errs, STREAM_CLIENT_CONNECT); if (!$this->socket) { throw new HSException('Connection to '.$this->address.' failed'); } }
php
public function open() { $this->socket = stream_socket_client('tcp://'.$this->address, $errc, $errs, STREAM_CLIENT_CONNECT); if (!$this->socket) { throw new HSException('Connection to '.$this->address.' failed'); } }
[ "public", "function", "open", "(", ")", "{", "$", "this", "->", "socket", "=", "stream_socket_client", "(", "'tcp://'", ".", "$", "this", "->", "address", ",", "$", "errc", ",", "$", "errs", ",", "STREAM_CLIENT_CONNECT", ")", ";", "if", "(", "!", "$", ...
Open Handler Socket @throwsHSrException
[ "Open", "Handler", "Socket" ]
train
https://github.com/husccexo/php-handlersocket-core/blob/aaeeece9c90a89bbc861a6fe390bc0c892496bf0/src/HSCore/Driver.php#L149-L156
husccexo/php-handlersocket-core
src/HSCore/Driver.php
Driver.receive
private function receive() { $timer = microtime(true); $str = fgets($this->socket); if ($str === false) { $this->close(); throw new HSException('Cannot read from socket'); } $this->logs[] = [ 'type' => 'receive', 'time' => m...
php
private function receive() { $timer = microtime(true); $str = fgets($this->socket); if ($str === false) { $this->close(); throw new HSException('Cannot read from socket'); } $this->logs[] = [ 'type' => 'receive', 'time' => m...
[ "private", "function", "receive", "(", ")", "{", "$", "timer", "=", "microtime", "(", "true", ")", ";", "$", "str", "=", "fgets", "(", "$", "this", "->", "socket", ")", ";", "if", "(", "$", "str", "===", "false", ")", "{", "$", "this", "->", "c...
Receive one string from server. String haven't trailing \n @return string @throws HSException
[ "Receive", "one", "string", "from", "server", ".", "String", "haven", "t", "trailing", "\\", "n" ]
train
https://github.com/husccexo/php-handlersocket-core/blob/aaeeece9c90a89bbc861a6fe390bc0c892496bf0/src/HSCore/Driver.php#L203-L222
bytic/framework
src/Mvc/Sections/Section.php
Section.compilePath
public function compilePath($path = false) { $currentBasePath = $this->getManager()->getCurrent()->getPath(); $path = str_replace($currentBasePath, $this->getPath(), $path); return $path; }
php
public function compilePath($path = false) { $currentBasePath = $this->getManager()->getCurrent()->getPath(); $path = str_replace($currentBasePath, $this->getPath(), $path); return $path; }
[ "public", "function", "compilePath", "(", "$", "path", "=", "false", ")", "{", "$", "currentBasePath", "=", "$", "this", "->", "getManager", "(", ")", "->", "getCurrent", "(", ")", "->", "getPath", "(", ")", ";", "$", "path", "=", "str_replace", "(", ...
Compile path for this section from a given path of current section @param bool $path @return string
[ "Compile", "path", "for", "this", "section", "from", "a", "given", "path", "of", "current", "section" ]
train
https://github.com/bytic/framework/blob/36b4a761f4b64899f3841b0f6c8eb92887e91677/src/Mvc/Sections/Section.php#L73-L78
ShaoZeMing/laravel-merchant
src/Auth/Permission.php
Permission.check
public static function check($permission) { if (static::isAdministrator()) { return true; } if (is_array($permission)) { collect($permission)->each(function ($permission) { call_user_func([Permission::class, 'check'], $permission); }); ...
php
public static function check($permission) { if (static::isAdministrator()) { return true; } if (is_array($permission)) { collect($permission)->each(function ($permission) { call_user_func([Permission::class, 'check'], $permission); }); ...
[ "public", "static", "function", "check", "(", "$", "permission", ")", "{", "if", "(", "static", "::", "isAdministrator", "(", ")", ")", "{", "return", "true", ";", "}", "if", "(", "is_array", "(", "$", "permission", ")", ")", "{", "collect", "(", "$"...
Check permission. @param $permission @return true
[ "Check", "permission", "." ]
train
https://github.com/ShaoZeMing/laravel-merchant/blob/20801b1735e7832a6e58b37c2c391328f8d626fa/src/Auth/Permission.php#L18-L35
ShaoZeMing/laravel-merchant
src/Auth/Permission.php
Permission.error
public static function error() { $response = response(Merchant::content()->withError(trans('merchant.deny'))); Pjax::respond($response); }
php
public static function error() { $response = response(Merchant::content()->withError(trans('merchant.deny'))); Pjax::respond($response); }
[ "public", "static", "function", "error", "(", ")", "{", "$", "response", "=", "response", "(", "Merchant", "::", "content", "(", ")", "->", "withError", "(", "trans", "(", "'merchant.deny'", ")", ")", ")", ";", "Pjax", "::", "respond", "(", "$", "respo...
Send error response page.
[ "Send", "error", "response", "page", "." ]
train
https://github.com/ShaoZeMing/laravel-merchant/blob/20801b1735e7832a6e58b37c2c391328f8d626fa/src/Auth/Permission.php#L76-L81
gregorybesson/PlaygroundCms
src/Service/Slideshow.php
Slideshow.getSlideshowMapper
public function getSlideshowMapper() { if (null === $this->slideshowMapper) { $this->slideshowMapper = $this->serviceLocator->get('playgroundcms_slideshow_mapper'); } return $this->slideshowMapper; }
php
public function getSlideshowMapper() { if (null === $this->slideshowMapper) { $this->slideshowMapper = $this->serviceLocator->get('playgroundcms_slideshow_mapper'); } return $this->slideshowMapper; }
[ "public", "function", "getSlideshowMapper", "(", ")", "{", "if", "(", "null", "===", "$", "this", "->", "slideshowMapper", ")", "{", "$", "this", "->", "slideshowMapper", "=", "$", "this", "->", "serviceLocator", "->", "get", "(", "'playgroundcms_slideshow_map...
getSlideshowMapper @return SlideshowMapper
[ "getSlideshowMapper" ]
train
https://github.com/gregorybesson/PlaygroundCms/blob/e929a283f2a6e82d4f248c930f7aa454ce20cbc3/src/Service/Slideshow.php#L199-L206
Eresus/EresusCMS
src/core/framework/core/3rdparty/ezcomponents/Cache/src/storage/apc/plain.php
ezcCacheStorageApcPlain.fetchData
protected function fetchData( $identifier, $object = false ) { $data = $this->backend->fetch( $identifier ); if ( is_object( $data ) && $object === false ) { return $data->data; } if ( is_object( $data ) && $object !== false ) { return $data; ...
php
protected function fetchData( $identifier, $object = false ) { $data = $this->backend->fetch( $identifier ); if ( is_object( $data ) && $object === false ) { return $data->data; } if ( is_object( $data ) && $object !== false ) { return $data; ...
[ "protected", "function", "fetchData", "(", "$", "identifier", ",", "$", "object", "=", "false", ")", "{", "$", "data", "=", "$", "this", "->", "backend", "->", "fetch", "(", "$", "identifier", ")", ";", "if", "(", "is_object", "(", "$", "data", ")", ...
Fetches data from the cache. @param string $identifier The file to fetch data from @param bool $object return the object and not the clean data @return mixed The fetched data or false on failure
[ "Fetches", "data", "from", "the", "cache", "." ]
train
https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/Cache/src/storage/apc/plain.php#L30-L45
Eresus/EresusCMS
src/core/framework/core/3rdparty/ezcomponents/Cache/src/storage/apc/plain.php
ezcCacheStorageApcPlain.prepareData
protected function prepareData( $data ) { if ( is_resource( $data ) ) { throw new ezcCacheInvalidDataException( gettype( $data ), array( 'simple', 'array', 'object' ) ); } return new ezcCacheStorageMemoryDataStruct( $data, $this->properties['location'] ); }
php
protected function prepareData( $data ) { if ( is_resource( $data ) ) { throw new ezcCacheInvalidDataException( gettype( $data ), array( 'simple', 'array', 'object' ) ); } return new ezcCacheStorageMemoryDataStruct( $data, $this->properties['location'] ); }
[ "protected", "function", "prepareData", "(", "$", "data", ")", "{", "if", "(", "is_resource", "(", "$", "data", ")", ")", "{", "throw", "new", "ezcCacheInvalidDataException", "(", "gettype", "(", "$", "data", ")", ",", "array", "(", "'simple'", ",", "'ar...
Wraps the data in an ezcCacheStorageMemoryDataStruct structure in order to store it. @throws ezcCacheInvalidDataException If the data submitted can not be handled by this storage (resource). @param mixed $data Simple type or array @return ezcCacheStorageMemoryDataStruct Prepared data
[ "Wraps", "the", "data", "in", "an", "ezcCacheStorageMemoryDataStruct", "structure", "in", "order", "to", "store", "it", "." ]
train
https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/Cache/src/storage/apc/plain.php#L57-L64
bradcornford/Alerter
src/Cornford/Alerter/AlertDisplay.php
AlertDisplay.findDisplayViewFile
protected function findDisplayViewFile() { foreach($this->getDirectoryIterator() as $file) { $name = $file->getFilename(); if ($this->isDisplayViewFile($name)) { return $file->getPathname(); } } throw new AlertDisplayViewException('Could ...
php
protected function findDisplayViewFile() { foreach($this->getDirectoryIterator() as $file) { $name = $file->getFilename(); if ($this->isDisplayViewFile($name)) { return $file->getPathname(); } } throw new AlertDisplayViewException('Could ...
[ "protected", "function", "findDisplayViewFile", "(", ")", "{", "foreach", "(", "$", "this", "->", "getDirectoryIterator", "(", ")", "as", "$", "file", ")", "{", "$", "name", "=", "$", "file", "->", "getFilename", "(", ")", ";", "if", "(", "$", "this", ...
Track down the display view file. @return string @throws \Cornford\Alerter\Exceptions\AlertDisplayViewException
[ "Track", "down", "the", "display", "view", "file", "." ]
train
https://github.com/bradcornford/Alerter/blob/6533fe7afb9d1bae553385d3e687a24bda6a1333/src/Cornford/Alerter/AlertDisplay.php#L85-L96
Innmind/neo4j-dbal
src/Transactions.php
Transactions.open
public function open(): Transaction { $response = ($this->fulfill)( new Request( Url::fromString('/db/data/transaction'), Method::post(), new ProtocolVersion(1, 1), $this->headers, $this->body ) )...
php
public function open(): Transaction { $response = ($this->fulfill)( new Request( Url::fromString('/db/data/transaction'), Method::post(), new ProtocolVersion(1, 1), $this->headers, $this->body ) )...
[ "public", "function", "open", "(", ")", ":", "Transaction", "{", "$", "response", "=", "(", "$", "this", "->", "fulfill", ")", "(", "new", "Request", "(", "Url", "::", "fromString", "(", "'/db/data/transaction'", ")", ",", "Method", "::", "post", "(", ...
Open a new transaction @return Transaction
[ "Open", "a", "new", "transaction" ]
train
https://github.com/Innmind/neo4j-dbal/blob/12cb71e698cc0f4d55b7f2eb40f7b353c778a20b/src/Transactions.php#L66-L93
Innmind/neo4j-dbal
src/Transactions.php
Transactions.commit
public function commit(): self { ($this->fulfill)( new Request( $this->current()->commitEndpoint(), Method::post(), new ProtocolVersion(1, 1), $this->headers, $this->body ) ); $this->trans...
php
public function commit(): self { ($this->fulfill)( new Request( $this->current()->commitEndpoint(), Method::post(), new ProtocolVersion(1, 1), $this->headers, $this->body ) ); $this->trans...
[ "public", "function", "commit", "(", ")", ":", "self", "{", "(", "$", "this", "->", "fulfill", ")", "(", "new", "Request", "(", "$", "this", "->", "current", "(", ")", "->", "commitEndpoint", "(", ")", ",", "Method", "::", "post", "(", ")", ",", ...
Commit the current transaction @return self
[ "Commit", "the", "current", "transaction" ]
train
https://github.com/Innmind/neo4j-dbal/blob/12cb71e698cc0f4d55b7f2eb40f7b353c778a20b/src/Transactions.php#L120-L134
Innmind/neo4j-dbal
src/Transactions.php
Transactions.rollback
public function rollback(): self { ($this->fulfill)( new Request( $this->current()->endpoint(), Method::delete(), new ProtocolVersion(1, 1) ) ); $this->transactions = $this->transactions->dropEnd(1); return $thi...
php
public function rollback(): self { ($this->fulfill)( new Request( $this->current()->endpoint(), Method::delete(), new ProtocolVersion(1, 1) ) ); $this->transactions = $this->transactions->dropEnd(1); return $thi...
[ "public", "function", "rollback", "(", ")", ":", "self", "{", "(", "$", "this", "->", "fulfill", ")", "(", "new", "Request", "(", "$", "this", "->", "current", "(", ")", "->", "endpoint", "(", ")", ",", "Method", "::", "delete", "(", ")", ",", "n...
Rollback the current transaction @return self
[ "Rollback", "the", "current", "transaction" ]
train
https://github.com/Innmind/neo4j-dbal/blob/12cb71e698cc0f4d55b7f2eb40f7b353c778a20b/src/Transactions.php#L141-L153
dreamfactorysoftware/df-cache
src/Services/Local.php
Local.setStore
protected function setStore($config) { $store = array_get($config, 'store'); $availableStores = array_keys(\Config::get('cache.stores', [])); if (empty($store)) { $store = \Config::get('cache.default'); } if (!in_array($store, $availableStores)) { th...
php
protected function setStore($config) { $store = array_get($config, 'store'); $availableStores = array_keys(\Config::get('cache.stores', [])); if (empty($store)) { $store = \Config::get('cache.default'); } if (!in_array($store, $availableStores)) { th...
[ "protected", "function", "setStore", "(", "$", "config", ")", "{", "$", "store", "=", "array_get", "(", "$", "config", ",", "'store'", ")", ";", "$", "availableStores", "=", "array_keys", "(", "\\", "Config", "::", "get", "(", "'cache.stores'", ",", "[",...
{@inheritdoc}
[ "{" ]
train
https://github.com/dreamfactorysoftware/df-cache/blob/6a2aa5dc2fc7963ce89fd7e8f3d51483d2499451/src/Services/Local.php#L9-L23
Eresus/EresusCMS
src/core/lib/forms.php
Form.field_prep
function field_prep(&$item) { $item['type'] = strtolower($item['type']); # Метка if (!isset($item['label'])) $item['label'] = ''; # Подсказка if (isset($item['hint'])) $item['label'] = '<span class="hint" title="'.$item['hint'].'">'.$item['label'].'</span>'; # Маска з...
php
function field_prep(&$item) { $item['type'] = strtolower($item['type']); # Метка if (!isset($item['label'])) $item['label'] = ''; # Подсказка if (isset($item['hint'])) $item['label'] = '<span class="hint" title="'.$item['hint'].'">'.$item['label'].'</span>'; # Маска з...
[ "function", "field_prep", "(", "&", "$", "item", ")", "{", "$", "item", "[", "'type'", "]", "=", "strtolower", "(", "$", "item", "[", "'type'", "]", ")", ";", "# Метка", "if", "(", "!", "isset", "(", "$", "item", "[", "'label'", "]", ")", ")", ...
Подготоваливает поле формы для дальнейшей обработки @access private @param &array $item Описание поле
[ "Подготоваливает", "поле", "формы", "для", "дальнейшей", "обработки" ]
train
https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/lib/forms.php#L65-L98
Eresus/EresusCMS
src/core/lib/forms.php
Form.attrs
function attrs($item) { $result = ''; if ($item['id']) $result .= ' id="'.$item['id'].'"'; if ($item['disabled']) $result .= ' disabled="disabled"'; if (count($item['class'])) $result .= ' class="'.implode(' ', $item['class']).'"'; # Ширина if (isset($item['width'])) ...
php
function attrs($item) { $result = ''; if ($item['id']) $result .= ' id="'.$item['id'].'"'; if ($item['disabled']) $result .= ' disabled="disabled"'; if (count($item['class'])) $result .= ' class="'.implode(' ', $item['class']).'"'; # Ширина if (isset($item['width'])) ...
[ "function", "attrs", "(", "$", "item", ")", "{", "$", "result", "=", "''", ";", "if", "(", "$", "item", "[", "'id'", "]", ")", "$", "result", ".=", "' id=\"'", ".", "$", "item", "[", "'id'", "]", ".", "'\"'", ";", "if", "(", "$", "item", "[",...
Отрисовывает атрибуты элемента @access private @param array $item Элемент @return string Отрисованные атрибуты
[ "Отрисовывает", "атрибуты", "элемента" ]
train
https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/lib/forms.php#L109-L121
Eresus/EresusCMS
src/core/lib/forms.php
Form.render_hidden
function render_hidden($item) { if ($item['name'] === '') { Eresus_Kernel::app()->getPage()->addErrorMessage( sprintf(errFormFieldHasNoName, $item['type'], $this->form['name'])); } $this->hidden .= '<input type="hidden" name="'.$item['name'].'" value="'.$i...
php
function render_hidden($item) { if ($item['name'] === '') { Eresus_Kernel::app()->getPage()->addErrorMessage( sprintf(errFormFieldHasNoName, $item['type'], $this->form['name'])); } $this->hidden .= '<input type="hidden" name="'.$item['name'].'" value="'.$i...
[ "function", "render_hidden", "(", "$", "item", ")", "{", "if", "(", "$", "item", "[", "'name'", "]", "===", "''", ")", "{", "Eresus_Kernel", "::", "app", "(", ")", "->", "getPage", "(", ")", "->", "addErrorMessage", "(", "sprintf", "(", "errFormFieldHa...
<input type="hidden" /> @access protected @param array $item Описание поля @return string Отрисованное поле
[ "<input", "type", "=", "hidden", "/", ">" ]
train
https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/lib/forms.php#L177-L186
Eresus/EresusCMS
src/core/lib/forms.php
Form.render_edit
function render_edit($item) { if ($item['name'] === '') { Eresus_Kernel::app()->getPage()->addErrorMessage( sprintf(errFormFieldHasNoName, $item['type'], $this->form['name'])); } $result = "\t\t".'<tr><td class="formLabel">'.$item['label'].'</td><td><input...
php
function render_edit($item) { if ($item['name'] === '') { Eresus_Kernel::app()->getPage()->addErrorMessage( sprintf(errFormFieldHasNoName, $item['type'], $this->form['name'])); } $result = "\t\t".'<tr><td class="formLabel">'.$item['label'].'</td><td><input...
[ "function", "render_edit", "(", "$", "item", ")", "{", "if", "(", "$", "item", "[", "'name'", "]", "===", "''", ")", "{", "Eresus_Kernel", "::", "app", "(", ")", "->", "getPage", "(", ")", "->", "addErrorMessage", "(", "sprintf", "(", "errFormFieldHasN...
<input type="text" /> @access protected @param array $item Описание поля @return string Отрисованное поле
[ "<input", "type", "=", "text", "/", ">" ]
train
https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/lib/forms.php#L197-L206
Eresus/EresusCMS
src/core/lib/forms.php
Form.render_password
function render_password($item) { if ($item['name'] === '') { Eresus_Kernel::app()->getPage()->addErrorMessage( sprintf(errFormFieldHasNoName, $item['type'], $this->form['name'])); } $result = "\t\t".'<tr><td class="formLabel">'.$item['label'].'</td><td><i...
php
function render_password($item) { if ($item['name'] === '') { Eresus_Kernel::app()->getPage()->addErrorMessage( sprintf(errFormFieldHasNoName, $item['type'], $this->form['name'])); } $result = "\t\t".'<tr><td class="formLabel">'.$item['label'].'</td><td><i...
[ "function", "render_password", "(", "$", "item", ")", "{", "if", "(", "$", "item", "[", "'name'", "]", "===", "''", ")", "{", "Eresus_Kernel", "::", "app", "(", ")", "->", "getPage", "(", ")", "->", "addErrorMessage", "(", "sprintf", "(", "errFormField...
<input type="password" /> @access protected @param array $item Описание поля @return string Отрисованное поле
[ "<input", "type", "=", "password", "/", ">" ]
train
https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/lib/forms.php#L217-L227
Eresus/EresusCMS
src/core/lib/forms.php
Form.render_select
function render_select($item) { if ($item['name'] === '') { Eresus_Kernel::app()->getPage()->addErrorMessage( sprintf(errFormFieldHasNoName, $item['type'], $this->form['name'])); } $result = "\t\t".'<tr><td class="formLabel">'.$item['label'].'</td><td><sel...
php
function render_select($item) { if ($item['name'] === '') { Eresus_Kernel::app()->getPage()->addErrorMessage( sprintf(errFormFieldHasNoName, $item['type'], $this->form['name'])); } $result = "\t\t".'<tr><td class="formLabel">'.$item['label'].'</td><td><sel...
[ "function", "render_select", "(", "$", "item", ")", "{", "if", "(", "$", "item", "[", "'name'", "]", "===", "''", ")", "{", "Eresus_Kernel", "::", "app", "(", ")", "->", "getPage", "(", ")", "->", "addErrorMessage", "(", "sprintf", "(", "errFormFieldHa...
<select> @access protected @param array $item Описание поля @return string Отрисованное поле
[ "<select", ">" ]
train
https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/lib/forms.php#L258-L273
Eresus/EresusCMS
src/core/lib/forms.php
Form.render_memo
function render_memo($item) { if ($item['name'] === '') { Eresus_Kernel::app()->getPage()->addErrorMessage( sprintf(errFormFieldHasNoName, $item['type'], $this->form['name'])); } if (empty($item['width'])) $item['width'] = '100%'; if (strpos($item[...
php
function render_memo($item) { if ($item['name'] === '') { Eresus_Kernel::app()->getPage()->addErrorMessage( sprintf(errFormFieldHasNoName, $item['type'], $this->form['name'])); } if (empty($item['width'])) $item['width'] = '100%'; if (strpos($item[...
[ "function", "render_memo", "(", "$", "item", ")", "{", "if", "(", "$", "item", "[", "'name'", "]", "===", "''", ")", "{", "Eresus_Kernel", "::", "app", "(", ")", "->", "getPage", "(", ")", "->", "addErrorMessage", "(", "sprintf", "(", "errFormFieldHasN...
<textarea></textarea> @access protected @param array $item Описание поля @return string Отрисованное поле
[ "<textarea", ">", "<", "/", "textarea", ">" ]
train
https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/lib/forms.php#L310-L332
Eresus/EresusCMS
src/core/lib/forms.php
Form.render_html
function render_html($item) { if ($item['name'] === '') { Eresus_Kernel::app()->getPage()->addErrorMessage( sprintf(errFormFieldHasNoName, $item['type'], $this->form['name'])); } $result = ''; $extension = Eresus_CMS::getLegacyKernel()->extensions...
php
function render_html($item) { if ($item['name'] === '') { Eresus_Kernel::app()->getPage()->addErrorMessage( sprintf(errFormFieldHasNoName, $item['type'], $this->form['name'])); } $result = ''; $extension = Eresus_CMS::getLegacyKernel()->extensions...
[ "function", "render_html", "(", "$", "item", ")", "{", "if", "(", "$", "item", "[", "'name'", "]", "===", "''", ")", "{", "Eresus_Kernel", "::", "app", "(", ")", "->", "getPage", "(", ")", "->", "addErrorMessage", "(", "sprintf", "(", "errFormFieldHasN...
<textarea html> @access protected @param array $item Описание поля @return string Отрисованное поле
[ "<textarea", "html", ">" ]
train
https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/lib/forms.php#L343-L360
Eresus/EresusCMS
src/core/lib/forms.php
Form.render_file
function render_file($item) { if ($item['name'] === '') { Eresus_Kernel::app()->getPage()->addErrorMessage( sprintf(errFormFieldHasNoName, $item['type'], $this->form['name'])); } $result = "\t\t".'<tr><td class="formLabel">'.$item['label']."</td><td><input...
php
function render_file($item) { if ($item['name'] === '') { Eresus_Kernel::app()->getPage()->addErrorMessage( sprintf(errFormFieldHasNoName, $item['type'], $this->form['name'])); } $result = "\t\t".'<tr><td class="formLabel">'.$item['label']."</td><td><input...
[ "function", "render_file", "(", "$", "item", ")", "{", "if", "(", "$", "item", "[", "'name'", "]", "===", "''", ")", "{", "Eresus_Kernel", "::", "app", "(", ")", "->", "getPage", "(", ")", "->", "addErrorMessage", "(", "sprintf", "(", "errFormFieldHasN...
<input type="file" /> @access protected @param array $item Описание поля @return string Отрисованное поле
[ "<input", "type", "=", "file", "/", ">" ]
train
https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/lib/forms.php#L371-L381
Eresus/EresusCMS
src/core/lib/forms.php
Form.render
function render() { $result = ''; # Выходной код if (empty($this->form['name'])) $result .= ErrorBox(errFormHasNoName); if (count($this->form['fields'])) foreach($this->form['fields'] as $item) { # Проверяем права доступа к элементу if ((!isset($item['access'])) ...
php
function render() { $result = ''; # Выходной код if (empty($this->form['name'])) $result .= ErrorBox(errFormHasNoName); if (count($this->form['fields'])) foreach($this->form['fields'] as $item) { # Проверяем права доступа к элементу if ((!isset($item['access'])) ...
[ "function", "render", "(", ")", "{", "$", "result", "=", "''", ";", "# Выходной код", "if", "(", "empty", "(", "$", "this", "->", "form", "[", "'name'", "]", ")", ")", "$", "result", ".=", "ErrorBox", "(", "errFormHasNoName", ")", ";", "if", "(", "...
Создание HTML-кода @access public @return string HTML-код формы
[ "Создание", "HTML", "-", "кода" ]
train
https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/lib/forms.php#L412-L477
nabab/bbn
src/bbn/ide/directories.php
directories._ide_path
private function _ide_path(){ if ( !self::$dev_path ){ $this->_set_appui(); if ( $id = $this->options->from_code(self::IDE_PATH, BBN_APPUI) ){ self::set_ide_path($id); } } return self::$ide_path; }
php
private function _ide_path(){ if ( !self::$dev_path ){ $this->_set_appui(); if ( $id = $this->options->from_code(self::IDE_PATH, BBN_APPUI) ){ self::set_ide_path($id); } } return self::$ide_path; }
[ "private", "function", "_ide_path", "(", ")", "{", "if", "(", "!", "self", "::", "$", "dev_path", ")", "{", "$", "this", "->", "_set_appui", "(", ")", ";", "if", "(", "$", "id", "=", "$", "this", "->", "options", "->", "from_code", "(", "self", "...
Gets the ID of the development paths option @return int
[ "Gets", "the", "ID", "of", "the", "development", "paths", "option" ]
train
https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/ide/directories.php#L46-L54
nabab/bbn
src/bbn/ide/directories.php
directories._dev_path
private function _dev_path(){ if ( !self::$dev_path ){ if ( $id = $this->options->from_code(self::DEV_PATH, self::IDE_PATH) ){ self::set_dev_path($id); } } return self::$dev_path; }
php
private function _dev_path(){ if ( !self::$dev_path ){ if ( $id = $this->options->from_code(self::DEV_PATH, self::IDE_PATH) ){ self::set_dev_path($id); } } return self::$dev_path; }
[ "private", "function", "_dev_path", "(", ")", "{", "if", "(", "!", "self", "::", "$", "dev_path", ")", "{", "if", "(", "$", "id", "=", "$", "this", "->", "options", "->", "from_code", "(", "self", "::", "DEV_PATH", ",", "self", "::", "IDE_PATH", ")...
Gets the ID of the development paths option @return int
[ "Gets", "the", "ID", "of", "the", "development", "paths", "option" ]
train
https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/ide/directories.php#L68-L75
nabab/bbn
src/bbn/ide/directories.php
directories._path_type
private function _path_type(){ if ( !self::$path_type ){ if ( $id = $this->options->from_code(self::PATH_TYPE, self::IDE_PATH) ){ self::set_path_type($id); } } return self::$path_type; }
php
private function _path_type(){ if ( !self::$path_type ){ if ( $id = $this->options->from_code(self::PATH_TYPE, self::IDE_PATH) ){ self::set_path_type($id); } } return self::$path_type; }
[ "private", "function", "_path_type", "(", ")", "{", "if", "(", "!", "self", "::", "$", "path_type", ")", "{", "if", "(", "$", "id", "=", "$", "this", "->", "options", "->", "from_code", "(", "self", "::", "PATH_TYPE", ",", "self", "::", "IDE_PATH", ...
Gets the ID of the paths' types option @return int
[ "Gets", "the", "ID", "of", "the", "paths", "types", "option" ]
train
https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/ide/directories.php#L89-L96
nabab/bbn
src/bbn/ide/directories.php
directories._files_pref
private function _files_pref(){ if ( !self::$files_pref ){ if ( $id = $this->options->from_code(self::FILES_PREF, self::IDE_PATH) ){ self::set_files_pref($id); } } return self::$files_pref; }
php
private function _files_pref(){ if ( !self::$files_pref ){ if ( $id = $this->options->from_code(self::FILES_PREF, self::IDE_PATH) ){ self::set_files_pref($id); } } return self::$files_pref; }
[ "private", "function", "_files_pref", "(", ")", "{", "if", "(", "!", "self", "::", "$", "files_pref", ")", "{", "if", "(", "$", "id", "=", "$", "this", "->", "options", "->", "from_code", "(", "self", "::", "FILES_PREF", ",", "self", "::", "IDE_PATH"...
Gets the ID of the paths' types option @return int
[ "Gets", "the", "ID", "of", "the", "paths", "types", "option" ]
train
https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/ide/directories.php#L110-L117
nabab/bbn
src/bbn/ide/directories.php
directories.rem_dir_opt
private function rem_dir_opt($d){ $sub_files = bbn\file\dir::scan($d); $files = []; foreach ( $sub_files as $sub ){ if ( is_file($sub) ){ // Add it to files to be closed array_push($files, $this->real_to_url($sub)); // Remove file's options $this->options->remove($this-...
php
private function rem_dir_opt($d){ $sub_files = bbn\file\dir::scan($d); $files = []; foreach ( $sub_files as $sub ){ if ( is_file($sub) ){ // Add it to files to be closed array_push($files, $this->real_to_url($sub)); // Remove file's options $this->options->remove($this-...
[ "private", "function", "rem_dir_opt", "(", "$", "d", ")", "{", "$", "sub_files", "=", "bbn", "\\", "file", "\\", "dir", "::", "scan", "(", "$", "d", ")", ";", "$", "files", "=", "[", "]", ";", "foreach", "(", "$", "sub_files", "as", "$", "sub", ...
Deletes all files' options of a folder and returns an array of these files. @param string $d The folder's path @return array
[ "Deletes", "all", "files", "options", "of", "a", "folder", "and", "returns", "an", "array", "of", "these", "files", "." ]
train
https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/ide/directories.php#L125-L143
nabab/bbn
src/bbn/ide/directories.php
directories.superior_sctrl
private function superior_sctrl($tab, $path=''){ if ( ($pos = strpos($tab, '_ctrl')) ){ // Fix the right path $bits = explode('/', $path); $count = \strlen(substr($tab, 0, $pos)); if ( !empty($bits) ){ while ( $count >= 0 ){ array_pop($bits); $count--; } ...
php
private function superior_sctrl($tab, $path=''){ if ( ($pos = strpos($tab, '_ctrl')) ){ // Fix the right path $bits = explode('/', $path); $count = \strlen(substr($tab, 0, $pos)); if ( !empty($bits) ){ while ( $count >= 0 ){ array_pop($bits); $count--; } ...
[ "private", "function", "superior_sctrl", "(", "$", "tab", ",", "$", "path", "=", "''", ")", "{", "if", "(", "(", "$", "pos", "=", "strpos", "(", "$", "tab", ",", "'_ctrl'", ")", ")", ")", "{", "// Fix the right path", "$", "bits", "=", "explode", "...
Checks if the file is a superior super-controller and returns the corrected name and path @param string $tab The tab'name from file's URL @param string $path The file's path from file's URL @return array
[ "Checks", "if", "the", "file", "is", "a", "superior", "super", "-", "controller", "and", "returns", "the", "corrected", "name", "and", "path" ]
train
https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/ide/directories.php#L152-L171
nabab/bbn
src/bbn/ide/directories.php
directories.real_to_id
public function real_to_id($file){ $timer = new bbn\util\timer(); $timer->start('real_to_id'); $url = self::real_to_url($file); $dir = self::dir(self::dir_from_url($url)); if ( !empty($dir) && \defined($dir['bbn_path']) ){ $bbn_p = constant($dir['bbn_path']); if ( strpos($file,...
php
public function real_to_id($file){ $timer = new bbn\util\timer(); $timer->start('real_to_id'); $url = self::real_to_url($file); $dir = self::dir(self::dir_from_url($url)); if ( !empty($dir) && \defined($dir['bbn_path']) ){ $bbn_p = constant($dir['bbn_path']); if ( strpos($file,...
[ "public", "function", "real_to_id", "(", "$", "file", ")", "{", "$", "timer", "=", "new", "bbn", "\\", "util", "\\", "timer", "(", ")", ";", "$", "timer", "->", "start", "(", "'real_to_id'", ")", ";", "$", "url", "=", "self", "::", "real_to_url", "...
Returns the file's ID from the real file's path. @param string $file The real file's path @todo Fix the slowness! @return bool|string
[ "Returns", "the", "file", "s", "ID", "from", "the", "real", "file", "s", "path", "." ]
train
https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/ide/directories.php#L289-L331
nabab/bbn
src/bbn/ide/directories.php
directories.url_to_real
public function url_to_real($url){ if ( ($dn = $this->dir_from_url($url)) && ($dir = $this->dir($dn)) && ($res = $this->get_root_path($dn)) ){ $bits = explode('/', substr($url, \strlen($dn), \strlen($url))); if ( !empty($dir['tabs']) && !empty($bits) ){ // Tab's nane $tab...
php
public function url_to_real($url){ if ( ($dn = $this->dir_from_url($url)) && ($dir = $this->dir($dn)) && ($res = $this->get_root_path($dn)) ){ $bits = explode('/', substr($url, \strlen($dn), \strlen($url))); if ( !empty($dir['tabs']) && !empty($bits) ){ // Tab's nane $tab...
[ "public", "function", "url_to_real", "(", "$", "url", ")", "{", "if", "(", "(", "$", "dn", "=", "$", "this", "->", "dir_from_url", "(", "$", "url", ")", ")", "&&", "(", "$", "dir", "=", "$", "this", "->", "dir", "(", "$", "dn", ")", ")", "&&"...
Gets the real file's path from an URL @param string $url The file's URL @return bool|string
[ "Gets", "the", "real", "file", "s", "path", "from", "an", "URL" ]
train
https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/ide/directories.php#L339-L392
nabab/bbn
src/bbn/ide/directories.php
directories.dir_from_url
public function dir_from_url($url){ $dir = false; foreach ( $this->dirs() as $i => $d ){ if ( (strpos($url, $i) === 0) && (\strlen($i) > \strlen($dir) ) ){ $dir = $i; break; } } return $dir; }
php
public function dir_from_url($url){ $dir = false; foreach ( $this->dirs() as $i => $d ){ if ( (strpos($url, $i) === 0) && (\strlen($i) > \strlen($dir) ) ){ $dir = $i; break; } } return $dir; }
[ "public", "function", "dir_from_url", "(", "$", "url", ")", "{", "$", "dir", "=", "false", ";", "foreach", "(", "$", "this", "->", "dirs", "(", ")", "as", "$", "i", "=>", "$", "d", ")", "{", "if", "(", "(", "strpos", "(", "$", "url", ",", "$"...
Returns the dir's name from an URL @param string $url @return bool|int|string
[ "Returns", "the", "dir", "s", "name", "from", "an", "URL" ]
train
https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/ide/directories.php#L400-L411
nabab/bbn
src/bbn/ide/directories.php
directories.url_to_id
public function url_to_id($url){ if ( $file = $this->url_to_real($url) ){ return $this->real_to_id($file); } return false; }
php
public function url_to_id($url){ if ( $file = $this->url_to_real($url) ){ return $this->real_to_id($file); } return false; }
[ "public", "function", "url_to_id", "(", "$", "url", ")", "{", "if", "(", "$", "file", "=", "$", "this", "->", "url_to_real", "(", "$", "url", ")", ")", "{", "return", "$", "this", "->", "real_to_id", "(", "$", "file", ")", ";", "}", "return", "fa...
Returns the file's ID from its URL @param string $url The file's URL @return bool|string
[ "Returns", "the", "file", "s", "ID", "from", "its", "URL" ]
train
https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/ide/directories.php#L429-L434
nabab/bbn
src/bbn/ide/directories.php
directories.id_to_url
public function id_to_url($id){ if ( $file = $this->id_to_real($id) ){ return $this->real_to_url($file); } return false; }
php
public function id_to_url($id){ if ( $file = $this->id_to_real($id) ){ return $this->real_to_url($file); } return false; }
[ "public", "function", "id_to_url", "(", "$", "id", ")", "{", "if", "(", "$", "file", "=", "$", "this", "->", "id_to_real", "(", "$", "id", ")", ")", "{", "return", "$", "this", "->", "real_to_url", "(", "$", "file", ")", ";", "}", "return", "fals...
Returns the file's URL from its ID @param string $id The file's ID @return bool|string
[ "Returns", "the", "file", "s", "URL", "from", "its", "ID" ]
train
https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/ide/directories.php#L442-L447
nabab/bbn
src/bbn/ide/directories.php
directories.get_root_path
public function get_root_path($code){ /** @var array $dir The directory configuration */ $dir = $this->dir($code); if ( $dir ){ $path = $this->decipher_path(bbn\str::parse_path($dir['bbn_path'].(!empty($dir['path']) ? '/' . $dir['path'] : ''))); $r = bbn\str::parse_path($path.'/'); return...
php
public function get_root_path($code){ /** @var array $dir The directory configuration */ $dir = $this->dir($code); if ( $dir ){ $path = $this->decipher_path(bbn\str::parse_path($dir['bbn_path'].(!empty($dir['path']) ? '/' . $dir['path'] : ''))); $r = bbn\str::parse_path($path.'/'); return...
[ "public", "function", "get_root_path", "(", "$", "code", ")", "{", "/** @var array $dir The directory configuration */", "$", "dir", "=", "$", "this", "->", "dir", "(", "$", "code", ")", ";", "if", "(", "$", "dir", ")", "{", "$", "path", "=", "$", "this"...
Gets the real root path from a directory's id as recorded in the options. @param string $code The dir's name (code) @return bool|string
[ "Gets", "the", "real", "root", "path", "from", "a", "directory", "s", "id", "as", "recorded", "in", "the", "options", "." ]
train
https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/ide/directories.php#L455-L465
nabab/bbn
src/bbn/ide/directories.php
directories.dirs
public function dirs($code=false){ $all = $this->options->full_soptions(self::_dev_path()); $cats = []; $r = []; foreach ( $all as $a ){ if ( \defined($a['bbn_path']) ){ $k = $a['bbn_path'] . '/' . ($a['code'] === '/' ? '' : $a['code']); if ( !isset($cats[$a['id_alias']]) ){ ...
php
public function dirs($code=false){ $all = $this->options->full_soptions(self::_dev_path()); $cats = []; $r = []; foreach ( $all as $a ){ if ( \defined($a['bbn_path']) ){ $k = $a['bbn_path'] . '/' . ($a['code'] === '/' ? '' : $a['code']); if ( !isset($cats[$a['id_alias']]) ){ ...
[ "public", "function", "dirs", "(", "$", "code", "=", "false", ")", "{", "$", "all", "=", "$", "this", "->", "options", "->", "full_soptions", "(", "self", "::", "_dev_path", "(", ")", ")", ";", "$", "cats", "=", "[", "]", ";", "$", "r", "=", "[...
Make dirs' configurations @param string|bool $code The dir's name (code) @return array|bool
[ "Make", "dirs", "configurations" ]
train
https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/ide/directories.php#L552-L581
nabab/bbn
src/bbn/ide/directories.php
directories.create
public function create($dir, $tab, $path, $name, $type){ if ( ($cfg = $this->dir($dir)) && ($root = $this->get_root_path($dir)) ){ $path = $path === './' ? '' : $path . '/'; $ext = bbn\str::file_ext($name); $default = ''; // MVC if ( !empty($cfg['tabs']) && !empty($t...
php
public function create($dir, $tab, $path, $name, $type){ if ( ($cfg = $this->dir($dir)) && ($root = $this->get_root_path($dir)) ){ $path = $path === './' ? '' : $path . '/'; $ext = bbn\str::file_ext($name); $default = ''; // MVC if ( !empty($cfg['tabs']) && !empty($t...
[ "public", "function", "create", "(", "$", "dir", ",", "$", "tab", ",", "$", "path", ",", "$", "name", ",", "$", "type", ")", "{", "if", "(", "(", "$", "cfg", "=", "$", "this", "->", "dir", "(", "$", "dir", ")", ")", "&&", "(", "$", "root", ...
Creates a a new file or a new directory. @param string $dir The source's name @param string|false $tab The tab's name (MVC) @param string $path The file/directory's path @param string $name The file/directory's name @param string $type If it's a file or a directory (file|dir) @return string|void
[ "Creates", "a", "a", "new", "file", "or", "a", "new", "directory", "." ]
train
https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/ide/directories.php#L611-L674
nabab/bbn
src/bbn/ide/directories.php
directories.load
public function load($file, $dir, $tab, bbn\user\preferences $pref = null){ /** @var boolean|array $res */ $res = false; $file = bbn\str::parse_path($file); if ( $file && $dir ){ /** @var array $dir_cfg The directory configuration from DB */ if ( \is_array($dir) ){ $dir_cfg = $dir; ...
php
public function load($file, $dir, $tab, bbn\user\preferences $pref = null){ /** @var boolean|array $res */ $res = false; $file = bbn\str::parse_path($file); if ( $file && $dir ){ /** @var array $dir_cfg The directory configuration from DB */ if ( \is_array($dir) ){ $dir_cfg = $dir; ...
[ "public", "function", "load", "(", "$", "file", ",", "$", "dir", ",", "$", "tab", ",", "bbn", "\\", "user", "\\", "preferences", "$", "pref", "=", "null", ")", "{", "/** @var boolean|array $res */", "$", "res", "=", "false", ";", "$", "file", "=", "b...
Loads a file. @param string $file @param string|array $dir @param string $tab @param bbn\user\preferences|null $pref @return array|bool
[ "Loads", "a", "file", "." ]
train
https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/ide/directories.php#L685-L705
nabab/bbn
src/bbn/ide/directories.php
directories.get_file
protected function get_file($file, $dir, $tab, array $cfg, bbn\user\preferences $pref = null){ if ( isset($cfg['title'], $cfg['bcolor'], $cfg['fcolor']) ){ /** @var string $name The file's name - without path and extension */ $name = bbn\str::file_ext($file, 1)[0]; /** @var string $ext The file's ...
php
protected function get_file($file, $dir, $tab, array $cfg, bbn\user\preferences $pref = null){ if ( isset($cfg['title'], $cfg['bcolor'], $cfg['fcolor']) ){ /** @var string $name The file's name - without path and extension */ $name = bbn\str::file_ext($file, 1)[0]; /** @var string $ext The file's ...
[ "protected", "function", "get_file", "(", "$", "file", ",", "$", "dir", ",", "$", "tab", ",", "array", "$", "cfg", ",", "bbn", "\\", "user", "\\", "preferences", "$", "pref", "=", "null", ")", "{", "if", "(", "isset", "(", "$", "cfg", "[", "'titl...
Gets a file @param string $file @param string $dir @param string $tab @param array $cfg @param bbn\user\preferences|null $pref @return array
[ "Gets", "a", "file" ]
train
https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/ide/directories.php#L727-L865
nabab/bbn
src/bbn/ide/directories.php
directories.save
public function save($file, $code, array $cfg = null, bbn\user\preferences $pref = null){ die(var_dump($file, $code, $cfg )); if ( ($file = bbn\str::parse_path($file)) && ($real = $this->url_to_real($file)) && ($dir = $this->dir($this->dir_from_url($file))) && \defined('BBN_USER_PATH') ){ ...
php
public function save($file, $code, array $cfg = null, bbn\user\preferences $pref = null){ die(var_dump($file, $code, $cfg )); if ( ($file = bbn\str::parse_path($file)) && ($real = $this->url_to_real($file)) && ($dir = $this->dir($this->dir_from_url($file))) && \defined('BBN_USER_PATH') ){ ...
[ "public", "function", "save", "(", "$", "file", ",", "$", "code", ",", "array", "$", "cfg", "=", "null", ",", "bbn", "\\", "user", "\\", "preferences", "$", "pref", "=", "null", ")", "{", "die", "(", "var_dump", "(", "$", "file", ",", "$", "code"...
Saves a file. @param string $file The file's URL @param string $code The file's content @param array|null $cfg The user preferences @param bbn\user\preferences|null $pref @return array|void
[ "Saves", "a", "file", "." ]
train
https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/ide/directories.php#L876-L932
nabab/bbn
src/bbn/ide/directories.php
directories.set_preferences
public function set_preferences($id_user, $id_file, $md5, array $cfg = null, bbn\user\preferences $pref = null){ if ( !empty($id_user) && !empty($id_file) && !empty($pref) ){ $change['md5'] = $md5; if ( !empty($cfg['selections']) ){ $change['selections'] = $cfg['selections']; } if ( ...
php
public function set_preferences($id_user, $id_file, $md5, array $cfg = null, bbn\user\preferences $pref = null){ if ( !empty($id_user) && !empty($id_file) && !empty($pref) ){ $change['md5'] = $md5; if ( !empty($cfg['selections']) ){ $change['selections'] = $cfg['selections']; } if ( ...
[ "public", "function", "set_preferences", "(", "$", "id_user", ",", "$", "id_file", ",", "$", "md5", ",", "array", "$", "cfg", "=", "null", ",", "bbn", "\\", "user", "\\", "preferences", "$", "pref", "=", "null", ")", "{", "if", "(", "!", "empty", "...
Sets user's preferences for a file. @param string $id_user The user's id @param string $id_file The file's id @param string $md5 The file's md5 @param array|null $cfg @param bbn\user\preferences|null $pref @return bool
[ "Sets", "user", "s", "preferences", "for", "a", "file", "." ]
train
https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/ide/directories.php#L944-L961
nabab/bbn
src/bbn/ide/directories.php
directories.copy
public function copy($dir, $path, $name, $type, $file){ if ( ($cfg = $this->dir($dir)) && ($root = $this->get_root_path($dir)) && bbn\str::check_filename($name) ){ $is_file = $type === 'file'; $wtype = $is_file ? 'file' : 'directory'; $path = $path === './' ? '' : $path . '/'; ...
php
public function copy($dir, $path, $name, $type, $file){ if ( ($cfg = $this->dir($dir)) && ($root = $this->get_root_path($dir)) && bbn\str::check_filename($name) ){ $is_file = $type === 'file'; $wtype = $is_file ? 'file' : 'directory'; $path = $path === './' ? '' : $path . '/'; ...
[ "public", "function", "copy", "(", "$", "dir", ",", "$", "path", ",", "$", "name", ",", "$", "type", ",", "$", "file", ")", "{", "if", "(", "(", "$", "cfg", "=", "$", "this", "->", "dir", "(", "$", "dir", ")", ")", "&&", "(", "$", "root", ...
Duplicates a file or a directory, MVC or not. @param string $dir The source's name @param string $path The new file's path @param string $name The new filename @param string $type file|dir @param string $file The existing file path and name @return bool|string @todo Duplicate the users' permissions when duplicating a ...
[ "Duplicates", "a", "file", "or", "a", "directory", "MVC", "or", "not", "." ]
train
https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/ide/directories.php#L974-L1090
nabab/bbn
src/bbn/ide/directories.php
directories.delete
public function delete($dir, $path, $name, $type = 'file'){ if ( ($cfg = $this->dir($dir)) && ($root = $this->get_root_path($dir)) ){ $is_file = $type === 'file'; $wtype = $is_file ? 'file' : 'directory'; $delete = []; if ( !empty($cfg['tabs']) ){ foreach ( $cfg['tabs'] as ...
php
public function delete($dir, $path, $name, $type = 'file'){ if ( ($cfg = $this->dir($dir)) && ($root = $this->get_root_path($dir)) ){ $is_file = $type === 'file'; $wtype = $is_file ? 'file' : 'directory'; $delete = []; if ( !empty($cfg['tabs']) ){ foreach ( $cfg['tabs'] as ...
[ "public", "function", "delete", "(", "$", "dir", ",", "$", "path", ",", "$", "name", ",", "$", "type", "=", "'file'", ")", "{", "if", "(", "(", "$", "cfg", "=", "$", "this", "->", "dir", "(", "$", "dir", ")", ")", "&&", "(", "$", "root", "=...
Deletes a file or a directory. @param string $dir The source's name @param string $path The file|directory's path @param string $name The file|directory's name @param string $type The type (file|dir) @return array|bool
[ "Deletes", "a", "file", "or", "a", "directory", "." ]
train
https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/ide/directories.php#L1101-L1174
nabab/bbn
src/bbn/ide/directories.php
directories.export
public function export($dir, $path, $name, $type = 'file'){ if ( ($cfg = $this->dir($dir)) && ($root = $this->get_root_path($dir)) && \defined('BBN_USER_PATH') ){ $is_file = $type === 'file'; $wtype = $is_file ? 'file' : 'directory'; $rnd = bbn\str::genpwd(); $root_dest = BBN...
php
public function export($dir, $path, $name, $type = 'file'){ if ( ($cfg = $this->dir($dir)) && ($root = $this->get_root_path($dir)) && \defined('BBN_USER_PATH') ){ $is_file = $type === 'file'; $wtype = $is_file ? 'file' : 'directory'; $rnd = bbn\str::genpwd(); $root_dest = BBN...
[ "public", "function", "export", "(", "$", "dir", ",", "$", "path", ",", "$", "name", ",", "$", "type", "=", "'file'", ")", "{", "if", "(", "(", "$", "cfg", "=", "$", "this", "->", "dir", "(", "$", "dir", ")", ")", "&&", "(", "$", "root", "=...
Exports a file or a directory, normal or MVC. @param string $dir The source's name @param string $path The file|directory's path @param string $name The file|directory's name @param string $type file|dir @return bool
[ "Exports", "a", "file", "or", "a", "directory", "normal", "or", "MVC", "." ]
train
https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/ide/directories.php#L1185-L1301
nabab/bbn
src/bbn/ide/directories.php
directories.rename
public function rename($dir, $path, $new, $type = 'file'){ if ( ($cfg = $this->dir($dir)) && ($root = $this->get_root_path($dir)) && bbn\str::check_filename($new) ){ $is_file = $type === 'file'; $wtype = $is_file ? 'file' : 'directory'; $pi = pathinfo($path); $files = []; ...
php
public function rename($dir, $path, $new, $type = 'file'){ if ( ($cfg = $this->dir($dir)) && ($root = $this->get_root_path($dir)) && bbn\str::check_filename($new) ){ $is_file = $type === 'file'; $wtype = $is_file ? 'file' : 'directory'; $pi = pathinfo($path); $files = []; ...
[ "public", "function", "rename", "(", "$", "dir", ",", "$", "path", ",", "$", "new", ",", "$", "type", "=", "'file'", ")", "{", "if", "(", "(", "$", "cfg", "=", "$", "this", "->", "dir", "(", "$", "dir", ")", ")", "&&", "(", "$", "root", "="...
Renames a file or a directory. @param string $dir The source's name @param string $path The file|directory's old path (included filename and its extension) @param string $new The new file's name @param string $type file|dir @return array|bool
[ "Renames", "a", "file", "or", "a", "directory", "." ]
train
https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/ide/directories.php#L1312-L1439
nabab/bbn
src/bbn/ide/directories.php
directories.change_ext
public function change_ext($ext, $file){ if ( !empty($ext) && !empty($file) && file_exists($file) ){ $pi = pathinfo($file); $new = $pi['dirname'].'/'.$pi['filename'].'.'.$ext; bbn\file\dir::move($file, $new, true); return [ 'file' => $new, 'file_url' => $this-...
php
public function change_ext($ext, $file){ if ( !empty($ext) && !empty($file) && file_exists($file) ){ $pi = pathinfo($file); $new = $pi['dirname'].'/'.$pi['filename'].'.'.$ext; bbn\file\dir::move($file, $new, true); return [ 'file' => $new, 'file_url' => $this-...
[ "public", "function", "change_ext", "(", "$", "ext", ",", "$", "file", ")", "{", "if", "(", "!", "empty", "(", "$", "ext", ")", "&&", "!", "empty", "(", "$", "file", ")", "&&", "file_exists", "(", "$", "file", ")", ")", "{", "$", "pi", "=", "...
Changes the extension to a file. @param string $ext The new extension @param string $file The file to change @return array
[ "Changes", "the", "extension", "to", "a", "file", "." ]
train
https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/ide/directories.php#L1576-L1590
nabab/bbn
src/bbn/ide/directories.php
directories.create_perm_by_real
public function create_perm_by_real($file, $type='file'){ if ( !empty($file) && \defined('BBN_APP_PATH') && file_exists($file) && // It must be a controller (strpos($file, '/mvc/public/') !== false) ){ $is_file = $type === 'file'; // Check if it's an external route fore...
php
public function create_perm_by_real($file, $type='file'){ if ( !empty($file) && \defined('BBN_APP_PATH') && file_exists($file) && // It must be a controller (strpos($file, '/mvc/public/') !== false) ){ $is_file = $type === 'file'; // Check if it's an external route fore...
[ "public", "function", "create_perm_by_real", "(", "$", "file", ",", "$", "type", "=", "'file'", ")", "{", "if", "(", "!", "empty", "(", "$", "file", ")", "&&", "\\", "defined", "(", "'BBN_APP_PATH'", ")", "&&", "file_exists", "(", "$", "file", ")", "...
Creates a permission option from a real file/dir's path @param string $file The real file/dir's path @param string $type The type of real (file/dir) @return bool
[ "Creates", "a", "permission", "option", "from", "a", "real", "file", "/", "dir", "s", "path" ]
train
https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/ide/directories.php#L1647-L1703
nabab/bbn
src/bbn/ide/directories.php
directories.change_perm_by_real
public function change_perm_by_real($file, $file_new, $type='file'){ if ( !empty($file) && !empty($file_new) && file_exists($file_new) && ($id_opt = $this->real_to_perm($file, $type)) && !$this->real_to_perm($file_new, $type) ){ $is_file = $type === 'file'; $code = $is_file ?...
php
public function change_perm_by_real($file, $file_new, $type='file'){ if ( !empty($file) && !empty($file_new) && file_exists($file_new) && ($id_opt = $this->real_to_perm($file, $type)) && !$this->real_to_perm($file_new, $type) ){ $is_file = $type === 'file'; $code = $is_file ?...
[ "public", "function", "change_perm_by_real", "(", "$", "file", ",", "$", "file_new", ",", "$", "type", "=", "'file'", ")", "{", "if", "(", "!", "empty", "(", "$", "file", ")", "&&", "!", "empty", "(", "$", "file_new", ")", "&&", "file_exists", "(", ...
Changes permissions to a file/dir from the old and new real file/dir's path @param string $file The old real file/dir's path @param string $file_new The new real file/dir's path @param string $type The type (file/dir) @return bool
[ "Changes", "permissions", "to", "a", "file", "/", "dir", "from", "the", "old", "and", "new", "real", "file", "/", "dir", "s", "path" ]
train
https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/ide/directories.php#L1713-L1730
nabab/bbn
src/bbn/ide/directories.php
directories.delete_perm
public function delete_perm($file, $type='file'){ if ( !empty($file) && ($id_opt = $this->real_to_perm($file, $type)) && $this->options->remove($id_opt) ){ return true; } return false; }
php
public function delete_perm($file, $type='file'){ if ( !empty($file) && ($id_opt = $this->real_to_perm($file, $type)) && $this->options->remove($id_opt) ){ return true; } return false; }
[ "public", "function", "delete_perm", "(", "$", "file", ",", "$", "type", "=", "'file'", ")", "{", "if", "(", "!", "empty", "(", "$", "file", ")", "&&", "(", "$", "id_opt", "=", "$", "this", "->", "real_to_perm", "(", "$", "file", ",", "$", "type"...
Deletes permission from a real file/dir's path @param string $file The real file/dir's path @param string $type The type (file/dir) @return bool
[ "Deletes", "permission", "from", "a", "real", "file", "/", "dir", "s", "path" ]
train
https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/ide/directories.php#L1739-L1747
nabab/bbn
src/bbn/ide/directories.php
directories.history
public function history($url){ if ( !empty($url) && ( $dir = $this->dir_from_url($url) ) && ( $dir_cfg = $this->dir($dir) ) && \defined('BBN_USER_PATH') ){ $res = []; $all = []; // IDE backup path $path = BBN_USER_PATH."ide/backup/$dir"; // Remove dir name from ur...
php
public function history($url){ if ( !empty($url) && ( $dir = $this->dir_from_url($url) ) && ( $dir_cfg = $this->dir($dir) ) && \defined('BBN_USER_PATH') ){ $res = []; $all = []; // IDE backup path $path = BBN_USER_PATH."ide/backup/$dir"; // Remove dir name from ur...
[ "public", "function", "history", "(", "$", "url", ")", "{", "if", "(", "!", "empty", "(", "$", "url", ")", "&&", "(", "$", "dir", "=", "$", "this", "->", "dir_from_url", "(", "$", "url", ")", ")", "&&", "(", "$", "dir_cfg", "=", "$", "this", ...
Returns all backup history of a file. @param string $url The file's URL @return array|bool
[ "Returns", "all", "backup", "history", "of", "a", "file", "." ]
train
https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/ide/directories.php#L1819-L1867
nabab/bbn
src/bbn/ide/directories.php
directories.modes
public function modes($type = false){ if ( \defined('BBN_DATA_PATH') ){ $r = [ 'html' => [ 'name' => 'HTML', 'mode' => 'htmlmixed', 'code' => is_file(BBN_DATA_PATH.'ide/defaults/default.html') ? file_get_contents(BBN_DATA_PATH.'ide/defaults/default.html') : '' ], ...
php
public function modes($type = false){ if ( \defined('BBN_DATA_PATH') ){ $r = [ 'html' => [ 'name' => 'HTML', 'mode' => 'htmlmixed', 'code' => is_file(BBN_DATA_PATH.'ide/defaults/default.html') ? file_get_contents(BBN_DATA_PATH.'ide/defaults/default.html') : '' ], ...
[ "public", "function", "modes", "(", "$", "type", "=", "false", ")", "{", "if", "(", "\\", "defined", "(", "'BBN_DATA_PATH'", ")", ")", "{", "$", "r", "=", "[", "'html'", "=>", "[", "'name'", "=>", "'HTML'", ",", "'mode'", "=>", "'htmlmixed'", ",", ...
Returns @return array
[ "Returns" ]
train
https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/ide/directories.php#L1894-L1945
pinepain/amqpy
src/AMQPy/Support/DeliveryBuilder.php
DeliveryBuilder.wrap
public function wrap(AMQPEnvelope $envelope, $properties_skeleton = 'AMQPy\Client\Properties', $envelope_skeleton = 'AMQPy\Client\Envelope') { return new $this->wrapper_skeleton($envelope, $properties_skeleton, $envelope_skeleton); }
php
public function wrap(AMQPEnvelope $envelope, $properties_skeleton = 'AMQPy\Client\Properties', $envelope_skeleton = 'AMQPy\Client\Envelope') { return new $this->wrapper_skeleton($envelope, $properties_skeleton, $envelope_skeleton); }
[ "public", "function", "wrap", "(", "AMQPEnvelope", "$", "envelope", ",", "$", "properties_skeleton", "=", "'AMQPy\\Client\\Properties'", ",", "$", "envelope_skeleton", "=", "'AMQPy\\Client\\Envelope'", ")", "{", "return", "new", "$", "this", "->", "wrapper_skeleton", ...
@param AMQPEnvelope $envelope @param string $properties_skeleton @param string $envelope_skeleton @return EnvelopeWrapper
[ "@param", "AMQPEnvelope", "$envelope", "@param", "string", "$properties_skeleton", "@param", "string", "$envelope_skeleton" ]
train
https://github.com/pinepain/amqpy/blob/fc61dacc37a97a100caf67232a72be32dd7cc896/src/AMQPy/Support/DeliveryBuilder.php#L27-L30
pinepain/amqpy
src/AMQPy/Support/DeliveryBuilder.php
DeliveryBuilder.build
public function build(AMQPEnvelope $envelope) { $wrapper = $this->wrap($envelope); return new $this->delivery_skeleton($wrapper->getBody(), $wrapper->getEnvelope(), $wrapper->getProperties()); }
php
public function build(AMQPEnvelope $envelope) { $wrapper = $this->wrap($envelope); return new $this->delivery_skeleton($wrapper->getBody(), $wrapper->getEnvelope(), $wrapper->getProperties()); }
[ "public", "function", "build", "(", "AMQPEnvelope", "$", "envelope", ")", "{", "$", "wrapper", "=", "$", "this", "->", "wrap", "(", "$", "envelope", ")", ";", "return", "new", "$", "this", "->", "delivery_skeleton", "(", "$", "wrapper", "->", "getBody", ...
@param AMQPEnvelope $envelope @return Delivery
[ "@param", "AMQPEnvelope", "$envelope" ]
train
https://github.com/pinepain/amqpy/blob/fc61dacc37a97a100caf67232a72be32dd7cc896/src/AMQPy/Support/DeliveryBuilder.php#L37-L42
willhoffmann/domuserp-php
src/DataReceiver.php
DataReceiver.payload
public function payload(array $data) { foreach ($data as $key => $value) { $this->data->{$key} = $value; } return $this; }
php
public function payload(array $data) { foreach ($data as $key => $value) { $this->data->{$key} = $value; } return $this; }
[ "public", "function", "payload", "(", "array", "$", "data", ")", "{", "foreach", "(", "$", "data", "as", "$", "key", "=>", "$", "value", ")", "{", "$", "this", "->", "data", "->", "{", "$", "key", "}", "=", "$", "value", ";", "}", "return", "$"...
Payload the request @param array $data @return $this
[ "Payload", "the", "request" ]
train
https://github.com/willhoffmann/domuserp-php/blob/44e77a4f02b0252bc26cae4c0e6b2b7d578f10a6/src/DataReceiver.php#L44-L51
willhoffmann/domuserp-php
src/DataReceiver.php
DataReceiver.toArray
public function toArray() { $this->data->id = $this->id; return json_decode(json_encode($this->data), true); }
php
public function toArray() { $this->data->id = $this->id; return json_decode(json_encode($this->data), true); }
[ "public", "function", "toArray", "(", ")", "{", "$", "this", "->", "data", "->", "id", "=", "$", "this", "->", "id", ";", "return", "json_decode", "(", "json_encode", "(", "$", "this", "->", "data", ")", ",", "true", ")", ";", "}" ]
Get the request data @return array
[ "Get", "the", "request", "data" ]
train
https://github.com/willhoffmann/domuserp-php/blob/44e77a4f02b0252bc26cae4c0e6b2b7d578f10a6/src/DataReceiver.php#L58-L63
Innmind/neo4j-dbal
src/Result/Result.php
Result.fromRaw
public static function fromRaw(array $response): self { $data = $response['data'] ?? []; return new self( self::buildNodes($data), self::buildRelationships($data), self::buildRows($response) ); }
php
public static function fromRaw(array $response): self { $data = $response['data'] ?? []; return new self( self::buildNodes($data), self::buildRelationships($data), self::buildRows($response) ); }
[ "public", "static", "function", "fromRaw", "(", "array", "$", "response", ")", ":", "self", "{", "$", "data", "=", "$", "response", "[", "'data'", "]", "??", "[", "]", ";", "return", "new", "self", "(", "self", "::", "buildNodes", "(", "$", "data", ...
Build a result object out of a standard neo4j rest api response @param array $response @return self
[ "Build", "a", "result", "object", "out", "of", "a", "standard", "neo4j", "rest", "api", "response" ]
train
https://github.com/Innmind/neo4j-dbal/blob/12cb71e698cc0f4d55b7f2eb40f7b353c778a20b/src/Result/Result.php#L38-L47
Innmind/neo4j-dbal
src/Result/Result.php
Result.buildNodes
private static function buildNodes(array $data): MapInterface { $nodes = new Map('int', Node::class); foreach ($data as $response) { foreach ($response['graph']['nodes'] as $node) { $labels = Set::of('string', ...\array_values($node['labels'])); $nodes =...
php
private static function buildNodes(array $data): MapInterface { $nodes = new Map('int', Node::class); foreach ($data as $response) { foreach ($response['graph']['nodes'] as $node) { $labels = Set::of('string', ...\array_values($node['labels'])); $nodes =...
[ "private", "static", "function", "buildNodes", "(", "array", "$", "data", ")", ":", "MapInterface", "{", "$", "nodes", "=", "new", "Map", "(", "'int'", ",", "Node", "::", "class", ")", ";", "foreach", "(", "$", "data", "as", "$", "response", ")", "{"...
@param array $data @return MapInterface<int, Node>
[ "@param", "array", "$data" ]
train
https://github.com/Innmind/neo4j-dbal/blob/12cb71e698cc0f4d55b7f2eb40f7b353c778a20b/src/Result/Result.php#L78-L98
Innmind/neo4j-dbal
src/Result/Result.php
Result.buildRelationships
private static function buildRelationships(array $data): MapInterface { $relationships = new Map('int', Relationship::class); foreach ($data as $response) { foreach ($response['graph']['relationships'] as $rel) { $relationships = $relationships->put( ...
php
private static function buildRelationships(array $data): MapInterface { $relationships = new Map('int', Relationship::class); foreach ($data as $response) { foreach ($response['graph']['relationships'] as $rel) { $relationships = $relationships->put( ...
[ "private", "static", "function", "buildRelationships", "(", "array", "$", "data", ")", ":", "MapInterface", "{", "$", "relationships", "=", "new", "Map", "(", "'int'", ",", "Relationship", "::", "class", ")", ";", "foreach", "(", "$", "data", "as", "$", ...
@param array $data @return MapInterface<int, Relationship>
[ "@param", "array", "$data" ]
train
https://github.com/Innmind/neo4j-dbal/blob/12cb71e698cc0f4d55b7f2eb40f7b353c778a20b/src/Result/Result.php#L105-L125
Innmind/neo4j-dbal
src/Result/Result.php
Result.buildRows
private static function buildRows(array $data): StreamInterface { $rows = new Stream(Row::class); $responses = $data['data'] ?? []; foreach ($responses as $response) { foreach ($response['row'] as $idx => $row) { $rows = $rows->add(new Row\Row( ...
php
private static function buildRows(array $data): StreamInterface { $rows = new Stream(Row::class); $responses = $data['data'] ?? []; foreach ($responses as $response) { foreach ($response['row'] as $idx => $row) { $rows = $rows->add(new Row\Row( ...
[ "private", "static", "function", "buildRows", "(", "array", "$", "data", ")", ":", "StreamInterface", "{", "$", "rows", "=", "new", "Stream", "(", "Row", "::", "class", ")", ";", "$", "responses", "=", "$", "data", "[", "'data'", "]", "??", "[", "]",...
@param array $data @return StreamInterface<Row>
[ "@param", "array", "$data" ]
train
https://github.com/Innmind/neo4j-dbal/blob/12cb71e698cc0f4d55b7f2eb40f7b353c778a20b/src/Result/Result.php#L132-L147