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
shabbyrobe/amiss
src/Sql/Manager.php
Manager.updateTable
public function updateTable($meta, ...$args) { $meta = !$meta instanceof Meta ? $this->mapper->getMeta($meta) : $meta; if (!$meta->canUpdate) { throw new Exception("Meta {$meta->id} prohibits update"); } $query = Query\Update::fromParamArgs($args); if (!$query->s...
php
public function updateTable($meta, ...$args) { $meta = !$meta instanceof Meta ? $this->mapper->getMeta($meta) : $meta; if (!$meta->canUpdate) { throw new Exception("Meta {$meta->id} prohibits update"); } $query = Query\Update::fromParamArgs($args); if (!$query->s...
[ "public", "function", "updateTable", "(", "$", "meta", ",", "...", "$", "args", ")", "{", "$", "meta", "=", "!", "$", "meta", "instanceof", "Meta", "?", "$", "this", "->", "mapper", "->", "getMeta", "(", "$", "meta", ")", ":", "$", "meta", ";", "...
Update a table by criteria. updateTable ( $meta , array $values , $criteria... ) updateTable ( $meta , Query\Update $query , $criteria... ) @return void
[ "Update", "a", "table", "by", "criteria", "." ]
train
https://github.com/shabbyrobe/amiss/blob/ba261f0d1f985ed36e9fd2903ac0df86c5b9498d/src/Sql/Manager.php#L644-L665
shabbyrobe/amiss
src/Sql/Manager.php
Manager.update
public function update($object, $meta=null) { $query = new Query\Update(); if (!is_object($object)) { throw new \BadMethodCallException("Please use updateTable()"); } if ($meta) { $meta = !$meta instanceof Meta ? $this->mapper->getMeta($meta) : $meta; ...
php
public function update($object, $meta=null) { $query = new Query\Update(); if (!is_object($object)) { throw new \BadMethodCallException("Please use updateTable()"); } if ($meta) { $meta = !$meta instanceof Meta ? $this->mapper->getMeta($meta) : $meta; ...
[ "public", "function", "update", "(", "$", "object", ",", "$", "meta", "=", "null", ")", "{", "$", "query", "=", "new", "Query", "\\", "Update", "(", ")", ";", "if", "(", "!", "is_object", "(", "$", "object", ")", ")", "{", "throw", "new", "\\", ...
Update an object in the database, or update a table by criteria. update ( $object ) update ( $object , $meta ) @return void
[ "Update", "an", "object", "in", "the", "database", "or", "update", "a", "table", "by", "criteria", "." ]
train
https://github.com/shabbyrobe/amiss/blob/ba261f0d1f985ed36e9fd2903ac0df86c5b9498d/src/Sql/Manager.php#L675-L724
shabbyrobe/amiss
src/Sql/Manager.php
Manager.deleteTable
public function deleteTable($meta, ...$args) { if (!isset($args[0])) { throw new \InvalidArgumentException("Cannot delete from table without a condition (pass the string '1=1' if you really meant to do this)"); } $meta = !$meta instanceof Meta ? $this->mapper->getMeta($meta) : $m...
php
public function deleteTable($meta, ...$args) { if (!isset($args[0])) { throw new \InvalidArgumentException("Cannot delete from table without a condition (pass the string '1=1' if you really meant to do this)"); } $meta = !$meta instanceof Meta ? $this->mapper->getMeta($meta) : $m...
[ "public", "function", "deleteTable", "(", "$", "meta", ",", "...", "$", "args", ")", "{", "if", "(", "!", "isset", "(", "$", "args", "[", "0", "]", ")", ")", "{", "throw", "new", "\\", "InvalidArgumentException", "(", "\"Cannot delete from table without a ...
Delete from a table by criteria deleteTable ( $meta , $criteria... ); @return void
[ "Delete", "from", "a", "table", "by", "criteria" ]
train
https://github.com/shabbyrobe/amiss/blob/ba261f0d1f985ed36e9fd2903ac0df86c5b9498d/src/Sql/Manager.php#L733-L744
shabbyrobe/amiss
src/Sql/Manager.php
Manager.delete
public function delete($object, $meta=null) { $query = new Query\Criteria(); if (!is_object($object)) { throw new \BadMethodCallException("Please use deleteTable()"); } if ($meta) { $meta = !$meta instanceof Meta ? $this->mapper->getMeta($meta) : $meta; ...
php
public function delete($object, $meta=null) { $query = new Query\Criteria(); if (!is_object($object)) { throw new \BadMethodCallException("Please use deleteTable()"); } if ($meta) { $meta = !$meta instanceof Meta ? $this->mapper->getMeta($meta) : $meta; ...
[ "public", "function", "delete", "(", "$", "object", ",", "$", "meta", "=", "null", ")", "{", "$", "query", "=", "new", "Query", "\\", "Criteria", "(", ")", ";", "if", "(", "!", "is_object", "(", "$", "object", ")", ")", "{", "throw", "new", "\\",...
Delete an object from the database delete ( $object ) delete ( $object, $meta ) @return void
[ "Delete", "an", "object", "from", "the", "database" ]
train
https://github.com/shabbyrobe/amiss/blob/ba261f0d1f985ed36e9fd2903ac0df86c5b9498d/src/Sql/Manager.php#L754-L794
shabbyrobe/amiss
src/Sql/Manager.php
Manager.save
public function save($object, $meta=null) { if ($meta) { $meta = !$meta instanceof Meta ? $this->mapper->getMeta($meta) : $meta; } else { $meta = $this->mapper->getMeta(get_class($object)); } if (!$meta->primary) { throw new Exception("No primary ...
php
public function save($object, $meta=null) { if ($meta) { $meta = !$meta instanceof Meta ? $this->mapper->getMeta($meta) : $meta; } else { $meta = $this->mapper->getMeta(get_class($object)); } if (!$meta->primary) { throw new Exception("No primary ...
[ "public", "function", "save", "(", "$", "object", ",", "$", "meta", "=", "null", ")", "{", "if", "(", "$", "meta", ")", "{", "$", "meta", "=", "!", "$", "meta", "instanceof", "Meta", "?", "$", "this", "->", "mapper", "->", "getMeta", "(", "$", ...
If an object has an autoincrement primary key, insert or update as necessary. @return void
[ "If", "an", "object", "has", "an", "autoincrement", "primary", "key", "insert", "or", "update", "as", "necessary", "." ]
train
https://github.com/shabbyrobe/amiss/blob/ba261f0d1f985ed36e9fd2903ac0df86c5b9498d/src/Sql/Manager.php#L809-L858
shabbyrobe/amiss
src/Sql/Manager.php
Manager.createKeyCriteria
public function createKeyCriteria($meta, $id, $indexId=null) { if ($indexId == null) { $indexId = 'primary'; } $meta = !$meta instanceof Meta ? $this->mapper->getMeta($meta) : $meta; if (!isset($meta->indexes[$indexId])) { throw new Exception("Index $indexId d...
php
public function createKeyCriteria($meta, $id, $indexId=null) { if ($indexId == null) { $indexId = 'primary'; } $meta = !$meta instanceof Meta ? $this->mapper->getMeta($meta) : $meta; if (!isset($meta->indexes[$indexId])) { throw new Exception("Index $indexId d...
[ "public", "function", "createKeyCriteria", "(", "$", "meta", ",", "$", "id", ",", "$", "indexId", "=", "null", ")", "{", "if", "(", "$", "indexId", "==", "null", ")", "{", "$", "indexId", "=", "'primary'", ";", "}", "$", "meta", "=", "!", "$", "m...
Creates an array criteria for a key index @param mixed $meta Meta or class name @return array Criteria
[ "Creates", "an", "array", "criteria", "for", "a", "key", "index" ]
train
https://github.com/shabbyrobe/amiss/blob/ba261f0d1f985ed36e9fd2903ac0df86c5b9498d/src/Sql/Manager.php#L865-L892
shabbyrobe/amiss
src/Sql/Manager.php
Manager.getChildren
public function getChildren(...$args) { if (!$this->filter) { $this->filter = new \Amiss\Filter($this->mapper); } return $this->filter->getChildren(...$args); }
php
public function getChildren(...$args) { if (!$this->filter) { $this->filter = new \Amiss\Filter($this->mapper); } return $this->filter->getChildren(...$args); }
[ "public", "function", "getChildren", "(", "...", "$", "args", ")", "{", "if", "(", "!", "$", "this", "->", "filter", ")", "{", "$", "this", "->", "filter", "=", "new", "\\", "Amiss", "\\", "Filter", "(", "$", "this", "->", "mapper", ")", ";", "}"...
/*{{{ Amiss\Filter methods
[ "/", "*", "{{{", "Amiss", "\\", "Filter", "methods" ]
train
https://github.com/shabbyrobe/amiss/blob/ba261f0d1f985ed36e9fd2903ac0df86c5b9498d/src/Sql/Manager.php#L913-L919
spiral-modules/listing
source/Listing/Sorters/UnarySorter.php
UnarySorter.apply
public function apply($selector) { $this->validateSelector($selector); if ($selector instanceof RecordSelector) { $selector = $this->loadDependencies($selector); foreach ($this->sortBy as $expression => $direction) { $selector = $selector->orderBy( ...
php
public function apply($selector) { $this->validateSelector($selector); if ($selector instanceof RecordSelector) { $selector = $this->loadDependencies($selector); foreach ($this->sortBy as $expression => $direction) { $selector = $selector->orderBy( ...
[ "public", "function", "apply", "(", "$", "selector", ")", "{", "$", "this", "->", "validateSelector", "(", "$", "selector", ")", ";", "if", "(", "$", "selector", "instanceof", "RecordSelector", ")", "{", "$", "selector", "=", "$", "this", "->", "loadDepe...
{@inheritdoc}
[ "{" ]
train
https://github.com/spiral-modules/listing/blob/89abe8939ce91cbf61b51b99e93ce1e57c8af83c/source/Listing/Sorters/UnarySorter.php#L45-L63
FriendsOfApi/phraseapp
src/Model/Locale/Uploaded.php
Uploaded.createFromArray
public static function createFromArray(array $data) { $self = new self(); if (isset($data['id'])) { $self->setId($data['id']); } if (isset($data['filename'])) { $self->setFilename($data['filename']); } if (isset($data['format'])) { ...
php
public static function createFromArray(array $data) { $self = new self(); if (isset($data['id'])) { $self->setId($data['id']); } if (isset($data['filename'])) { $self->setFilename($data['filename']); } if (isset($data['format'])) { ...
[ "public", "static", "function", "createFromArray", "(", "array", "$", "data", ")", "{", "$", "self", "=", "new", "self", "(", ")", ";", "if", "(", "isset", "(", "$", "data", "[", "'id'", "]", ")", ")", "{", "$", "self", "->", "setId", "(", "$", ...
@param array $data @return Uploaded
[ "@param", "array", "$data" ]
train
https://github.com/FriendsOfApi/phraseapp/blob/1553bf857eb0858f9a7eb905b085864d24f80886/src/Model/Locale/Uploaded.php#L48-L69
getuisdk/getui-php-sdk
src/PBInputStringReader.php
PBInputStringReader.next
public function next($is_string = false) { $package = ''; while (true) { if ($this->pointer >= $this->length) { return false; } $string = $this->string[$this->pointer]; $this->pointer++; if ($is_string === true)...
php
public function next($is_string = false) { $package = ''; while (true) { if ($this->pointer >= $this->length) { return false; } $string = $this->string[$this->pointer]; $this->pointer++; if ($is_string === true)...
[ "public", "function", "next", "(", "$", "is_string", "=", "false", ")", "{", "$", "package", "=", "''", ";", "while", "(", "true", ")", "{", "if", "(", "$", "this", "->", "pointer", ">=", "$", "this", "->", "length", ")", "{", "return", "false", ...
get the next @param boolean $is_string - if set to true only one byte is read @return mixed
[ "get", "the", "next" ]
train
https://github.com/getuisdk/getui-php-sdk/blob/e91773b099bcbfd7492a44086b373d1c9fee37e2/src/PBInputStringReader.php#L30-L57
sinri/Ark-Core
src/ArkHelper.php
ArkHelper.registerAutoload
public static function registerAutoload($base_namespace, $base_path, $extension = '.php') { spl_autoload_register(function ($class_name) use ($base_namespace, $base_path, $extension) { $file_path = self::getFilePathForClassName( $class_name, $base_namespace, ...
php
public static function registerAutoload($base_namespace, $base_path, $extension = '.php') { spl_autoload_register(function ($class_name) use ($base_namespace, $base_path, $extension) { $file_path = self::getFilePathForClassName( $class_name, $base_namespace, ...
[ "public", "static", "function", "registerAutoload", "(", "$", "base_namespace", ",", "$", "base_path", ",", "$", "extension", "=", "'.php'", ")", "{", "spl_autoload_register", "(", "function", "(", "$", "class_name", ")", "use", "(", "$", "base_namespace", ","...
For Autoload File @param string $base_namespace such as sinri\enoch @param string $base_path /code/sinri/enoch @param string $extension
[ "For", "Autoload", "File" ]
train
https://github.com/sinri/Ark-Core/blob/fb5715e72b500ddc08dd52d9701d713fe49f48c6/src/ArkHelper.php#L39-L53
sinri/Ark-Core
src/ArkHelper.php
ArkHelper.removeFromArray
public static function removeFromArray(&$array, $keychain) { if (!is_array($array)) { $array = []; } if (!is_array($keychain)) { $keychain = [$keychain]; } $headKey = array_shift($keychain); if (empty($keychain)) { //last ...
php
public static function removeFromArray(&$array, $keychain) { if (!is_array($array)) { $array = []; } if (!is_array($keychain)) { $keychain = [$keychain]; } $headKey = array_shift($keychain); if (empty($keychain)) { //last ...
[ "public", "static", "function", "removeFromArray", "(", "&", "$", "array", ",", "$", "keychain", ")", "{", "if", "(", "!", "is_array", "(", "$", "array", ")", ")", "{", "$", "array", "=", "[", "]", ";", "}", "if", "(", "!", "is_array", "(", "$", ...
Unset item and nested item in array @since 1.2 @param array $array @param array|string|int $keychain
[ "Unset", "item", "and", "nested", "item", "in", "array" ]
train
https://github.com/sinri/Ark-Core/blob/fb5715e72b500ddc08dd52d9701d713fe49f48c6/src/ArkHelper.php#L154-L173
frdl/webfan
.ApplicationComposer/lib/frdl/ApplicationComposer/ApplicationComposerBootstrap.php
ApplicationComposerBootstrap.wd
public function wd($dir = null, $code = E_USER_WARNING){ if(null !== $dir && is_dir($dir)){ $this->wd = $dir; if(chdir($dir) === false){ throw new \Exception('Cannot change to directory '.$dir.' in '.__METHOD__, $code); return $this; } }else{ $dir = $this->wd; } return $this; }
php
public function wd($dir = null, $code = E_USER_WARNING){ if(null !== $dir && is_dir($dir)){ $this->wd = $dir; if(chdir($dir) === false){ throw new \Exception('Cannot change to directory '.$dir.' in '.__METHOD__, $code); return $this; } }else{ $dir = $this->wd; } return $this; }
[ "public", "function", "wd", "(", "$", "dir", "=", "null", ",", "$", "code", "=", "E_USER_WARNING", ")", "{", "if", "(", "null", "!==", "$", "dir", "&&", "is_dir", "(", "$", "dir", ")", ")", "{", "$", "this", "->", "wd", "=", "$", "dir", ";", ...
set working directory
[ "set", "working", "directory" ]
train
https://github.com/frdl/webfan/blob/84d270377685224e891cd9d571b103b36f05b845/.ApplicationComposer/lib/frdl/ApplicationComposer/ApplicationComposerBootstrap.php#L67-L78
unclecheese/silverstripe-bootstrap-tagfield
code/BootstrapTagField.php
BootstrapTagField.formatJSON
protected function formatJSON(SS_List $list) { $ret = array (); foreach($list as $item) { $ret[] = array( 'id' => $item->{$this->idField}, 'label' => $item->{$this->labelField} ); } return Convert::array2json($ret); }
php
protected function formatJSON(SS_List $list) { $ret = array (); foreach($list as $item) { $ret[] = array( 'id' => $item->{$this->idField}, 'label' => $item->{$this->labelField} ); } return Convert::array2json($ret); }
[ "protected", "function", "formatJSON", "(", "SS_List", "$", "list", ")", "{", "$", "ret", "=", "array", "(", ")", ";", "foreach", "(", "$", "list", "as", "$", "item", ")", "{", "$", "ret", "[", "]", "=", "array", "(", "'id'", "=>", "$", "item", ...
Formats JSON so that it is usable by the JS component @param SS_List $list The list to format @return string JSON
[ "Formats", "JSON", "so", "that", "it", "is", "usable", "by", "the", "JS", "component" ]
train
https://github.com/unclecheese/silverstripe-bootstrap-tagfield/blob/ada0c647f90ccb753d26a5d01889b2b4fbe2af76/code/BootstrapTagField.php#L80-L90
unclecheese/silverstripe-bootstrap-tagfield
code/BootstrapTagField.php
BootstrapTagField.query
public function query(SS_HTTPRequest $r) { return $this->formatJSON($this->source->filter(array( $this->labelField.':PartialMatch' => $r->getVar('q') )) ->limit(10)); }
php
public function query(SS_HTTPRequest $r) { return $this->formatJSON($this->source->filter(array( $this->labelField.':PartialMatch' => $r->getVar('q') )) ->limit(10)); }
[ "public", "function", "query", "(", "SS_HTTPRequest", "$", "r", ")", "{", "return", "$", "this", "->", "formatJSON", "(", "$", "this", "->", "source", "->", "filter", "(", "array", "(", "$", "this", "->", "labelField", ".", "':PartialMatch'", "=>", "$", ...
An AJAX endpoint for querying the typeahead @param SS_HTTPRequest $r The request @return string JSON
[ "An", "AJAX", "endpoint", "for", "querying", "the", "typeahead" ]
train
https://github.com/unclecheese/silverstripe-bootstrap-tagfield/blob/ada0c647f90ccb753d26a5d01889b2b4fbe2af76/code/BootstrapTagField.php#L98-L103
unclecheese/silverstripe-bootstrap-tagfield
code/BootstrapTagField.php
BootstrapTagField.getValuesJSON
protected function getValuesJSON() { $value = $this->value; if($value instanceof SS_List) { $values = $value->column($this->idField); } else if(is_array($value)) { $values = array_keys($value); } else if(is_string($value)) { $values = explode(',', $value); $values = str_replace('{comma}', ',', $...
php
protected function getValuesJSON() { $value = $this->value; if($value instanceof SS_List) { $values = $value->column($this->idField); } else if(is_array($value)) { $values = array_keys($value); } else if(is_string($value)) { $values = explode(',', $value); $values = str_replace('{comma}', ',', $...
[ "protected", "function", "getValuesJSON", "(", ")", "{", "$", "value", "=", "$", "this", "->", "value", ";", "if", "(", "$", "value", "instanceof", "SS_List", ")", "{", "$", "values", "=", "$", "value", "->", "column", "(", "$", "this", "->", "idFiel...
Gets the current values assigned to the field, formatted as a JSON array @return string JSON
[ "Gets", "the", "current", "values", "assigned", "to", "the", "field", "formatted", "as", "a", "JSON", "array" ]
train
https://github.com/unclecheese/silverstripe-bootstrap-tagfield/blob/ada0c647f90ccb753d26a5d01889b2b4fbe2af76/code/BootstrapTagField.php#L122-L138
unclecheese/silverstripe-bootstrap-tagfield
code/BootstrapTagField.php
BootstrapTagField.setPrefetch
public function setPrefetch(SS_List $list) { if(!$list instanceof SS_List) { throw new Exception('Prefetch list must be an instance of SS_List'); } $this->prefetch = $list; return $this; }
php
public function setPrefetch(SS_List $list) { if(!$list instanceof SS_List) { throw new Exception('Prefetch list must be an instance of SS_List'); } $this->prefetch = $list; return $this; }
[ "public", "function", "setPrefetch", "(", "SS_List", "$", "list", ")", "{", "if", "(", "!", "$", "list", "instanceof", "SS_List", ")", "{", "throw", "new", "Exception", "(", "'Prefetch list must be an instance of SS_List'", ")", ";", "}", "$", "this", "->", ...
Sets the prefetch records list @param SS_List $list @return BootstrapTagField
[ "Sets", "the", "prefetch", "records", "list" ]
train
https://github.com/unclecheese/silverstripe-bootstrap-tagfield/blob/ada0c647f90ccb753d26a5d01889b2b4fbe2af76/code/BootstrapTagField.php#L146-L154
unclecheese/silverstripe-bootstrap-tagfield
code/BootstrapTagField.php
BootstrapTagField.saveInto
public function saveInto(DataObjectInterface $record) { $fieldname = $this->name; $relation = ($fieldname && $record && $record->hasMethod($fieldname)) ? $record->$fieldname() : null; if($fieldname && $record && $relation && ($relation instanceof RelationList || $relation instanceof UnsavedRelationList)) { ...
php
public function saveInto(DataObjectInterface $record) { $fieldname = $this->name; $relation = ($fieldname && $record && $record->hasMethod($fieldname)) ? $record->$fieldname() : null; if($fieldname && $record && $relation && ($relation instanceof RelationList || $relation instanceof UnsavedRelationList)) { ...
[ "public", "function", "saveInto", "(", "DataObjectInterface", "$", "record", ")", "{", "$", "fieldname", "=", "$", "this", "->", "name", ";", "$", "relation", "=", "(", "$", "fieldname", "&&", "$", "record", "&&", "$", "record", "->", "hasMethod", "(", ...
Save the current value into a DataObject. If the field it is saving to is a has_many or many_many relationship, it is saved by setByIDList(), otherwise it creates a comma separated list for a standard DB text/varchar field. @param DataObject $record The record to save into
[ "Save", "the", "current", "value", "into", "a", "DataObject", ".", "If", "the", "field", "it", "is", "saving", "to", "is", "a", "has_many", "or", "many_many", "relationship", "it", "is", "saved", "by", "setByIDList", "()", "otherwise", "it", "creates", "a"...
train
https://github.com/unclecheese/silverstripe-bootstrap-tagfield/blob/ada0c647f90ccb753d26a5d01889b2b4fbe2af76/code/BootstrapTagField.php#L220-L244
unclecheese/silverstripe-bootstrap-tagfield
code/BootstrapTagField.php
BootstrapTagField.Field
public function Field($properties = array()) { Requirements::javascript(BOOTSTRAP_TAGFIELD_DIR.'/javascript/typeahead.js'); Requirements::javascript(BOOTSTRAP_TAGFIELD_DIR.'/javascript/bootstrap-tagfield.js'); Requirements::javascript(BOOTSTRAP_TAGFIELD_DIR.'/javascript/bootstrap-tagfield-init.js'); Requirement...
php
public function Field($properties = array()) { Requirements::javascript(BOOTSTRAP_TAGFIELD_DIR.'/javascript/typeahead.js'); Requirements::javascript(BOOTSTRAP_TAGFIELD_DIR.'/javascript/bootstrap-tagfield.js'); Requirements::javascript(BOOTSTRAP_TAGFIELD_DIR.'/javascript/bootstrap-tagfield-init.js'); Requirement...
[ "public", "function", "Field", "(", "$", "properties", "=", "array", "(", ")", ")", "{", "Requirements", "::", "javascript", "(", "BOOTSTRAP_TAGFIELD_DIR", ".", "'/javascript/typeahead.js'", ")", ";", "Requirements", "::", "javascript", "(", "BOOTSTRAP_TAGFIELD_DIR"...
Renders the field @param array $properties @return SSViewer
[ "Renders", "the", "field" ]
train
https://github.com/unclecheese/silverstripe-bootstrap-tagfield/blob/ada0c647f90ccb753d26a5d01889b2b4fbe2af76/code/BootstrapTagField.php#L252-L268
DesignPond/newsletter
src/Newsletter/Worker/MailjetService.php
MailjetService.getListRecipient
public function getListRecipient($email) { $this->hasList(); $ContactID = $this->getContactByEmail($email); $response = $this->mailjet->get(Resources::$Listrecipient, ['filters' => ['Contact' => $ContactID, "ContactsList" => $this->list]]); if($response->success()){ $...
php
public function getListRecipient($email) { $this->hasList(); $ContactID = $this->getContactByEmail($email); $response = $this->mailjet->get(Resources::$Listrecipient, ['filters' => ['Contact' => $ContactID, "ContactsList" => $this->list]]); if($response->success()){ $...
[ "public", "function", "getListRecipient", "(", "$", "email", ")", "{", "$", "this", "->", "hasList", "(", ")", ";", "$", "ContactID", "=", "$", "this", "->", "getContactByEmail", "(", "$", "email", ")", ";", "$", "response", "=", "$", "this", "->", "...
Lists
[ "Lists" ]
train
https://github.com/DesignPond/newsletter/blob/0bf0e7a8a42fa4b90a5e937771bb80058e0a91c3/src/Newsletter/Worker/MailjetService.php#L140-L154
DesignPond/newsletter
src/Newsletter/Worker/MailjetService.php
MailjetService.getCampagne
public function getCampagne($CampaignID) { $response = $this->mailjet->get(Resources::$Newsletter, ['ID' => $CampaignID]); if($response->success()) return $response->getData(); else return false; }
php
public function getCampagne($CampaignID) { $response = $this->mailjet->get(Resources::$Newsletter, ['ID' => $CampaignID]); if($response->success()) return $response->getData(); else return false; }
[ "public", "function", "getCampagne", "(", "$", "CampaignID", ")", "{", "$", "response", "=", "$", "this", "->", "mailjet", "->", "get", "(", "Resources", "::", "$", "Newsletter", ",", "[", "'ID'", "=>", "$", "CampaignID", "]", ")", ";", "if", "(", "$...
Campagnes
[ "Campagnes" ]
train
https://github.com/DesignPond/newsletter/blob/0bf0e7a8a42fa4b90a5e937771bb80058e0a91c3/src/Newsletter/Worker/MailjetService.php#L159-L167
DesignPond/newsletter
src/Newsletter/Worker/MailjetService.php
MailjetService.statsCampagne
public function statsCampagne($id) { $response = $this->mailjet->get(Resources::$Campaignstatistics, ['ID' => 'mj.nl='.$id]); if($response->success()){ $stats = $response->getData(); return $stats[0]; // returns ID directly } return false; }
php
public function statsCampagne($id) { $response = $this->mailjet->get(Resources::$Campaignstatistics, ['ID' => 'mj.nl='.$id]); if($response->success()){ $stats = $response->getData(); return $stats[0]; // returns ID directly } return false; }
[ "public", "function", "statsCampagne", "(", "$", "id", ")", "{", "$", "response", "=", "$", "this", "->", "mailjet", "->", "get", "(", "Resources", "::", "$", "Campaignstatistics", ",", "[", "'ID'", "=>", "'mj.nl='", ".", "$", "id", "]", ")", ";", "i...
Statistiques
[ "Statistiques" ]
train
https://github.com/DesignPond/newsletter/blob/0bf0e7a8a42fa4b90a5e937771bb80058e0a91c3/src/Newsletter/Worker/MailjetService.php#L277-L287
DesignPond/newsletter
src/Newsletter/Worker/MailjetService.php
MailjetService.uploadCSVContactslistData
public function uploadCSVContactslistData($CSVContent) { $this->hasList(); $response = $this->mailjet->post(Resources::$ContactslistCsvdata, ['body' => $CSVContent, 'id' => $this->list]); if($response->success()){ $import = $response->getData(); return $import['ID']...
php
public function uploadCSVContactslistData($CSVContent) { $this->hasList(); $response = $this->mailjet->post(Resources::$ContactslistCsvdata, ['body' => $CSVContent, 'id' => $this->list]); if($response->success()){ $import = $response->getData(); return $import['ID']...
[ "public", "function", "uploadCSVContactslistData", "(", "$", "CSVContent", ")", "{", "$", "this", "->", "hasList", "(", ")", ";", "$", "response", "=", "$", "this", "->", "mailjet", "->", "post", "(", "Resources", "::", "$", "ContactslistCsvdata", ",", "["...
import listes
[ "import", "listes" ]
train
https://github.com/DesignPond/newsletter/blob/0bf0e7a8a42fa4b90a5e937771bb80058e0a91c3/src/Newsletter/Worker/MailjetService.php#L304-L316
alevilar/ristorantino-vendor
Printers/Utility/AfipWsv1.php
AfipWsv1.__createTRA
static function __createTRA($SERVICE = 'wsfe') { $TRA = new SimpleXMLElement( '<?xml version="1.0" encoding="UTF-8"?>' . '<loginTicketRequest version="1.0">'. '</loginTicketRequest>'); $TRA->addChild('header'); $TRA->header->addChild('uniqueId',date('U')); $TRA->header->addChild('generationT...
php
static function __createTRA($SERVICE = 'wsfe') { $TRA = new SimpleXMLElement( '<?xml version="1.0" encoding="UTF-8"?>' . '<loginTicketRequest version="1.0">'. '</loginTicketRequest>'); $TRA->addChild('header'); $TRA->header->addChild('uniqueId',date('U')); $TRA->header->addChild('generationT...
[ "static", "function", "__createTRA", "(", "$", "SERVICE", "=", "'wsfe'", ")", "{", "$", "TRA", "=", "new", "SimpleXMLElement", "(", "'<?xml version=\"1.0\" encoding=\"UTF-8\"?>'", ".", "'<loginTicketRequest version=\"1.0\">'", ".", "'</loginTicketRequest>'", ")", ";", "...
#==============================================================================
[ "#", "==============================================================================" ]
train
https://github.com/alevilar/ristorantino-vendor/blob/6b91a1e20cc0ba09a1968d77e3de6512cfa2d966/Printers/Utility/AfipWsv1.php#L454-L466
alevilar/ristorantino-vendor
Printers/Utility/AfipWsv1.php
AfipWsv1.__signTRA
static function __signTRA() { $STATUS=openssl_pkcs7_sign(TMP . "TRA.xml", TMP . "TRA.tmp", "file://".CERT, array("file://".PRIVATEKEY, PASSPHRASE), array(), !PKCS7_DETACHED ); if (!$STATUS) { throw new AfipWsException("ERROR generating PKCS#7 signature"); } $inf=fopen(TMP . "T...
php
static function __signTRA() { $STATUS=openssl_pkcs7_sign(TMP . "TRA.xml", TMP . "TRA.tmp", "file://".CERT, array("file://".PRIVATEKEY, PASSPHRASE), array(), !PKCS7_DETACHED ); if (!$STATUS) { throw new AfipWsException("ERROR generating PKCS#7 signature"); } $inf=fopen(TMP . "T...
[ "static", "function", "__signTRA", "(", ")", "{", "$", "STATUS", "=", "openssl_pkcs7_sign", "(", "TMP", ".", "\"TRA.xml\"", ",", "TMP", ".", "\"TRA.tmp\"", ",", "\"file://\"", ".", "CERT", ",", "array", "(", "\"file://\"", ".", "PRIVATEKEY", ",", "PASSPHRASE...
# MIME heading leaving the final CMS required by WSAA.
[ "#", "MIME", "heading", "leaving", "the", "final", "CMS", "required", "by", "WSAA", "." ]
train
https://github.com/alevilar/ristorantino-vendor/blob/6b91a1e20cc0ba09a1968d77e3de6512cfa2d966/Printers/Utility/AfipWsv1.php#L471-L494
alevilar/ristorantino-vendor
Printers/Utility/AfipWsv1.php
AfipWsv1.FEParamGetTiposTributos
static function FEParamGetTiposTributos () { $res = self::$client->FEParamGetTiposTributos( array('Auth'=> self::$authVars)); self::__throwErrorIfExists($res, 'FEParamGetTiposTributosResult'); return $res; }
php
static function FEParamGetTiposTributos () { $res = self::$client->FEParamGetTiposTributos( array('Auth'=> self::$authVars)); self::__throwErrorIfExists($res, 'FEParamGetTiposTributosResult'); return $res; }
[ "static", "function", "FEParamGetTiposTributos", "(", ")", "{", "$", "res", "=", "self", "::", "$", "client", "->", "FEParamGetTiposTributos", "(", "array", "(", "'Auth'", "=>", "self", "::", "$", "authVars", ")", ")", ";", "self", "::", "__throwErrorIfExist...
Indica los Tipos de Tributos Nacionales, Provinciales, Municipales, Internos, etc etc EJ: array( (int) 0 => object(stdClass) { Id => (int) 1 Desc => 'Impuestos nacionales' FchDesde => '20100917' FchHasta => 'NULL' },
[ "Indica", "los", "Tipos", "de", "Tributos", "Nacionales", "Provinciales", "Municipales", "Internos", "etc", "etc", "EJ", ":", "array", "(", "(", "int", ")", "0", "=", ">", "object", "(", "stdClass", ")", "{", "Id", "=", ">", "(", "int", ")", "1", "De...
train
https://github.com/alevilar/ristorantino-vendor/blob/6b91a1e20cc0ba09a1968d77e3de6512cfa2d966/Printers/Utility/AfipWsv1.php#L596-L602
kbond/ControllerUtil
src/FlashRedirect.php
FlashRedirect.create
public static function create($route, array $parameters, $message, $type = self::DEFAULT_FLASH_KEY, $statusCode = self::DEFAULT_STATUS_CODE) { return new static($route, $parameters, array($type => array($message)), $statusCode); }
php
public static function create($route, array $parameters, $message, $type = self::DEFAULT_FLASH_KEY, $statusCode = self::DEFAULT_STATUS_CODE) { return new static($route, $parameters, array($type => array($message)), $statusCode); }
[ "public", "static", "function", "create", "(", "$", "route", ",", "array", "$", "parameters", ",", "$", "message", ",", "$", "type", "=", "self", "::", "DEFAULT_FLASH_KEY", ",", "$", "statusCode", "=", "self", "::", "DEFAULT_STATUS_CODE", ")", "{", "return...
@param string $route @param array $parameters @param string $message @param string $type @param int $statusCode @return static
[ "@param", "string", "$route", "@param", "array", "$parameters", "@param", "string", "$message", "@param", "string", "$type", "@param", "int", "$statusCode" ]
train
https://github.com/kbond/ControllerUtil/blob/67375d43c73d6a3f16356f3d683f62b176766e91/src/FlashRedirect.php#L21-L24
kbond/ControllerUtil
src/FlashRedirect.php
FlashRedirect.createSimple
public static function createSimple($route, $message, $type = self::DEFAULT_FLASH_KEY, $statusCode = self::DEFAULT_STATUS_CODE) { return new static($route, array(), array($type => array($message)), $statusCode); }
php
public static function createSimple($route, $message, $type = self::DEFAULT_FLASH_KEY, $statusCode = self::DEFAULT_STATUS_CODE) { return new static($route, array(), array($type => array($message)), $statusCode); }
[ "public", "static", "function", "createSimple", "(", "$", "route", ",", "$", "message", ",", "$", "type", "=", "self", "::", "DEFAULT_FLASH_KEY", ",", "$", "statusCode", "=", "self", "::", "DEFAULT_STATUS_CODE", ")", "{", "return", "new", "static", "(", "$...
@param string $route @param string $message @param string $type @param int $statusCode @return static
[ "@param", "string", "$route", "@param", "string", "$message", "@param", "string", "$type", "@param", "int", "$statusCode" ]
train
https://github.com/kbond/ControllerUtil/blob/67375d43c73d6a3f16356f3d683f62b176766e91/src/FlashRedirect.php#L34-L37
zicht/z
src/Zicht/Tool/Script/Compiler.php
Compiler.parse
public function parse($input) { if (strlen($input) == 0) { return null; } return $this->parser->parse(new TokenStream($this->tokenizer->getTokens($input))); }
php
public function parse($input) { if (strlen($input) == 0) { return null; } return $this->parser->parse(new TokenStream($this->tokenizer->getTokens($input))); }
[ "public", "function", "parse", "(", "$", "input", ")", "{", "if", "(", "strlen", "(", "$", "input", ")", "==", "0", ")", "{", "return", "null", ";", "}", "return", "$", "this", "->", "parser", "->", "parse", "(", "new", "TokenStream", "(", "$", "...
Parses the raw string input and returns the resulting root node. @param string $input @return Node
[ "Parses", "the", "raw", "string", "input", "and", "returns", "the", "resulting", "root", "node", "." ]
train
https://github.com/zicht/z/blob/6a1731dad20b018555a96b726a61d4bf8ec8c886/src/Zicht/Tool/Script/Compiler.php#L36-L42
zicht/z
src/Zicht/Tool/Script/Compiler.php
Compiler.compile
public function compile($input) { if (strlen($input) == 0) { return null; } try { $buffer = new Buffer(); $this->parse($input)->compile($buffer); $code = $buffer->getResult(); return $code; } catch (\UnexpectedValueException...
php
public function compile($input) { if (strlen($input) == 0) { return null; } try { $buffer = new Buffer(); $this->parse($input)->compile($buffer); $code = $buffer->getResult(); return $code; } catch (\UnexpectedValueException...
[ "public", "function", "compile", "(", "$", "input", ")", "{", "if", "(", "strlen", "(", "$", "input", ")", "==", "0", ")", "{", "return", "null", ";", "}", "try", "{", "$", "buffer", "=", "new", "Buffer", "(", ")", ";", "$", "this", "->", "pars...
Compile an input string to PHP code @param string $input @return string
[ "Compile", "an", "input", "string", "to", "PHP", "code" ]
train
https://github.com/zicht/z/blob/6a1731dad20b018555a96b726a61d4bf8ec8c886/src/Zicht/Tool/Script/Compiler.php#L50-L63
zhouyl/mellivora
Mellivora/Cache/PdoConnector.php
PdoConnector.getCacheAdapter
public function getCacheAdapter() { return $this->autoCreateTable(new PdoAdapter( $this->config['connection'], $this->config['namespace'], $this->config['lifetime'], $this->config['options'] )); }
php
public function getCacheAdapter() { return $this->autoCreateTable(new PdoAdapter( $this->config['connection'], $this->config['namespace'], $this->config['lifetime'], $this->config['options'] )); }
[ "public", "function", "getCacheAdapter", "(", ")", "{", "return", "$", "this", "->", "autoCreateTable", "(", "new", "PdoAdapter", "(", "$", "this", "->", "config", "[", "'connection'", "]", ",", "$", "this", "->", "config", "[", "'namespace'", "]", ",", ...
{@inheritdoc}
[ "{" ]
train
https://github.com/zhouyl/mellivora/blob/79f844c5c9c25ffbe18d142062e9bc3df00b36a1/Mellivora/Cache/PdoConnector.php#L40-L48
zhouyl/mellivora
Mellivora/Cache/PdoConnector.php
PdoConnector.getSimpleCacheAdapter
public function getSimpleCacheAdapter() { return $this->autoCreateTable(new PdoCache( $this->config['connection'], $this->config['namespace'], $this->config['lifetime'], $this->config['options'] )); }
php
public function getSimpleCacheAdapter() { return $this->autoCreateTable(new PdoCache( $this->config['connection'], $this->config['namespace'], $this->config['lifetime'], $this->config['options'] )); }
[ "public", "function", "getSimpleCacheAdapter", "(", ")", "{", "return", "$", "this", "->", "autoCreateTable", "(", "new", "PdoCache", "(", "$", "this", "->", "config", "[", "'connection'", "]", ",", "$", "this", "->", "config", "[", "'namespace'", "]", ","...
{@inheritdoc}
[ "{" ]
train
https://github.com/zhouyl/mellivora/blob/79f844c5c9c25ffbe18d142062e9bc3df00b36a1/Mellivora/Cache/PdoConnector.php#L53-L61
zhouyl/mellivora
Mellivora/Cache/PdoConnector.php
PdoConnector.autoCreateTable
protected function autoCreateTable($cache) { $lockfile = sys_get_temp_dir() . '/mellivora-cache-pdo.lock'; if (!is_file($lockfile)) { try { $cache->createTable(); } catch (\PDOException $e) { } finally { @file_put_contents($lockfil...
php
protected function autoCreateTable($cache) { $lockfile = sys_get_temp_dir() . '/mellivora-cache-pdo.lock'; if (!is_file($lockfile)) { try { $cache->createTable(); } catch (\PDOException $e) { } finally { @file_put_contents($lockfil...
[ "protected", "function", "autoCreateTable", "(", "$", "cache", ")", "{", "$", "lockfile", "=", "sys_get_temp_dir", "(", ")", ".", "'/mellivora-cache-pdo.lock'", ";", "if", "(", "!", "is_file", "(", "$", "lockfile", ")", ")", "{", "try", "{", "$", "cache", ...
自动创建数据表 @param object $cache @return object
[ "自动创建数据表" ]
train
https://github.com/zhouyl/mellivora/blob/79f844c5c9c25ffbe18d142062e9bc3df00b36a1/Mellivora/Cache/PdoConnector.php#L70-L84
FrenzelGmbH/cm-address
models/CountrySearch.php
CountrySearch.search
public function search($params) { $query = Country::find()->active(); $dataProvider = new ActiveDataProvider([ 'query' => $query, ]); if (!($this->load($params) && $this->validate())) { return $dataProvider; } $query->andFilterWhere([ ...
php
public function search($params) { $query = Country::find()->active(); $dataProvider = new ActiveDataProvider([ 'query' => $query, ]); if (!($this->load($params) && $this->validate())) { return $dataProvider; } $query->andFilterWhere([ ...
[ "public", "function", "search", "(", "$", "params", ")", "{", "$", "query", "=", "Country", "::", "find", "(", ")", "->", "active", "(", ")", ";", "$", "dataProvider", "=", "new", "ActiveDataProvider", "(", "[", "'query'", "=>", "$", "query", ",", "]...
[search description] @param array $params [description] @param string $module [description] @param integer $id [description] @return [type] [description]
[ "[", "search", "description", "]" ]
train
https://github.com/FrenzelGmbH/cm-address/blob/4295671dc603beed4bea6c5a7f77dac9846127f3/models/CountrySearch.php#L45-L70
icicleio/cache
src/MemoryCache.php
MemoryCache.exists
public function exists(string $key): \Generator { yield from $this->wait($key); return array_key_exists($key, $this->data); }
php
public function exists(string $key): \Generator { yield from $this->wait($key); return array_key_exists($key, $this->data); }
[ "public", "function", "exists", "(", "string", "$", "key", ")", ":", "\\", "Generator", "{", "yield", "from", "$", "this", "->", "wait", "(", "$", "key", ")", ";", "return", "array_key_exists", "(", "$", "key", ",", "$", "this", "->", "data", ")", ...
{@inheritdoc}
[ "{" ]
train
https://github.com/icicleio/cache/blob/d4edeed7c36dc261f051f880d389db80bb3672cf/src/MemoryCache.php#L50-L55
icicleio/cache
src/MemoryCache.php
MemoryCache.get
public function get(string $key): \Generator { yield from $this->wait($key); return $this->fetch($key); }
php
public function get(string $key): \Generator { yield from $this->wait($key); return $this->fetch($key); }
[ "public", "function", "get", "(", "string", "$", "key", ")", ":", "\\", "Generator", "{", "yield", "from", "$", "this", "->", "wait", "(", "$", "key", ")", ";", "return", "$", "this", "->", "fetch", "(", "$", "key", ")", ";", "}" ]
{@inheritdoc}
[ "{" ]
train
https://github.com/icicleio/cache/blob/d4edeed7c36dc261f051f880d389db80bb3672cf/src/MemoryCache.php#L60-L65
icicleio/cache
src/MemoryCache.php
MemoryCache.set
public function set(string $key, $value, int $expiration = 0): \Generator { yield from $this->wait($key); $this->put($key, $value, $expiration); return true; }
php
public function set(string $key, $value, int $expiration = 0): \Generator { yield from $this->wait($key); $this->put($key, $value, $expiration); return true; }
[ "public", "function", "set", "(", "string", "$", "key", ",", "$", "value", ",", "int", "$", "expiration", "=", "0", ")", ":", "\\", "Generator", "{", "yield", "from", "$", "this", "->", "wait", "(", "$", "key", ")", ";", "$", "this", "->", "put",...
{@inheritdoc}
[ "{" ]
train
https://github.com/icicleio/cache/blob/d4edeed7c36dc261f051f880d389db80bb3672cf/src/MemoryCache.php#L70-L77
icicleio/cache
src/MemoryCache.php
MemoryCache.add
public function add(string $key, $value, int $expiration = 0): \Generator { yield from $this->wait($key); if (isset($this->data[$key])) { return false; } $this->put($key, $value, $expiration); return true; }
php
public function add(string $key, $value, int $expiration = 0): \Generator { yield from $this->wait($key); if (isset($this->data[$key])) { return false; } $this->put($key, $value, $expiration); return true; }
[ "public", "function", "add", "(", "string", "$", "key", ",", "$", "value", ",", "int", "$", "expiration", "=", "0", ")", ":", "\\", "Generator", "{", "yield", "from", "$", "this", "->", "wait", "(", "$", "key", ")", ";", "if", "(", "isset", "(", ...
{@inheritdoc}
[ "{" ]
train
https://github.com/icicleio/cache/blob/d4edeed7c36dc261f051f880d389db80bb3672cf/src/MemoryCache.php#L82-L93
icicleio/cache
src/MemoryCache.php
MemoryCache.fetch
protected function fetch(string $key) { if (!isset($this->data[$key])) { return; } // Reset timer if there was an expiration. if (isset($this->timers[$key])) { $this->timers[$key]->again(); } return $this->data[$key]; }
php
protected function fetch(string $key) { if (!isset($this->data[$key])) { return; } // Reset timer if there was an expiration. if (isset($this->timers[$key])) { $this->timers[$key]->again(); } return $this->data[$key]; }
[ "protected", "function", "fetch", "(", "string", "$", "key", ")", "{", "if", "(", "!", "isset", "(", "$", "this", "->", "data", "[", "$", "key", "]", ")", ")", "{", "return", ";", "}", "// Reset timer if there was an expiration.", "if", "(", "isset", "...
@param string $key @return mixed
[ "@param", "string", "$key" ]
train
https://github.com/icicleio/cache/blob/d4edeed7c36dc261f051f880d389db80bb3672cf/src/MemoryCache.php#L116-L128
icicleio/cache
src/MemoryCache.php
MemoryCache.delete
public function delete(string $key): \Generator { yield from $this->wait($key); unset($this->data[$key]); if (isset($this->timers[$key])) { $this->timers[$key]->stop(); unset($this->timers[$key]); } return true; }
php
public function delete(string $key): \Generator { yield from $this->wait($key); unset($this->data[$key]); if (isset($this->timers[$key])) { $this->timers[$key]->stop(); unset($this->timers[$key]); } return true; }
[ "public", "function", "delete", "(", "string", "$", "key", ")", ":", "\\", "Generator", "{", "yield", "from", "$", "this", "->", "wait", "(", "$", "key", ")", ";", "unset", "(", "$", "this", "->", "data", "[", "$", "key", "]", ")", ";", "if", "...
{@inheritdoc}
[ "{" ]
train
https://github.com/icicleio/cache/blob/d4edeed7c36dc261f051f880d389db80bb3672cf/src/MemoryCache.php#L153-L165
icicleio/cache
src/MemoryCache.php
MemoryCache.update
public function update(string $key, callable $callback, int $expiration = 0): \Generator { yield from $this->wait($key); $this->lock($key); try { $result = $callback(isset($this->data[$key]) ? $this->data[$key] : null); if ($result instanceof \Generator) { ...
php
public function update(string $key, callable $callback, int $expiration = 0): \Generator { yield from $this->wait($key); $this->lock($key); try { $result = $callback(isset($this->data[$key]) ? $this->data[$key] : null); if ($result instanceof \Generator) { ...
[ "public", "function", "update", "(", "string", "$", "key", ",", "callable", "$", "callback", ",", "int", "$", "expiration", "=", "0", ")", ":", "\\", "Generator", "{", "yield", "from", "$", "this", "->", "wait", "(", "$", "key", ")", ";", "$", "thi...
{@inheritdoc}
[ "{" ]
train
https://github.com/icicleio/cache/blob/d4edeed7c36dc261f051f880d389db80bb3672cf/src/MemoryCache.php#L170-L191
icicleio/cache
src/MemoryCache.php
MemoryCache.lock
protected function lock(string $key) { if (isset($this->locks[$key])) { throw new InvalidArgumentError('Key was already locked.'); } $this->locks[$key] = new Delayed(); }
php
protected function lock(string $key) { if (isset($this->locks[$key])) { throw new InvalidArgumentError('Key was already locked.'); } $this->locks[$key] = new Delayed(); }
[ "protected", "function", "lock", "(", "string", "$", "key", ")", "{", "if", "(", "isset", "(", "$", "this", "->", "locks", "[", "$", "key", "]", ")", ")", "{", "throw", "new", "InvalidArgumentError", "(", "'Key was already locked.'", ")", ";", "}", "$"...
Locks the given key until unlock() is called. @param string $key @throws \Icicle\Exception\InvalidArgumentError
[ "Locks", "the", "given", "key", "until", "unlock", "()", "is", "called", "." ]
train
https://github.com/icicleio/cache/blob/d4edeed7c36dc261f051f880d389db80bb3672cf/src/MemoryCache.php#L200-L207
icicleio/cache
src/MemoryCache.php
MemoryCache.unlock
protected function unlock(string $key) { if (!isset($this->locks[$key])) { throw new InvalidArgumentError('No lock was set on the given key.'); } $awaitable = $this->locks[$key]; unset($this->locks[$key]); $awaitable->resolve(); }
php
protected function unlock(string $key) { if (!isset($this->locks[$key])) { throw new InvalidArgumentError('No lock was set on the given key.'); } $awaitable = $this->locks[$key]; unset($this->locks[$key]); $awaitable->resolve(); }
[ "protected", "function", "unlock", "(", "string", "$", "key", ")", "{", "if", "(", "!", "isset", "(", "$", "this", "->", "locks", "[", "$", "key", "]", ")", ")", "{", "throw", "new", "InvalidArgumentError", "(", "'No lock was set on the given key.'", ")", ...
Unlocks the given key. Throws if the key was not locked. @param string $key @throws \Icicle\Exception\InvalidArgumentError
[ "Unlocks", "the", "given", "key", ".", "Throws", "if", "the", "key", "was", "not", "locked", "." ]
train
https://github.com/icicleio/cache/blob/d4edeed7c36dc261f051f880d389db80bb3672cf/src/MemoryCache.php#L216-L225
icicleio/cache
src/MemoryCache.php
MemoryCache.wait
protected function wait(string $key): \Generator { if (isset($this->locks[$key])) { do { yield $this->locks[$key]; } while (isset($this->locks[$key])); return true; } return false; }
php
protected function wait(string $key): \Generator { if (isset($this->locks[$key])) { do { yield $this->locks[$key]; } while (isset($this->locks[$key])); return true; } return false; }
[ "protected", "function", "wait", "(", "string", "$", "key", ")", ":", "\\", "Generator", "{", "if", "(", "isset", "(", "$", "this", "->", "locks", "[", "$", "key", "]", ")", ")", "{", "do", "{", "yield", "$", "this", "->", "locks", "[", "$", "k...
@coroutine @param string $key @return \Generator @resolve bool
[ "@coroutine" ]
train
https://github.com/icicleio/cache/blob/d4edeed7c36dc261f051f880d389db80bb3672cf/src/MemoryCache.php#L236-L247
JBZoo/Profiler
src/Benchmark.php
Benchmark.add
public function add($name, \Closure $closure) { $test = new Test($name, $closure); $this->addTest($test); return $test; }
php
public function add($name, \Closure $closure) { $test = new Test($name, $closure); $this->addTest($test); return $test; }
[ "public", "function", "add", "(", "$", "name", ",", "\\", "Closure", "$", "closure", ")", "{", "$", "test", "=", "new", "Test", "(", "$", "name", ",", "$", "closure", ")", ";", "$", "this", "->", "addTest", "(", "$", "test", ")", ";", "return", ...
Utility method to create tests on the fly. You may chain the test: @param string $name @param \Closure $closure function to execute @return Test
[ "Utility", "method", "to", "create", "tests", "on", "the", "fly", ".", "You", "may", "chain", "the", "test", ":" ]
train
https://github.com/JBZoo/Profiler/blob/a4af3d2feb558ab9cd78012e0ca5c8dc7872fc69/src/Benchmark.php#L66-L72
JBZoo/Profiler
src/Benchmark.php
Benchmark._warmup
private function _warmup() { $warmup = new Test('warmup', function () { }); $this->_overhead = $warmup->runTest($this->_count); // One call each method for init (warmup) /** @var Test $test */ foreach ($this->_tests as $test) { $test->runTest(1); ...
php
private function _warmup() { $warmup = new Test('warmup', function () { }); $this->_overhead = $warmup->runTest($this->_count); // One call each method for init (warmup) /** @var Test $test */ foreach ($this->_tests as $test) { $test->runTest(1); ...
[ "private", "function", "_warmup", "(", ")", "{", "$", "warmup", "=", "new", "Test", "(", "'warmup'", ",", "function", "(", ")", "{", "}", ")", ";", "$", "this", "->", "_overhead", "=", "$", "warmup", "->", "runTest", "(", "$", "this", "->", "_count...
Runs an empty test to determine the benchmark overhead and run each test once
[ "Runs", "an", "empty", "test", "to", "determine", "the", "benchmark", "overhead", "and", "run", "each", "test", "once" ]
train
https://github.com/JBZoo/Profiler/blob/a4af3d2feb558ab9cd78012e0ca5c8dc7872fc69/src/Benchmark.php#L77-L97
JBZoo/Profiler
src/Benchmark.php
Benchmark.outputTable
public function outputTable(array $lines, $padding = 4) { $pad = function ($string, $width) use ($padding) { if ($width > 0) { return str_pad($string, $width, ' ') . str_repeat(' ', $padding); } else { return str_pad($string, -$width, ' ', STR_PAD_LEFT...
php
public function outputTable(array $lines, $padding = 4) { $pad = function ($string, $width) use ($padding) { if ($width > 0) { return str_pad($string, $width, ' ') . str_repeat(' ', $padding); } else { return str_pad($string, -$width, ' ', STR_PAD_LEFT...
[ "public", "function", "outputTable", "(", "array", "$", "lines", ",", "$", "padding", "=", "4", ")", "{", "$", "pad", "=", "function", "(", "$", "string", ",", "$", "width", ")", "use", "(", "$", "padding", ")", "{", "if", "(", "$", "width", ">",...
Output results in columns, padding right if values are string, left if numeric @param array $lines array(array('Name' => 'Value')); @param integer $padding space between columns
[ "Output", "results", "in", "columns", "padding", "right", "if", "values", "are", "string", "left", "if", "numeric" ]
train
https://github.com/JBZoo/Profiler/blob/a4af3d2feb558ab9cd78012e0ca5c8dc7872fc69/src/Benchmark.php#L156-L194
JBZoo/Profiler
src/Benchmark.php
Benchmark.formatResults
public function formatResults(array $results) { uasort($results['list'], function ($testOne, $testTwo) { if ($testOne['time'] === $testTwo['time']) { return 0; } else { return ($testOne['time'] < $testTwo['time']) ? -1 : 1; } }); ...
php
public function formatResults(array $results) { uasort($results['list'], function ($testOne, $testTwo) { if ($testOne['time'] === $testTwo['time']) { return 0; } else { return ($testOne['time'] < $testTwo['time']) ? -1 : 1; } }); ...
[ "public", "function", "formatResults", "(", "array", "$", "results", ")", "{", "uasort", "(", "$", "results", "[", "'list'", "]", ",", "function", "(", "$", "testOne", ",", "$", "testTwo", ")", "{", "if", "(", "$", "testOne", "[", "'time'", "]", "===...
Format the results, rounding numbers, showing difference percentages and removing a flat time based on the benchmark overhead @param array $results array($name => array('time' => 1.0)) @return array array(array('Test' => $name, 'Time' => '1000 ms', 'Perc' => '100 %'))
[ "Format", "the", "results", "rounding", "numbers", "showing", "difference", "percentages", "and", "removing", "a", "flat", "time", "based", "on", "the", "benchmark", "overhead" ]
train
https://github.com/JBZoo/Profiler/blob/a4af3d2feb558ab9cd78012e0ca5c8dc7872fc69/src/Benchmark.php#L203-L256
Avatar4eg/flarum-ext-geotags
src/Api/Controller/ListGeotagsController.php
ListGeotagsController.data
protected function data(ServerRequestInterface $request, Document $document) { $filter = $this->extractFilter($request); $include = $this->extractInclude($request); $where = []; $sort = $this->extractSort($request); $limit = $this->extractLimit($request); $offset = $...
php
protected function data(ServerRequestInterface $request, Document $document) { $filter = $this->extractFilter($request); $include = $this->extractInclude($request); $where = []; $sort = $this->extractSort($request); $limit = $this->extractLimit($request); $offset = $...
[ "protected", "function", "data", "(", "ServerRequestInterface", "$", "request", ",", "Document", "$", "document", ")", "{", "$", "filter", "=", "$", "this", "->", "extractFilter", "(", "$", "request", ")", ";", "$", "include", "=", "$", "this", "->", "ex...
{@inheritdoc}
[ "{" ]
train
https://github.com/Avatar4eg/flarum-ext-geotags/blob/a54216a02a3e0abc908f9ba3aec69431f906fb92/src/Api/Controller/ListGeotagsController.php#L40-L70
zhouyl/mellivora
Mellivora/Database/Eloquent/Relations/BelongsToMany.php
BelongsToMany.get
public function get($columns = ['*']) { // First we'll add the proper select columns onto the query so it is run with // the proper columns. Then, we will get the results and hydrate out pivot // models with the result of those columns as a separate model relation. $columns = $this->...
php
public function get($columns = ['*']) { // First we'll add the proper select columns onto the query so it is run with // the proper columns. Then, we will get the results and hydrate out pivot // models with the result of those columns as a separate model relation. $columns = $this->...
[ "public", "function", "get", "(", "$", "columns", "=", "[", "'*'", "]", ")", "{", "// First we'll add the proper select columns onto the query so it is run with", "// the proper columns. Then, we will get the results and hydrate out pivot", "// models with the result of those columns as ...
Execute the query as a "select" statement. @param array $columns @return \Mellivora\Database\Eloquent\Collection
[ "Execute", "the", "query", "as", "a", "select", "statement", "." ]
train
https://github.com/zhouyl/mellivora/blob/79f844c5c9c25ffbe18d142062e9bc3df00b36a1/Mellivora/Database/Eloquent/Relations/BelongsToMany.php#L502-L525
zhouyl/mellivora
Mellivora/Database/Eloquent/Relations/BelongsToMany.php
BelongsToMany.shouldSelect
protected function shouldSelect(array $columns = ['*']) { if ($columns === ['*']) { $columns = [$this->related->getTable() . '.*']; } return array_merge($columns, $this->aliasedPivotColumns()); }
php
protected function shouldSelect(array $columns = ['*']) { if ($columns === ['*']) { $columns = [$this->related->getTable() . '.*']; } return array_merge($columns, $this->aliasedPivotColumns()); }
[ "protected", "function", "shouldSelect", "(", "array", "$", "columns", "=", "[", "'*'", "]", ")", "{", "if", "(", "$", "columns", "===", "[", "'*'", "]", ")", "{", "$", "columns", "=", "[", "$", "this", "->", "related", "->", "getTable", "(", ")", ...
Get the select columns for the relation query. @param array $columns @return \Mellivora\Database\Eloquent\Relations\BelongsToMany
[ "Get", "the", "select", "columns", "for", "the", "relation", "query", "." ]
train
https://github.com/zhouyl/mellivora/blob/79f844c5c9c25ffbe18d142062e9bc3df00b36a1/Mellivora/Database/Eloquent/Relations/BelongsToMany.php#L534-L541
zhouyl/mellivora
Mellivora/Database/Eloquent/Relations/BelongsToMany.php
BelongsToMany.aliasedPivotColumns
protected function aliasedPivotColumns() { $defaults = [$this->foreignKey, $this->relatedKey]; return collect(array_merge($defaults, $this->pivotColumns))->map(function ($column) { return $this->table . '.' . $column . ' as pivot_' . $column; })->unique()->all(); }
php
protected function aliasedPivotColumns() { $defaults = [$this->foreignKey, $this->relatedKey]; return collect(array_merge($defaults, $this->pivotColumns))->map(function ($column) { return $this->table . '.' . $column . ' as pivot_' . $column; })->unique()->all(); }
[ "protected", "function", "aliasedPivotColumns", "(", ")", "{", "$", "defaults", "=", "[", "$", "this", "->", "foreignKey", ",", "$", "this", "->", "relatedKey", "]", ";", "return", "collect", "(", "array_merge", "(", "$", "defaults", ",", "$", "this", "-...
Get the pivot columns for the relation. "pivot_" is prefixed ot each column for easy removal later. @return array
[ "Get", "the", "pivot", "columns", "for", "the", "relation", "." ]
train
https://github.com/zhouyl/mellivora/blob/79f844c5c9c25ffbe18d142062e9bc3df00b36a1/Mellivora/Database/Eloquent/Relations/BelongsToMany.php#L550-L557
zhouyl/mellivora
Mellivora/Database/Eloquent/Relations/BelongsToMany.php
BelongsToMany.migratePivotAttributes
protected function migratePivotAttributes(Model $model) { $values = []; foreach ($model->getAttributes() as $key => $value) { // To get the pivots attributes we will just take any of the attributes which // begin with "pivot_" and add those to this arrays, as well as unsetti...
php
protected function migratePivotAttributes(Model $model) { $values = []; foreach ($model->getAttributes() as $key => $value) { // To get the pivots attributes we will just take any of the attributes which // begin with "pivot_" and add those to this arrays, as well as unsetti...
[ "protected", "function", "migratePivotAttributes", "(", "Model", "$", "model", ")", "{", "$", "values", "=", "[", "]", ";", "foreach", "(", "$", "model", "->", "getAttributes", "(", ")", "as", "$", "key", "=>", "$", "value", ")", "{", "// To get the pivo...
Get the pivot attributes from a model. @param \Mellivora\Database\Eloquent\Model $model @return array
[ "Get", "the", "pivot", "attributes", "from", "a", "model", "." ]
train
https://github.com/zhouyl/mellivora/blob/79f844c5c9c25ffbe18d142062e9bc3df00b36a1/Mellivora/Database/Eloquent/Relations/BelongsToMany.php#L642-L658
zhouyl/mellivora
Mellivora/Database/Eloquent/Relations/BelongsToMany.php
BelongsToMany.getRelationExistenceQuery
public function getRelationExistenceQuery(Builder $query, Builder $parentQuery, $columns = ['*']) { if ($parentQuery->getQuery()->from === $query->getQuery()->from) { return $this->getRelationExistenceQueryForSelfJoin($query, $parentQuery, $columns); } $this->performJoin($query)...
php
public function getRelationExistenceQuery(Builder $query, Builder $parentQuery, $columns = ['*']) { if ($parentQuery->getQuery()->from === $query->getQuery()->from) { return $this->getRelationExistenceQueryForSelfJoin($query, $parentQuery, $columns); } $this->performJoin($query)...
[ "public", "function", "getRelationExistenceQuery", "(", "Builder", "$", "query", ",", "Builder", "$", "parentQuery", ",", "$", "columns", "=", "[", "'*'", "]", ")", "{", "if", "(", "$", "parentQuery", "->", "getQuery", "(", ")", "->", "from", "===", "$",...
Add the constraints for a relationship query. @param \Mellivora\Database\Eloquent\Builder $query @param \Mellivora\Database\Eloquent\Builder $parentQuery @param array|mixed $columns @return \Mellivora\Database\Eloquent\Builder
[ "Add", "the", "constraints", "for", "a", "relationship", "query", "." ]
train
https://github.com/zhouyl/mellivora/blob/79f844c5c9c25ffbe18d142062e9bc3df00b36a1/Mellivora/Database/Eloquent/Relations/BelongsToMany.php#L823-L832
yuncms/yii2-authentication
frontend/models/Authentication.php
Authentication.beforeValidate
public function beforeValidate() { $this->id_file = UploadedFile::getInstance($this, 'id_file'); $this->id_file1 = UploadedFile::getInstance($this, 'id_file1'); $this->id_file2 = UploadedFile::getInstance($this, 'id_file2'); return parent::beforeValidate(); }
php
public function beforeValidate() { $this->id_file = UploadedFile::getInstance($this, 'id_file'); $this->id_file1 = UploadedFile::getInstance($this, 'id_file1'); $this->id_file2 = UploadedFile::getInstance($this, 'id_file2'); return parent::beforeValidate(); }
[ "public", "function", "beforeValidate", "(", ")", "{", "$", "this", "->", "id_file", "=", "UploadedFile", "::", "getInstance", "(", "$", "this", ",", "'id_file'", ")", ";", "$", "this", "->", "id_file1", "=", "UploadedFile", "::", "getInstance", "(", "$", ...
加载上传文件 @return bool
[ "加载上传文件" ]
train
https://github.com/yuncms/yii2-authentication/blob/02b70f7d2587480edb6dcc18ce256db662f1ed0d/frontend/models/Authentication.php#L110-L116
kbond/ControllerUtil
src/EventListener/TemplatingViewListener.php
TemplatingViewListener.getContent
protected function getContent(View $view, $format) { $template = $view->getTemplate(); if (is_array($template)) { foreach ($template as $t) { if ($this->templating->exists($t)) { $template = $t; break; } ...
php
protected function getContent(View $view, $format) { $template = $view->getTemplate(); if (is_array($template)) { foreach ($template as $t) { if ($this->templating->exists($t)) { $template = $t; break; } ...
[ "protected", "function", "getContent", "(", "View", "$", "view", ",", "$", "format", ")", "{", "$", "template", "=", "$", "view", "->", "getTemplate", "(", ")", ";", "if", "(", "is_array", "(", "$", "template", ")", ")", "{", "foreach", "(", "$", "...
{@inheritdoc}
[ "{" ]
train
https://github.com/kbond/ControllerUtil/blob/67375d43c73d6a3f16356f3d683f62b176766e91/src/EventListener/TemplatingViewListener.php#L23-L37
simbiosis-group/yii2-helper
actions/UpdateAction.php
UpdateAction.run
public function run() { $model = $this->model; if (Yii::$app->request->isAjax && $model->load(Yii::$app->request->post()) && isset($_POST['ajax'])) { Yii::$app->response->format = Response::FORMAT_JSON; return \yii\widgets\ActiveForm::validate($model); } ...
php
public function run() { $model = $this->model; if (Yii::$app->request->isAjax && $model->load(Yii::$app->request->post()) && isset($_POST['ajax'])) { Yii::$app->response->format = Response::FORMAT_JSON; return \yii\widgets\ActiveForm::validate($model); } ...
[ "public", "function", "run", "(", ")", "{", "$", "model", "=", "$", "this", "->", "model", ";", "if", "(", "Yii", "::", "$", "app", "->", "request", "->", "isAjax", "&&", "$", "model", "->", "load", "(", "Yii", "::", "$", "app", "->", "request", ...
Runs the action @return string result content
[ "Runs", "the", "action" ]
train
https://github.com/simbiosis-group/yii2-helper/blob/c85c4204dd06b16e54210e75fe6deb51869d1dd9/actions/UpdateAction.php#L72-L113
inhere/php-librarys
src/Components/ErrorHandler.php
ErrorHandler.register
public function register(array $errorLevelMap = [], $exceptionLevel = null, $fatalLevel = null) { //Forces the autoloader to run for LogLevel. Fixes an autoload issue at compile-time on PHP5.3. See https://github.com/Seldaek/monolog/pull/929 class_exists(LogLevel::class); if ($errorLevelMap...
php
public function register(array $errorLevelMap = [], $exceptionLevel = null, $fatalLevel = null) { //Forces the autoloader to run for LogLevel. Fixes an autoload issue at compile-time on PHP5.3. See https://github.com/Seldaek/monolog/pull/929 class_exists(LogLevel::class); if ($errorLevelMap...
[ "public", "function", "register", "(", "array", "$", "errorLevelMap", "=", "[", "]", ",", "$", "exceptionLevel", "=", "null", ",", "$", "fatalLevel", "=", "null", ")", "{", "//Forces the autoloader to run for LogLevel. Fixes an autoload issue at compile-time on PHP5.3. Se...
Registers a new ErrorHandler for a given Logger By default it will handle errors, exceptions and fatal errors @param array|false $errorLevelMap an array of E_* constant to LogLevel::* constant mapping, or false to disable error handling @param int|false $exceptionLevel a LogLevel::* constant, or false to disable ex...
[ "Registers", "a", "new", "ErrorHandler", "for", "a", "given", "Logger" ]
train
https://github.com/inhere/php-librarys/blob/e6ca598685469794f310e3ab0e2bc19519cd0ae6/src/Components/ErrorHandler.php#L70-L86
inhere/php-librarys
src/Components/ErrorHandler.php
ErrorHandler.handleFatalError
public function handleFatalError() { $this->reservedMemory = null; $lastError = error_get_last(); if ($lastError && \in_array($lastError['type'], self::$fatalErrors, true)) { $this->logger->log( $this->fatalLevel ?? LogLevel::ALERT, 'Fatal Error ...
php
public function handleFatalError() { $this->reservedMemory = null; $lastError = error_get_last(); if ($lastError && \in_array($lastError['type'], self::$fatalErrors, true)) { $this->logger->log( $this->fatalLevel ?? LogLevel::ALERT, 'Fatal Error ...
[ "public", "function", "handleFatalError", "(", ")", "{", "$", "this", "->", "reservedMemory", "=", "null", ";", "$", "lastError", "=", "error_get_last", "(", ")", ";", "if", "(", "$", "lastError", "&&", "\\", "in_array", "(", "$", "lastError", "[", "'typ...
handleFatalError @private
[ "handleFatalError" ]
train
https://github.com/inhere/php-librarys/blob/e6ca598685469794f310e3ab0e2bc19519cd0ae6/src/Components/ErrorHandler.php#L221-L251
nabab/bbn
src/bbn/mvc/environment.php
environment.set_mode
public function set_mode($mode){ if ( router::is_mode($mode) ){ $this->mode = $mode; } return $this->mode; }
php
public function set_mode($mode){ if ( router::is_mode($mode) ){ $this->mode = $mode; } return $this->mode; }
[ "public", "function", "set_mode", "(", "$", "mode", ")", "{", "if", "(", "router", "::", "is_mode", "(", "$", "mode", ")", ")", "{", "$", "this", "->", "mode", "=", "$", "mode", ";", "}", "return", "$", "this", "->", "mode", ";", "}" ]
Change the output mode (content-type) @param $mode @return string $this->mode
[ "Change", "the", "output", "mode", "(", "content", "-", "type", ")" ]
train
https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/mvc/environment.php#L87-L92
nabab/bbn
src/bbn/mvc/environment.php
environment.is_cli
public function is_cli(){ if ( !isset($this->cli) ){ $this->cli = (php_sapi_name() === 'cli'); if ( $this->cli ){ $opt = getopt('', ['cli']); if ( isset($opt['cli']) ){ $this->cli = 'direct'; } } } return $this->cli; }
php
public function is_cli(){ if ( !isset($this->cli) ){ $this->cli = (php_sapi_name() === 'cli'); if ( $this->cli ){ $opt = getopt('', ['cli']); if ( isset($opt['cli']) ){ $this->cli = 'direct'; } } } return $this->cli; }
[ "public", "function", "is_cli", "(", ")", "{", "if", "(", "!", "isset", "(", "$", "this", "->", "cli", ")", ")", "{", "$", "this", "->", "cli", "=", "(", "php_sapi_name", "(", ")", "===", "'cli'", ")", ";", "if", "(", "$", "this", "->", "cli", ...
Returns true if called from CLI/Cron, false otherwise @return boolean
[ "Returns", "true", "if", "called", "from", "CLI", "/", "Cron", "false", "otherwise" ]
train
https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/mvc/environment.php#L179-L190
stk2k/net-driver
src/Http/HttpProxyGetRequest.php
HttpProxyGetRequest.getProxyServer
public function getProxyServer() { $proxy_options = $this->getOption(EnumRequestOption::PROXY_OPTIONS, []); return isset($proxy_options[EnumProxyOption::PROXY_SERVER]) ? $proxy_options[EnumProxyOption::PROXY_SERVER] : ''; }
php
public function getProxyServer() { $proxy_options = $this->getOption(EnumRequestOption::PROXY_OPTIONS, []); return isset($proxy_options[EnumProxyOption::PROXY_SERVER]) ? $proxy_options[EnumProxyOption::PROXY_SERVER] : ''; }
[ "public", "function", "getProxyServer", "(", ")", "{", "$", "proxy_options", "=", "$", "this", "->", "getOption", "(", "EnumRequestOption", "::", "PROXY_OPTIONS", ",", "[", "]", ")", ";", "return", "isset", "(", "$", "proxy_options", "[", "EnumProxyOption", ...
Returns proxy server @return string
[ "Returns", "proxy", "server" ]
train
https://github.com/stk2k/net-driver/blob/75e0bc1a95ba430dd9ed9e69f6a0a5dd8f2e7b1c/src/Http/HttpProxyGetRequest.php#L28-L32
stk2k/net-driver
src/Http/HttpProxyGetRequest.php
HttpProxyGetRequest.getProxyPort
public function getProxyPort() { $proxy_options = $this->getOption(EnumRequestOption::PROXY_OPTIONS, []); return isset($proxy_options[EnumProxyOption::PROXY_PORT]) ? $proxy_options[EnumProxyOption::PROXY_PORT] : ''; }
php
public function getProxyPort() { $proxy_options = $this->getOption(EnumRequestOption::PROXY_OPTIONS, []); return isset($proxy_options[EnumProxyOption::PROXY_PORT]) ? $proxy_options[EnumProxyOption::PROXY_PORT] : ''; }
[ "public", "function", "getProxyPort", "(", ")", "{", "$", "proxy_options", "=", "$", "this", "->", "getOption", "(", "EnumRequestOption", "::", "PROXY_OPTIONS", ",", "[", "]", ")", ";", "return", "isset", "(", "$", "proxy_options", "[", "EnumProxyOption", ":...
Returns proxy port @return mixed
[ "Returns", "proxy", "port" ]
train
https://github.com/stk2k/net-driver/blob/75e0bc1a95ba430dd9ed9e69f6a0a5dd8f2e7b1c/src/Http/HttpProxyGetRequest.php#L39-L43
stk2k/net-driver
src/Http/HttpProxyGetRequest.php
HttpProxyGetRequest.getProxyType
public function getProxyType() { $proxy_options = $this->getOption(EnumRequestOption::PROXY_OPTIONS, []); return isset($proxy_options[EnumProxyOption::PROXY_TYPE]) ? $proxy_options[EnumProxyOption::PROXY_TYPE] : 'http'; }
php
public function getProxyType() { $proxy_options = $this->getOption(EnumRequestOption::PROXY_OPTIONS, []); return isset($proxy_options[EnumProxyOption::PROXY_TYPE]) ? $proxy_options[EnumProxyOption::PROXY_TYPE] : 'http'; }
[ "public", "function", "getProxyType", "(", ")", "{", "$", "proxy_options", "=", "$", "this", "->", "getOption", "(", "EnumRequestOption", "::", "PROXY_OPTIONS", ",", "[", "]", ")", ";", "return", "isset", "(", "$", "proxy_options", "[", "EnumProxyOption", ":...
Returns proxy type available values: 'http' for HTTP proxy 'https' for HTTPS proxy @return string
[ "Returns", "proxy", "type" ]
train
https://github.com/stk2k/net-driver/blob/75e0bc1a95ba430dd9ed9e69f6a0a5dd8f2e7b1c/src/Http/HttpProxyGetRequest.php#L55-L59
stk2k/net-driver
src/Http/HttpProxyGetRequest.php
HttpProxyGetRequest.getProxyAuth
public function getProxyAuth() { $proxy_options = $this->getOption(EnumRequestOption::PROXY_OPTIONS, []); return isset($proxy_options[EnumProxyOption::PROXY_AUTH]) ? $proxy_options[EnumProxyOption::PROXY_AUTH] : null; }
php
public function getProxyAuth() { $proxy_options = $this->getOption(EnumRequestOption::PROXY_OPTIONS, []); return isset($proxy_options[EnumProxyOption::PROXY_AUTH]) ? $proxy_options[EnumProxyOption::PROXY_AUTH] : null; }
[ "public", "function", "getProxyAuth", "(", ")", "{", "$", "proxy_options", "=", "$", "this", "->", "getOption", "(", "EnumRequestOption", "::", "PROXY_OPTIONS", ",", "[", "]", ")", ";", "return", "isset", "(", "$", "proxy_options", "[", "EnumProxyOption", ":...
Returns proxy auth available values: 'basic' for BASIC auth null or empty('') for no auth @return string
[ "Returns", "proxy", "auth" ]
train
https://github.com/stk2k/net-driver/blob/75e0bc1a95ba430dd9ed9e69f6a0a5dd8f2e7b1c/src/Http/HttpProxyGetRequest.php#L71-L75
stk2k/net-driver
src/Http/HttpProxyGetRequest.php
HttpProxyGetRequest.getProxyUserPassword
public function getProxyUserPassword() { $proxy_options = $this->getOption(EnumRequestOption::PROXY_OPTIONS, []); return isset($proxy_options[EnumProxyOption::USER_PASSWD]) ? $proxy_options[EnumProxyOption::USER_PASSWD] : ''; }
php
public function getProxyUserPassword() { $proxy_options = $this->getOption(EnumRequestOption::PROXY_OPTIONS, []); return isset($proxy_options[EnumProxyOption::USER_PASSWD]) ? $proxy_options[EnumProxyOption::USER_PASSWD] : ''; }
[ "public", "function", "getProxyUserPassword", "(", ")", "{", "$", "proxy_options", "=", "$", "this", "->", "getOption", "(", "EnumRequestOption", "::", "PROXY_OPTIONS", ",", "[", "]", ")", ";", "return", "isset", "(", "$", "proxy_options", "[", "EnumProxyOptio...
Returns proxy user/password(FORMAT: "user:password") @return mixed
[ "Returns", "proxy", "user", "/", "password", "(", "FORMAT", ":", "user", ":", "password", ")" ]
train
https://github.com/stk2k/net-driver/blob/75e0bc1a95ba430dd9ed9e69f6a0a5dd8f2e7b1c/src/Http/HttpProxyGetRequest.php#L82-L86
hametuha/wpametu
src/WPametu/UI/Field/Textarea.php
TextArea.build_input
protected function build_input($data, array $fields = []){ $fields = implode(' ', $fields); return sprintf('<textarea id="%1$s" name="%1$s" %2$s>%3$s</textarea>%4$s', $this->name, $fields, esc_textarea($data), $this->length_helper($data)); }
php
protected function build_input($data, array $fields = []){ $fields = implode(' ', $fields); return sprintf('<textarea id="%1$s" name="%1$s" %2$s>%3$s</textarea>%4$s', $this->name, $fields, esc_textarea($data), $this->length_helper($data)); }
[ "protected", "function", "build_input", "(", "$", "data", ",", "array", "$", "fields", "=", "[", "]", ")", "{", "$", "fields", "=", "implode", "(", "' '", ",", "$", "fields", ")", ";", "return", "sprintf", "(", "'<textarea id=\"%1$s\" name=\"%1$s\" %2$s>%3$s...
Make input field @param mixed $data @param array $fields @return string
[ "Make", "input", "field" ]
train
https://github.com/hametuha/wpametu/blob/0939373800815a8396291143d2a57967340da5aa/src/WPametu/UI/Field/Textarea.php#L36-L40
php-lug/lug
src/Bundle/ResourceBundle/Form/FormFactory.php
FormFactory.create
public function create($type = null, $data = null, array $options = []) { if ($type instanceof ResourceInterface) { $type = $this->parameterResolver->resolveForm($type); } $validationGroups = $this->parameterResolver->resolveValidationGroups(); $translationDomain = $this...
php
public function create($type = null, $data = null, array $options = []) { if ($type instanceof ResourceInterface) { $type = $this->parameterResolver->resolveForm($type); } $validationGroups = $this->parameterResolver->resolveValidationGroups(); $translationDomain = $this...
[ "public", "function", "create", "(", "$", "type", "=", "null", ",", "$", "data", "=", "null", ",", "array", "$", "options", "=", "[", "]", ")", "{", "if", "(", "$", "type", "instanceof", "ResourceInterface", ")", "{", "$", "type", "=", "$", "this",...
@param string|FormTypeInterface|ResourceInterface $type @param mixed $data @param mixed[] $options @return FormInterface
[ "@param", "string|FormTypeInterface|ResourceInterface", "$type", "@param", "mixed", "$data", "@param", "mixed", "[]", "$options" ]
train
https://github.com/php-lug/lug/blob/81c109f187eba0a60f17e8cc59984ebb31841db7/src/Bundle/ResourceBundle/Form/FormFactory.php#L52-L74
Eresus/EresusCMS
src/core/Plugin.php
Eresus_Plugin.__item
public function __item($item = null) { $result['name'] = $this->getName(); $result['content'] = '0'; $result['active'] = is_null($item) ? true : $item['active']; $result['settings'] = Eresus_CMS::getLegacyKernel()->db-> escape(is_null($item) ? encodeOptions($this->setting...
php
public function __item($item = null) { $result['name'] = $this->getName(); $result['content'] = '0'; $result['active'] = is_null($item) ? true : $item['active']; $result['settings'] = Eresus_CMS::getLegacyKernel()->db-> escape(is_null($item) ? encodeOptions($this->setting...
[ "public", "function", "__item", "(", "$", "item", "=", "null", ")", "{", "$", "result", "[", "'name'", "]", "=", "$", "this", "->", "getName", "(", ")", ";", "$", "result", "[", "'content'", "]", "=", "'0'", ";", "$", "result", "[", "'active'", "...
Возвращает информацию о плагине @param array $item Предыдущая версия информации (по умолчанию null) @return array Массив информации, пригодный для записи в БД
[ "Возвращает", "информацию", "о", "плагине" ]
train
https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/Plugin.php#L196-L207
Eresus/EresusCMS
src/core/Plugin.php
Eresus_Plugin.getName
public function getName() { if (null === $this->name) { $this->name = strtolower(get_class($this)); } return $this->name; }
php
public function getName() { if (null === $this->name) { $this->name = strtolower(get_class($this)); } return $this->name; }
[ "public", "function", "getName", "(", ")", "{", "if", "(", "null", "===", "$", "this", "->", "name", ")", "{", "$", "this", "->", "name", "=", "strtolower", "(", "get_class", "(", "$", "this", ")", ")", ";", "}", "return", "$", "this", "->", "nam...
Возвращает имя плагина @return string @since 3.01
[ "Возвращает", "имя", "плагина" ]
train
https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/Plugin.php#L229-L236
Eresus/EresusCMS
src/core/Plugin.php
Eresus_Plugin.updateSettings
public function updateSettings() { foreach ($this->settings as $key => &$value) { if (!is_null(arg($key))) { $value = arg($key); } } $this->onSettingsUpdate(); $this->saveSettings(); }
php
public function updateSettings() { foreach ($this->settings as $key => &$value) { if (!is_null(arg($key))) { $value = arg($key); } } $this->onSettingsUpdate(); $this->saveSettings(); }
[ "public", "function", "updateSettings", "(", ")", "{", "foreach", "(", "$", "this", "->", "settings", "as", "$", "key", "=>", "&", "$", "value", ")", "{", "if", "(", "!", "is_null", "(", "arg", "(", "$", "key", ")", ")", ")", "{", "$", "value", ...
Сохраняет в БД изменения настроек плагина
[ "Сохраняет", "в", "БД", "изменения", "настроек", "плагина" ]
train
https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/Plugin.php#L340-L351
Eresus/EresusCMS
src/core/Plugin.php
Eresus_Plugin.dbSelect
public function dbSelect($table = '', $condition = '', $order = '', $fields = '', $limit = 0, $offset = 0, $group = '', $distinct = false) { $result = Eresus_CMS::getLegacyKernel()->db->select($this->__table($table), $condition, $order, $fields, $limit, $offset, $gro...
php
public function dbSelect($table = '', $condition = '', $order = '', $fields = '', $limit = 0, $offset = 0, $group = '', $distinct = false) { $result = Eresus_CMS::getLegacyKernel()->db->select($this->__table($table), $condition, $order, $fields, $limit, $offset, $gro...
[ "public", "function", "dbSelect", "(", "$", "table", "=", "''", ",", "$", "condition", "=", "''", ",", "$", "order", "=", "''", ",", "$", "fields", "=", "''", ",", "$", "limit", "=", "0", ",", "$", "offset", "=", "0", ",", "$", "group", "=", ...
Производит выборку из таблицы БД @param string $table Имя таблицы (пустое значение - таблица по умолчанию) @param string $condition Условие выборки @param string $order Порядок выборки @param string $fields Список полей @param int $limit Вернуть не больше полей чем limit @param int $offset Смещение...
[ "Производит", "выборку", "из", "таблицы", "БД" ]
train
https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/Plugin.php#L366-L373
Eresus/EresusCMS
src/core/Plugin.php
Eresus_Plugin.dbItem
public function dbItem($table, $id, $key = 'id') { $result = Eresus_CMS::getLegacyKernel()->db->selectItem($this->__table($table), "`$key` = '$id'"); return $result; }
php
public function dbItem($table, $id, $key = 'id') { $result = Eresus_CMS::getLegacyKernel()->db->selectItem($this->__table($table), "`$key` = '$id'"); return $result; }
[ "public", "function", "dbItem", "(", "$", "table", ",", "$", "id", ",", "$", "key", "=", "'id'", ")", "{", "$", "result", "=", "Eresus_CMS", "::", "getLegacyKernel", "(", ")", "->", "db", "->", "selectItem", "(", "$", "this", "->", "__table", "(", ...
Получение записи из БД @param string $table Имя таблицы @param mixed $id Идентификатор элемента @param string $key Имя ключевого поля @return array Элемент
[ "Получение", "записи", "из", "БД" ]
train
https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/Plugin.php#L385-L391
Eresus/EresusCMS
src/core/Plugin.php
Eresus_Plugin.dbInsert
public function dbInsert($table, $item, $key = 'id') { Eresus_CMS::getLegacyKernel()->db->insert($this->__table($table), $item); $result = $this->dbItem($table, Eresus_CMS::getLegacyKernel()->db->getInsertedId(), $key); return $result; }
php
public function dbInsert($table, $item, $key = 'id') { Eresus_CMS::getLegacyKernel()->db->insert($this->__table($table), $item); $result = $this->dbItem($table, Eresus_CMS::getLegacyKernel()->db->getInsertedId(), $key); return $result; }
[ "public", "function", "dbInsert", "(", "$", "table", ",", "$", "item", ",", "$", "key", "=", "'id'", ")", "{", "Eresus_CMS", "::", "getLegacyKernel", "(", ")", "->", "db", "->", "insert", "(", "$", "this", "->", "__table", "(", "$", "table", ")", "...
Вставка в таблицу БД @param string $table Имя таблицы @param array $item Вставляемый элемент @param string $key[optional] Имя ключевого поля. По умолчанию "id"
[ "Вставка", "в", "таблицу", "БД" ]
train
https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/Plugin.php#L401-L407
Eresus/EresusCMS
src/core/Plugin.php
Eresus_Plugin.dbUpdate
public function dbUpdate($table, $data, $condition = '') { if (is_array($data)) { if (empty($condition)) $condition = 'id'; $result = Eresus_CMS::getLegacyKernel()->db-> updateItem($this->__table($table), $data, "`$condition` = '{$data[$condition]}'"); ...
php
public function dbUpdate($table, $data, $condition = '') { if (is_array($data)) { if (empty($condition)) $condition = 'id'; $result = Eresus_CMS::getLegacyKernel()->db-> updateItem($this->__table($table), $data, "`$condition` = '{$data[$condition]}'"); ...
[ "public", "function", "dbUpdate", "(", "$", "table", ",", "$", "data", ",", "$", "condition", "=", "''", ")", "{", "if", "(", "is_array", "(", "$", "data", ")", ")", "{", "if", "(", "empty", "(", "$", "condition", ")", ")", "$", "condition", "=",...
Изменение данных в БД @param string $table Имя таблицы @param mixed $data Изменяемый эелемент / Изменения @param string $condition Ключевое поле / Условие для замены @return bool Результат
[ "Изменение", "данных", "в", "БД" ]
train
https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/Plugin.php#L419-L438
Eresus/EresusCMS
src/core/Plugin.php
Eresus_Plugin.dbDelete
public function dbDelete($table, $item, $key = 'id') { $result = Eresus_CMS::getLegacyKernel()->db-> delete($this->__table($table), "`$key` = '".(is_array($item)? $item[$key] : $item)."'"); return $result; }
php
public function dbDelete($table, $item, $key = 'id') { $result = Eresus_CMS::getLegacyKernel()->db-> delete($this->__table($table), "`$key` = '".(is_array($item)? $item[$key] : $item)."'"); return $result; }
[ "public", "function", "dbDelete", "(", "$", "table", ",", "$", "item", ",", "$", "key", "=", "'id'", ")", "{", "$", "result", "=", "Eresus_CMS", "::", "getLegacyKernel", "(", ")", "->", "db", "->", "delete", "(", "$", "this", "->", "__table", "(", ...
Удаление элемента из БД @param string $table Имя таблицы @param mixed $item Удаляемый элемент / Идентификатор @param string $key Ключевое поле @return bool Результат
[ "Удаление", "элемента", "из", "БД" ]
train
https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/Plugin.php#L450-L456
Eresus/EresusCMS
src/core/Plugin.php
Eresus_Plugin.dbCount
public function dbCount($table, $condition = '') { $result = Eresus_CMS::getLegacyKernel()->db->count($this->__table($table), $condition); return $result; }
php
public function dbCount($table, $condition = '') { $result = Eresus_CMS::getLegacyKernel()->db->count($this->__table($table), $condition); return $result; }
[ "public", "function", "dbCount", "(", "$", "table", ",", "$", "condition", "=", "''", ")", "{", "$", "result", "=", "Eresus_CMS", "::", "getLegacyKernel", "(", ")", "->", "db", "->", "count", "(", "$", "this", "->", "__table", "(", "$", "table", ")",...
Подсчёт количества записей в БД @param string $table Имя таблицы @param string $condition Условие для включения в подсчёт @return int Количество записей, удовлетворяющих условию
[ "Подсчёт", "количества", "записей", "в", "БД" ]
train
https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/Plugin.php#L467-L472
Eresus/EresusCMS
src/core/Plugin.php
Eresus_Plugin.dbTable
public function dbTable($table, $param = '') { $result = Eresus_CMS::getLegacyKernel()->db->tableStatus($this->__table($table), $param); return $result; }
php
public function dbTable($table, $param = '') { $result = Eresus_CMS::getLegacyKernel()->db->tableStatus($this->__table($table), $param); return $result; }
[ "public", "function", "dbTable", "(", "$", "table", ",", "$", "param", "=", "''", ")", "{", "$", "result", "=", "Eresus_CMS", "::", "getLegacyKernel", "(", ")", "->", "db", "->", "tableStatus", "(", "$", "this", "->", "__table", "(", "$", "table", ")...
Получение информации о таблицах @param string $table Маска имени таблицы @param string $param Вернуть только указанный параметр @return mixed
[ "Получение", "информации", "о", "таблицах" ]
train
https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/Plugin.php#L483-L488
Eresus/EresusCMS
src/core/Plugin.php
Eresus_Plugin.templates
public function templates() { if (null === $this->templates) { $this->templates = new Eresus_Plugin_Templates($this); } return $this->templates; }
php
public function templates() { if (null === $this->templates) { $this->templates = new Eresus_Plugin_Templates($this); } return $this->templates; }
[ "public", "function", "templates", "(", ")", "{", "if", "(", "null", "===", "$", "this", "->", "templates", ")", "{", "$", "this", "->", "templates", "=", "new", "Eresus_Plugin_Templates", "(", "$", "this", ")", ";", "}", "return", "$", "this", "->", ...
Возвращает объект для работы с шаблонами плагина @return Eresus_Plugin_Templates|null @since 3.01
[ "Возвращает", "объект", "для", "работы", "с", "шаблонами", "плагина" ]
train
https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/Plugin.php#L496-L503
Eresus/EresusCMS
src/core/Plugin.php
Eresus_Plugin.loadSettings
protected function loadSettings() { $result = Eresus_CMS::getLegacyKernel()->db ->selectItem('plugins', "`name`='" . $this->getName() . "'"); if ($result) { $this->settings = decodeOptions($result['settings'], $this->settings); } return (bool) $result;...
php
protected function loadSettings() { $result = Eresus_CMS::getLegacyKernel()->db ->selectItem('plugins', "`name`='" . $this->getName() . "'"); if ($result) { $this->settings = decodeOptions($result['settings'], $this->settings); } return (bool) $result;...
[ "protected", "function", "loadSettings", "(", ")", "{", "$", "result", "=", "Eresus_CMS", "::", "getLegacyKernel", "(", ")", "->", "db", "->", "selectItem", "(", "'plugins'", ",", "\"`name`='\"", ".", "$", "this", "->", "getName", "(", ")", ".", "\"'\"", ...
Чтение настроек плагина из БД @return bool Результат выполнения
[ "Чтение", "настроек", "плагина", "из", "БД" ]
train
https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/Plugin.php#L510-L519
Eresus/EresusCMS
src/core/Plugin.php
Eresus_Plugin.saveSettings
protected function saveSettings() { $result = Eresus_CMS::getLegacyKernel()->db ->selectItem('plugins', "`name`='{$this->getName()}'"); $result = $this->__item($result); $result['settings'] = Eresus_CMS::getLegacyKernel()->db ->escape(encodeOptions($this->settings)); ...
php
protected function saveSettings() { $result = Eresus_CMS::getLegacyKernel()->db ->selectItem('plugins', "`name`='{$this->getName()}'"); $result = $this->__item($result); $result['settings'] = Eresus_CMS::getLegacyKernel()->db ->escape(encodeOptions($this->settings)); ...
[ "protected", "function", "saveSettings", "(", ")", "{", "$", "result", "=", "Eresus_CMS", "::", "getLegacyKernel", "(", ")", "->", "db", "->", "selectItem", "(", "'plugins'", ",", "\"`name`='{$this->getName()}'\"", ")", ";", "$", "result", "=", "$", "this", ...
Сохранение настроек плагина в БД @return bool Результат выполнения
[ "Сохранение", "настроек", "плагина", "в", "БД" ]
train
https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/Plugin.php#L526-L537
Eresus/EresusCMS
src/core/Plugin.php
Eresus_Plugin.listenEvents
protected function listenEvents() { $registry = Eresus_Plugin_Registry::getInstance(); for ($i=0; $i < func_num_args(); $i++) { $event = func_get_arg($i); if (!array_key_exists($event, $registry->events)) { $registry->events[$event] = array...
php
protected function listenEvents() { $registry = Eresus_Plugin_Registry::getInstance(); for ($i=0; $i < func_num_args(); $i++) { $event = func_get_arg($i); if (!array_key_exists($event, $registry->events)) { $registry->events[$event] = array...
[ "protected", "function", "listenEvents", "(", ")", "{", "$", "registry", "=", "Eresus_Plugin_Registry", "::", "getInstance", "(", ")", ";", "for", "(", "$", "i", "=", "0", ";", "$", "i", "<", "func_num_args", "(", ")", ";", "$", "i", "++", ")", "{", ...
Регистрация обработчиков событий @param string ... имена событий @deprecated с 3.01 используйте {@link Eresus_Event_Dispatcher::addEventListener()}
[ "Регистрация", "обработчиков", "событий" ]
train
https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/Plugin.php#L554-L566
Eresus/EresusCMS
src/core/Plugin.php
Eresus_Plugin.installTemplates
protected function installTemplates() { $path = $this->getCodeDir() . '/client/templates'; if (file_exists($path)) { $ts = Eresus_Template_Service::getInstance(); $it = new DirectoryIterator($path); foreach ($it as $fileInfo) { ...
php
protected function installTemplates() { $path = $this->getCodeDir() . '/client/templates'; if (file_exists($path)) { $ts = Eresus_Template_Service::getInstance(); $it = new DirectoryIterator($path); foreach ($it as $fileInfo) { ...
[ "protected", "function", "installTemplates", "(", ")", "{", "$", "path", "=", "$", "this", "->", "getCodeDir", "(", ")", ".", "'/client/templates'", ";", "if", "(", "file_exists", "(", "$", "path", ")", ")", "{", "$", "ts", "=", "Eresus_Template_Service", ...
Устанавливает шаблоны КИ в общую папку шаблонов
[ "Устанавливает", "шаблоны", "КИ", "в", "общую", "папку", "шаблонов" ]
train
https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/Plugin.php#L571-L587
Eresus/EresusCMS
src/core/Plugin.php
Eresus_Plugin.uninstallTemplates
protected function uninstallTemplates() { $path = $this->getCodeDir() . '/client/templates'; if (file_exists($path)) { $ts = Eresus_Template_Service::getInstance(); $ts->remove($this->getName()); } }
php
protected function uninstallTemplates() { $path = $this->getCodeDir() . '/client/templates'; if (file_exists($path)) { $ts = Eresus_Template_Service::getInstance(); $ts->remove($this->getName()); } }
[ "protected", "function", "uninstallTemplates", "(", ")", "{", "$", "path", "=", "$", "this", "->", "getCodeDir", "(", ")", ".", "'/client/templates'", ";", "if", "(", "file_exists", "(", "$", "path", ")", ")", "{", "$", "ts", "=", "Eresus_Template_Service"...
Удаляет шаблоны КИ из общей папки шаблонов
[ "Удаляет", "шаблоны", "КИ", "из", "общей", "папки", "шаблонов" ]
train
https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/Plugin.php#L592-L600
Eresus/EresusCMS
src/core/Plugin.php
Eresus_Plugin.cleanupDB
protected function cleanupDB() { $eresus = Eresus_CMS::getLegacyKernel(); $tables = $eresus->db ->query_array("SHOW TABLES LIKE '{$eresus->db->prefix}{$this->getName()}_%'"); $tables = array_merge($tables, $eresus->db-> query_array("SHOW TABLES LIKE '{$eresus->db->pre...
php
protected function cleanupDB() { $eresus = Eresus_CMS::getLegacyKernel(); $tables = $eresus->db ->query_array("SHOW TABLES LIKE '{$eresus->db->prefix}{$this->getName()}_%'"); $tables = array_merge($tables, $eresus->db-> query_array("SHOW TABLES LIKE '{$eresus->db->pre...
[ "protected", "function", "cleanupDB", "(", ")", "{", "$", "eresus", "=", "Eresus_CMS", "::", "getLegacyKernel", "(", ")", ";", "$", "tables", "=", "$", "eresus", "->", "db", "->", "query_array", "(", "\"SHOW TABLES LIKE '{$eresus->db->prefix}{$this->getName()}_%'\""...
Удаляет таблицы БД при удалении плагина @since 3.01
[ "Удаляет", "таблицы", "БД", "при", "удалении", "плагина" ]
train
https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/Plugin.php#L607-L618
Eresus/EresusCMS
src/core/Plugin.php
Eresus_Plugin.mkdir
protected function mkdir($name = '') { $result = true; $umask = umask(0000); # Проверка и создание корневой директории данных if (!is_dir($this->dirData)) $result = mkdir($this->dirData); if ($result) { # Удаляем директории вида "." и "..", а также финальн...
php
protected function mkdir($name = '') { $result = true; $umask = umask(0000); # Проверка и создание корневой директории данных if (!is_dir($this->dirData)) $result = mkdir($this->dirData); if ($result) { # Удаляем директории вида "." и "..", а также финальн...
[ "protected", "function", "mkdir", "(", "$", "name", "=", "''", ")", "{", "$", "result", "=", "true", ";", "$", "umask", "=", "umask", "(", "0000", ")", ";", "# Проверка и создание корневой директории данных", "if", "(", "!", "is_dir", "(", "$", "this", "...
Создание новой директории @param string $name Имя директории @return bool Результат
[ "Создание", "новой", "директории" ]
train
https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/Plugin.php#L640-L663
Eresus/EresusCMS
src/core/Plugin.php
Eresus_Plugin.rmdir
protected function rmdir($name = '') { $result = true; $name = preg_replace(array('!\.{1,2}/!', '!^/!', '!/$!'), '', $name); $name = $this->dirData.$name; if (is_dir($name)) { $files = glob($name.'/{.*,*}', GLOB_BRACE); for ($i = 0; $i < count($files);...
php
protected function rmdir($name = '') { $result = true; $name = preg_replace(array('!\.{1,2}/!', '!^/!', '!/$!'), '', $name); $name = $this->dirData.$name; if (is_dir($name)) { $files = glob($name.'/{.*,*}', GLOB_BRACE); for ($i = 0; $i < count($files);...
[ "protected", "function", "rmdir", "(", "$", "name", "=", "''", ")", "{", "$", "result", "=", "true", ";", "$", "name", "=", "preg_replace", "(", "array", "(", "'!\\.{1,2}/!'", ",", "'!^/!'", ",", "'!/$!'", ")", ",", "''", ",", "$", "name", ")", ";"...
Удаление директории и файлов @param string $name Имя директории @return bool Результат
[ "Удаление", "директории", "и", "файлов" ]
train
https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/Plugin.php#L671-L689
Eresus/EresusCMS
src/core/Plugin.php
Eresus_Plugin.dbCreateTable
protected function dbCreateTable($SQL, $name = '') { $result = Eresus_CMS::getLegacyKernel()->db->create($this->__table($name), $SQL); return $result; }
php
protected function dbCreateTable($SQL, $name = '') { $result = Eresus_CMS::getLegacyKernel()->db->create($this->__table($name), $SQL); return $result; }
[ "protected", "function", "dbCreateTable", "(", "$", "SQL", ",", "$", "name", "=", "''", ")", "{", "$", "result", "=", "Eresus_CMS", "::", "getLegacyKernel", "(", ")", "->", "db", "->", "create", "(", "$", "this", "->", "__table", "(", "$", "name", ")...
Создание таблицы в БД @param string $SQL Описание таблицы @param string $name Имя таблицы @return bool Результат выполнения
[ "Создание", "таблицы", "в", "БД" ]
train
https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/Plugin.php#L710-L714
Eresus/EresusCMS
src/core/Plugin.php
Eresus_Plugin.dbDropTable
protected function dbDropTable($name = '') { $result = Eresus_CMS::getLegacyKernel()->db->drop($this->__table($name)); return $result; }
php
protected function dbDropTable($name = '') { $result = Eresus_CMS::getLegacyKernel()->db->drop($this->__table($name)); return $result; }
[ "protected", "function", "dbDropTable", "(", "$", "name", "=", "''", ")", "{", "$", "result", "=", "Eresus_CMS", "::", "getLegacyKernel", "(", ")", "->", "db", "->", "drop", "(", "$", "this", "->", "__table", "(", "$", "name", ")", ")", ";", "return"...
Удаление таблицы БД @param string $name Имя таблицы @return bool Результат выполнения
[ "Удаление", "таблицы", "БД" ]
train
https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/Plugin.php#L723-L727
Eresus/EresusCMS
src/core/Client/Controller/Content/Default.php
Eresus_Client_Controller_Content_Default.getHtml
public function getHtml(Eresus_CMS_Request $request, TClientUI $page) { $plugin = new ContentPlugin; return $plugin->clientRenderContent($request, $page); }
php
public function getHtml(Eresus_CMS_Request $request, TClientUI $page) { $plugin = new ContentPlugin; return $plugin->clientRenderContent($request, $page); }
[ "public", "function", "getHtml", "(", "Eresus_CMS_Request", "$", "request", ",", "TClientUI", "$", "page", ")", "{", "$", "plugin", "=", "new", "ContentPlugin", ";", "return", "$", "plugin", "->", "clientRenderContent", "(", "$", "request", ",", "$", "page",...
Возвращает разметку области контента @param Eresus_CMS_Request $request @param TClientUI $page @return Eresus_HTTP_Response|string @since 3.01
[ "Возвращает", "разметку", "области", "контента" ]
train
https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/Client/Controller/Content/Default.php#L45-L49
infusephp/infuse
src/RouteResolver.php
RouteResolver.resolve
public function resolve($route, $req, $res, array $args) { $result = false; if (is_array($route) || is_string($route)) { // method name and controller supplied if (is_string($route) && $req->params('controller')) { $route = [$req->params('controller'), $route]...
php
public function resolve($route, $req, $res, array $args) { $result = false; if (is_array($route) || is_string($route)) { // method name and controller supplied if (is_string($route) && $req->params('controller')) { $route = [$req->params('controller'), $route]...
[ "public", "function", "resolve", "(", "$", "route", ",", "$", "req", ",", "$", "res", ",", "array", "$", "args", ")", "{", "$", "result", "=", "false", ";", "if", "(", "is_array", "(", "$", "route", ")", "||", "is_string", "(", "$", "route", ")",...
Executes a route handler. @param array|string $route array('controller','method') or array('controller') or 'method' @param Request $req @param Response $res @param array $args @throws Exception when the route cannot be resolved. @return Response
[ "Executes", "a", "route", "handler", "." ]
train
https://github.com/infusephp/infuse/blob/7520b237c69f3d8a07d95d7481b26027ced2ed83/src/RouteResolver.php#L117-L163
Eresus/EresusCMS
src/core/framework/core/3rdparty/ezcomponents/Mail/src/internal/header_folder.php
ezcMailHeaderFolder.foldAny
static public function foldAny( $text ) { // Don't fold unless we have to. if ( strlen( $text ) <= self::$limit ) { return $text; } // go to 998'th char. // search back to whitespace // fold $length = strlen( $text ); $folded = ""...
php
static public function foldAny( $text ) { // Don't fold unless we have to. if ( strlen( $text ) <= self::$limit ) { return $text; } // go to 998'th char. // search back to whitespace // fold $length = strlen( $text ); $folded = ""...
[ "static", "public", "function", "foldAny", "(", "$", "text", ")", "{", "// Don't fold unless we have to.", "if", "(", "strlen", "(", "$", "text", ")", "<=", "self", "::", "$", "limit", ")", "{", "return", "$", "text", ";", "}", "// go to 998'th char.", "//...
Returns $text folded to the 998 character limit on any whitespace. The algorithm tries to minimize the number of comparisons by searching backwards from the maximum number of allowed characters on a line. @param string $text @return string
[ "Returns", "$text", "folded", "to", "the", "998", "character", "limit", "on", "any", "whitespace", "." ]
train
https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/Mail/src/internal/header_folder.php#L87-L144
thecodingmachine/mvc.splash-common
src/Mouf/Mvc/Splash/Services/SplashCreateControllerService.php
SplashCreateControllerService.generate
public function generate(MoufManager $moufManager, $controllerName, $instanceName, $namespace, $injectLogger = false, $injectTemplate = false, $actions = array()) { $namespace = rtrim($namespace, '\\').'\\'; $classNameMapper = ClassNameMapper::createFromComposerFile(__D...
php
public function generate(MoufManager $moufManager, $controllerName, $instanceName, $namespace, $injectLogger = false, $injectTemplate = false, $actions = array()) { $namespace = rtrim($namespace, '\\').'\\'; $classNameMapper = ClassNameMapper::createFromComposerFile(__D...
[ "public", "function", "generate", "(", "MoufManager", "$", "moufManager", ",", "$", "controllerName", ",", "$", "instanceName", ",", "$", "namespace", ",", "$", "injectLogger", "=", "false", ",", "$", "injectTemplate", "=", "false", ",", "$", "actions", "=",...
Generates a controller, view, and sets the instance up. @param string $controllerName @param string $instanceName @param string $namespace @param string $injectLogger @param string $injectTemplate @param array $actions
[ "Generates", "a", "controller", "view", "and", "sets", "the", "instance", "up", "." ]
train
https://github.com/thecodingmachine/mvc.splash-common/blob/eed0269ceda4d7d090a330a220490906a7aa60bd/src/Mouf/Mvc/Splash/Services/SplashCreateControllerService.php#L28-L404
thecodingmachine/mvc.splash-common
src/Mouf/Mvc/Splash/Services/SplashCreateControllerService.php
SplashCreateControllerService.createDirectory
private function createDirectory($directory) { if (!file_exists($directory)) { // Let's create the directory: $old = umask(0); $result = @mkdir($directory, 0775, true); umask($old); return $result; } return true; }
php
private function createDirectory($directory) { if (!file_exists($directory)) { // Let's create the directory: $old = umask(0); $result = @mkdir($directory, 0775, true); umask($old); return $result; } return true; }
[ "private", "function", "createDirectory", "(", "$", "directory", ")", "{", "if", "(", "!", "file_exists", "(", "$", "directory", ")", ")", "{", "// Let's create the directory:", "$", "old", "=", "umask", "(", "0", ")", ";", "$", "result", "=", "@", "mkdi...
@param string $directory @return bool
[ "@param", "string", "$directory" ]
train
https://github.com/thecodingmachine/mvc.splash-common/blob/eed0269ceda4d7d090a330a220490906a7aa60bd/src/Mouf/Mvc/Splash/Services/SplashCreateControllerService.php#L422-L434
xiewulong/yii2-fileupload
oss/libs/symfony/yaml/Symfony/Component/Yaml/Dumper.php
Dumper.dump
public function dump($input, $inline = 0, $indent = 0, $exceptionOnInvalidType = false, $objectSupport = false) { $output = ''; $prefix = $indent ? str_repeat(' ', $indent) : ''; if ($inline <= 0 || !is_array($input) || empty($input)) { $output .= $prefix.Inline::dump($input, $e...
php
public function dump($input, $inline = 0, $indent = 0, $exceptionOnInvalidType = false, $objectSupport = false) { $output = ''; $prefix = $indent ? str_repeat(' ', $indent) : ''; if ($inline <= 0 || !is_array($input) || empty($input)) { $output .= $prefix.Inline::dump($input, $e...
[ "public", "function", "dump", "(", "$", "input", ",", "$", "inline", "=", "0", ",", "$", "indent", "=", "0", ",", "$", "exceptionOnInvalidType", "=", "false", ",", "$", "objectSupport", "=", "false", ")", "{", "$", "output", "=", "''", ";", "$", "p...
Dumps a PHP value to YAML. @param mixed $input The PHP value @param integer $inline The level where you switch to inline YAML @param integer $indent The level of indentation (used internally) @param Boolean $exceptionOnInvalidType true if an exception must be thrown o...
[ "Dumps", "a", "PHP", "value", "to", "YAML", "." ]
train
https://github.com/xiewulong/yii2-fileupload/blob/3e75b17a4a18dd8466e3f57c63136de03470ca82/oss/libs/symfony/yaml/Symfony/Component/Yaml/Dumper.php#L49-L72
technote-space/wordpress-plugin-base
src/classes/models/lib/uninstall.php
Uninstall.uninstall
public function uninstall() { $uninstall = $this->_uninstall; ksort( $uninstall ); if ( ! is_multisite() ) { foreach ( $uninstall as $priority => $items ) { foreach ( $items as $item ) { if ( is_callable( $item ) ) { call_user_func( $item ); } } } } else { /** @var \wpdb $wpdb *...
php
public function uninstall() { $uninstall = $this->_uninstall; ksort( $uninstall ); if ( ! is_multisite() ) { foreach ( $uninstall as $priority => $items ) { foreach ( $items as $item ) { if ( is_callable( $item ) ) { call_user_func( $item ); } } } } else { /** @var \wpdb $wpdb *...
[ "public", "function", "uninstall", "(", ")", "{", "$", "uninstall", "=", "$", "this", "->", "_uninstall", ";", "ksort", "(", "$", "uninstall", ")", ";", "if", "(", "!", "is_multisite", "(", ")", ")", "{", "foreach", "(", "$", "uninstall", "as", "$", ...
uninstall
[ "uninstall" ]
train
https://github.com/technote-space/wordpress-plugin-base/blob/02cfcba358432a2539af07a69d9db00ff7c14eac/src/classes/models/lib/uninstall.php#L73-L104
heidelpay/PhpDoc
src/phpDocumentor/Plugin/Core/Transformer/Writer/Xml/InterfaceConverter.php
InterfaceConverter.convert
public function convert(\DOMElement $parent, InterfaceDescriptor $interface) { $child = new \DOMElement('interface'); $parent->appendChild($child); /** @var InterfaceDescriptor $parentInterface */ foreach ($interface->getParent() as $parentInterface) { $parentFqcn = is_s...
php
public function convert(\DOMElement $parent, InterfaceDescriptor $interface) { $child = new \DOMElement('interface'); $parent->appendChild($child); /** @var InterfaceDescriptor $parentInterface */ foreach ($interface->getParent() as $parentInterface) { $parentFqcn = is_s...
[ "public", "function", "convert", "(", "\\", "DOMElement", "$", "parent", ",", "InterfaceDescriptor", "$", "interface", ")", "{", "$", "child", "=", "new", "\\", "DOMElement", "(", "'interface'", ")", ";", "$", "parent", "->", "appendChild", "(", "$", "chil...
Export the given reflected interface definition to the provided parent element. This method creates a new child element on the given parent XML element and takes the properties of the Reflection argument and sets the elements and attributes on the child. If a child DOMElement is provided then the properties and attri...
[ "Export", "the", "given", "reflected", "interface", "definition", "to", "the", "provided", "parent", "element", "." ]
train
https://github.com/heidelpay/PhpDoc/blob/5ac9e842cbd4cbb70900533b240c131f3515ee02/src/phpDocumentor/Plugin/Core/Transformer/Writer/Xml/InterfaceConverter.php#L66-L97
webdevvie/pheanstalk-task-queue-bundle
Command/WorkerTenderCommand.php
WorkerTenderCommand.execute
protected function execute( InputInterface $input, OutputInterface $output ) { $this->initialiseWorker($input, $output); $this->verboseOutput("<info>Starting up</info>"); while ($this->keepWorking) { //do stuff //check if the processes are still workin...
php
protected function execute( InputInterface $input, OutputInterface $output ) { $this->initialiseWorker($input, $output); $this->verboseOutput("<info>Starting up</info>"); while ($this->keepWorking) { //do stuff //check if the processes are still workin...
[ "protected", "function", "execute", "(", "InputInterface", "$", "input", ",", "OutputInterface", "$", "output", ")", "{", "$", "this", "->", "initialiseWorker", "(", "$", "input", ",", "$", "output", ")", ";", "$", "this", "->", "verboseOutput", "(", "\"<i...
{@inheritDoc} @param InputInterface $input @param OutputInterface $output @return void @throws \InvalidArgumentException
[ "{", "@inheritDoc", "}" ]
train
https://github.com/webdevvie/pheanstalk-task-queue-bundle/blob/db5e63a8f844e345dc2e69ce8e94b32d851020eb/Command/WorkerTenderCommand.php#L80-L97
webdevvie/pheanstalk-task-queue-bundle
Command/WorkerTenderCommand.php
WorkerTenderCommand.handle
private function handle($key, ChildProcessContainer $child) { $tube = $this->tube; $child->processOutput('child_' . $tube . $key); //send unhealthy child processes to bed (kill em off) if (!$child->checkHealth()) { $child->getReadyForBed(); } //send old ch...
php
private function handle($key, ChildProcessContainer $child) { $tube = $this->tube; $child->processOutput('child_' . $tube . $key); //send unhealthy child processes to bed (kill em off) if (!$child->checkHealth()) { $child->getReadyForBed(); } //send old ch...
[ "private", "function", "handle", "(", "$", "key", ",", "ChildProcessContainer", "$", "child", ")", "{", "$", "tube", "=", "$", "this", "->", "tube", ";", "$", "child", "->", "processOutput", "(", "'child_'", ".", "$", "tube", ".", "$", "key", ")", ";...
Handles all child communication things @param string $key @param ChildProcessContainer $child @return void
[ "Handles", "all", "child", "communication", "things" ]
train
https://github.com/webdevvie/pheanstalk-task-queue-bundle/blob/db5e63a8f844e345dc2e69ce8e94b32d851020eb/Command/WorkerTenderCommand.php#L106-L137
webdevvie/pheanstalk-task-queue-bundle
Command/WorkerTenderCommand.php
WorkerTenderCommand.familyPlanning
private function familyPlanning() { list($total, $available) = $this->countWorkers(); if ($this->shutdownGracefully) { if ($total > 0) { $this->verboseOutput("<info>Shutting down</info> $total remaining children"); foreach ($this->family as $cnr => $child)...
php
private function familyPlanning() { list($total, $available) = $this->countWorkers(); if ($this->shutdownGracefully) { if ($total > 0) { $this->verboseOutput("<info>Shutting down</info> $total remaining children"); foreach ($this->family as $cnr => $child)...
[ "private", "function", "familyPlanning", "(", ")", "{", "list", "(", "$", "total", ",", "$", "available", ")", "=", "$", "this", "->", "countWorkers", "(", ")", ";", "if", "(", "$", "this", "->", "shutdownGracefully", ")", "{", "if", "(", "$", "total...
Produce more hands for the work needed @return void
[ "Produce", "more", "hands", "for", "the", "work", "needed" ]
train
https://github.com/webdevvie/pheanstalk-task-queue-bundle/blob/db5e63a8f844e345dc2e69ce8e94b32d851020eb/Command/WorkerTenderCommand.php#L144-L171