repo
stringlengths
6
63
path
stringlengths
5
140
func_name
stringlengths
3
151
original_string
stringlengths
84
13k
language
stringclasses
1 value
code
stringlengths
84
13k
code_tokens
list
docstring
stringlengths
3
47.2k
docstring_tokens
list
sha
stringlengths
40
40
url
stringlengths
91
247
partition
stringclasses
1 value
Sectorr/Core
Sectorr/Core/Http/Route.php
Route.findRoute
public static function findRoute($route, $properties = []) { // Check if properties for dynamic routing are given. if (! empty($properties)) { // Loop through all the created routes foreach (self::$routes as $r) { // Check if the given route name is equal to...
php
public static function findRoute($route, $properties = []) { // Check if properties for dynamic routing are given. if (! empty($properties)) { // Loop through all the created routes foreach (self::$routes as $r) { // Check if the given route name is equal to...
[ "public", "static", "function", "findRoute", "(", "$", "route", ",", "$", "properties", "=", "[", "]", ")", "{", "// Check if properties for dynamic routing are given.", "if", "(", "!", "empty", "(", "$", "properties", ")", ")", "{", "// Loop through all the creat...
Finds a route by the given route name. Also takes properties to put into the route url. @param $route @param array $properties @return string
[ "Finds", "a", "route", "by", "the", "given", "route", "name", ".", "Also", "takes", "properties", "to", "put", "into", "the", "route", "url", "." ]
31df852dc6cc61642b0b87d9f0ae56c8e7da5a27
https://github.com/Sectorr/Core/blob/31df852dc6cc61642b0b87d9f0ae56c8e7da5a27/Sectorr/Core/Http/Route.php#L56-L95
train
Sectorr/Core
Sectorr/Core/Http/Route.php
Route.callController
private static function callController($route, $properties = []) { $props = $route['props']; $uses = $props['uses']; // Check if any middleware has been set. if (! empty($props['middleware'])) { if (! ctype_upper(substr($props['middleware'], 0, 1))) { $mi...
php
private static function callController($route, $properties = []) { $props = $route['props']; $uses = $props['uses']; // Check if any middleware has been set. if (! empty($props['middleware'])) { if (! ctype_upper(substr($props['middleware'], 0, 1))) { $mi...
[ "private", "static", "function", "callController", "(", "$", "route", ",", "$", "properties", "=", "[", "]", ")", "{", "$", "props", "=", "$", "route", "[", "'props'", "]", ";", "$", "uses", "=", "$", "props", "[", "'uses'", "]", ";", "// Check if an...
Call controller by route. @param $route @param array $properties @return @throws ControllerNotFoundException @throws MiddlewareNotFoundException
[ "Call", "controller", "by", "route", "." ]
31df852dc6cc61642b0b87d9f0ae56c8e7da5a27
https://github.com/Sectorr/Core/blob/31df852dc6cc61642b0b87d9f0ae56c8e7da5a27/Sectorr/Core/Http/Route.php#L118-L155
train
Sectorr/Core
Sectorr/Core/Http/Route.php
Route.execute
public static function execute($currentRoute) { $currentRouteParts = explode('/', $currentRoute); foreach (self::$routes as $route) { // Check if route matches complete URL. if ($route['url'] == $currentRoute) { return self::callController($route); ...
php
public static function execute($currentRoute) { $currentRouteParts = explode('/', $currentRoute); foreach (self::$routes as $route) { // Check if route matches complete URL. if ($route['url'] == $currentRoute) { return self::callController($route); ...
[ "public", "static", "function", "execute", "(", "$", "currentRoute", ")", "{", "$", "currentRouteParts", "=", "explode", "(", "'/'", ",", "$", "currentRoute", ")", ";", "foreach", "(", "self", "::", "$", "routes", "as", "$", "route", ")", "{", "// Check ...
Execute routing. @param $currentRoute @throws RouteNotFoundException @return
[ "Execute", "routing", "." ]
31df852dc6cc61642b0b87d9f0ae56c8e7da5a27
https://github.com/Sectorr/Core/blob/31df852dc6cc61642b0b87d9f0ae56c8e7da5a27/Sectorr/Core/Http/Route.php#L164-L216
train
flipbox/transformer
src/filters/TransformFilter.php
TransformFilter.transformDataProvider
protected function transformDataProvider(DataProviderInterface $dataProvider) { if (Craft::$app->getRequest()->getIsHead()) { return null; } else { if (!$transformer = $this->dataTransformer()) { return $dataProvider; } // The transfor...
php
protected function transformDataProvider(DataProviderInterface $dataProvider) { if (Craft::$app->getRequest()->getIsHead()) { return null; } else { if (!$transformer = $this->dataTransformer()) { return $dataProvider; } // The transfor...
[ "protected", "function", "transformDataProvider", "(", "DataProviderInterface", "$", "dataProvider", ")", "{", "if", "(", "Craft", "::", "$", "app", "->", "getRequest", "(", ")", "->", "getIsHead", "(", ")", ")", "{", "return", "null", ";", "}", "else", "{...
Serializes a data provider. @param DataProviderInterface $dataProvider @return array|DataProviderInterface the array representation of the data provider.
[ "Serializes", "a", "data", "provider", "." ]
1ca989b545f5e94520504a6890e2237610571726
https://github.com/flipbox/transformer/blob/1ca989b545f5e94520504a6890e2237610571726/src/filters/TransformFilter.php#L137-L161
train
WellCommerce/CategoryBundle
Manager/CategoryManager.php
CategoryManager.sortCategories
public function sortCategories(array $items) { $repository = $this->getRepository(); $em = $this->getDoctrineHelper()->getEntityManager(); foreach ($items as $item) { $parent = $repository->find($item['parent']); $child = $repository->find($item['id']); ...
php
public function sortCategories(array $items) { $repository = $this->getRepository(); $em = $this->getDoctrineHelper()->getEntityManager(); foreach ($items as $item) { $parent = $repository->find($item['parent']); $child = $repository->find($item['id']); ...
[ "public", "function", "sortCategories", "(", "array", "$", "items", ")", "{", "$", "repository", "=", "$", "this", "->", "getRepository", "(", ")", ";", "$", "em", "=", "$", "this", "->", "getDoctrineHelper", "(", ")", "->", "getEntityManager", "(", ")",...
Sorts categories passed in request @param array $items
[ "Sorts", "categories", "passed", "in", "request" ]
7a23ac678f91d15e86bdff624c4799be7b076e1a
https://github.com/WellCommerce/CategoryBundle/blob/7a23ac678f91d15e86bdff624c4799be7b076e1a/Manager/CategoryManager.php#L33-L49
train
WellCommerce/CategoryBundle
Manager/CategoryManager.php
CategoryManager.translateCategory
protected function translateCategory(Locale $locale, CategoryInterface $category, $name) { /** * @var $translation \WellCommerce\Bundle\CategoryBundle\Entity\CategoryTranslation */ $translation = $category->translate($locale->getCode()); $slug = $this->getLocaleSlug(...
php
protected function translateCategory(Locale $locale, CategoryInterface $category, $name) { /** * @var $translation \WellCommerce\Bundle\CategoryBundle\Entity\CategoryTranslation */ $translation = $category->translate($locale->getCode()); $slug = $this->getLocaleSlug(...
[ "protected", "function", "translateCategory", "(", "Locale", "$", "locale", ",", "CategoryInterface", "$", "category", ",", "$", "name", ")", "{", "/**\n * @var $translation \\WellCommerce\\Bundle\\CategoryBundle\\Entity\\CategoryTranslation\n */", "$", "translati...
Translates the category @param Locale $locale @param CategoryInterface $category @param string $name
[ "Translates", "the", "category" ]
7a23ac678f91d15e86bdff624c4799be7b076e1a
https://github.com/WellCommerce/CategoryBundle/blob/7a23ac678f91d15e86bdff624c4799be7b076e1a/Manager/CategoryManager.php#L87-L97
train
WellCommerce/CategoryBundle
Manager/CategoryManager.php
CategoryManager.getLocaleSlug
protected function getLocaleSlug(Locale $locale, $categoryName) { $slug = Sluggable::makeSlug($categoryName); $currentLocale = $this->getRequestHelper()->getCurrentLocale(); if ($locale->getCode() != $currentLocale) { $slug = Sluggable::makeSlug(sprintf('%s-%s', $categor...
php
protected function getLocaleSlug(Locale $locale, $categoryName) { $slug = Sluggable::makeSlug($categoryName); $currentLocale = $this->getRequestHelper()->getCurrentLocale(); if ($locale->getCode() != $currentLocale) { $slug = Sluggable::makeSlug(sprintf('%s-%s', $categor...
[ "protected", "function", "getLocaleSlug", "(", "Locale", "$", "locale", ",", "$", "categoryName", ")", "{", "$", "slug", "=", "Sluggable", "::", "makeSlug", "(", "$", "categoryName", ")", ";", "$", "currentLocale", "=", "$", "this", "->", "getRequestHelper",...
Returns category slug @param Locale $locale @param string $categoryName @return mixed|string
[ "Returns", "category", "slug" ]
7a23ac678f91d15e86bdff624c4799be7b076e1a
https://github.com/WellCommerce/CategoryBundle/blob/7a23ac678f91d15e86bdff624c4799be7b076e1a/Manager/CategoryManager.php#L107-L116
train
Blipfoto/php-sdk
src/Blipfoto/Api/Response.php
Response.data
public function data($key = null) { $data = $this->body['data']; if ($key !== null) { foreach (explode('.', $key) as $part) { if (isset($data[$part])) { $data = $data[$part]; } else { $data = null; break; } } } return $data; }
php
public function data($key = null) { $data = $this->body['data']; if ($key !== null) { foreach (explode('.', $key) as $part) { if (isset($data[$part])) { $data = $data[$part]; } else { $data = null; break; } } } return $data; }
[ "public", "function", "data", "(", "$", "key", "=", "null", ")", "{", "$", "data", "=", "$", "this", "->", "body", "[", "'data'", "]", ";", "if", "(", "$", "key", "!==", "null", ")", "{", "foreach", "(", "explode", "(", "'.'", ",", "$", "key", ...
Return the response's data, a key from the data, or null if the data or key does not exist. @param string $key (optional) @return mixed
[ "Return", "the", "response", "s", "data", "a", "key", "from", "the", "data", "or", "null", "if", "the", "data", "or", "key", "does", "not", "exist", "." ]
04f770ac7427e79d15f97b993c787651079cdeb4
https://github.com/Blipfoto/php-sdk/blob/04f770ac7427e79d15f97b993c787651079cdeb4/src/Blipfoto/Api/Response.php#L76-L89
train
Blipfoto/php-sdk
src/Blipfoto/Api/Response.php
Response.rateLimit
public function rateLimit($key = null) { return $key ? (isset($this->rate_limit[$key]) ? $this->rate_limit[$key] : null) : $this->rate_limit; }
php
public function rateLimit($key = null) { return $key ? (isset($this->rate_limit[$key]) ? $this->rate_limit[$key] : null) : $this->rate_limit; }
[ "public", "function", "rateLimit", "(", "$", "key", "=", "null", ")", "{", "return", "$", "key", "?", "(", "isset", "(", "$", "this", "->", "rate_limit", "[", "$", "key", "]", ")", "?", "$", "this", "->", "rate_limit", "[", "$", "key", "]", ":", ...
Return the response's rate limit info array, a key from the array, or null if the info or key does not exist. @param string $key (optional) @return mixed
[ "Return", "the", "response", "s", "rate", "limit", "info", "array", "a", "key", "from", "the", "array", "or", "null", "if", "the", "info", "or", "key", "does", "not", "exist", "." ]
04f770ac7427e79d15f97b993c787651079cdeb4
https://github.com/Blipfoto/php-sdk/blob/04f770ac7427e79d15f97b993c787651079cdeb4/src/Blipfoto/Api/Response.php#L97-L99
train
CalderaWP/caldera-interop
src/Traits/Rest/ProvidesHttpHeaders.php
ProvidesHttpHeaders.getHeader
public function getHeader(string $headerName) { return $this->hasHeader($headerName) ? $this->headers[ $headerName ] : null; }
php
public function getHeader(string $headerName) { return $this->hasHeader($headerName) ? $this->headers[ $headerName ] : null; }
[ "public", "function", "getHeader", "(", "string", "$", "headerName", ")", "{", "return", "$", "this", "->", "hasHeader", "(", "$", "headerName", ")", "?", "$", "this", "->", "headers", "[", "$", "headerName", "]", ":", "null", ";", "}" ]
Get header from request @param string $headerName @return string|null
[ "Get", "header", "from", "request" ]
d25c4bc930200b314fbd42d084080b5d85261c94
https://github.com/CalderaWP/caldera-interop/blob/d25c4bc930200b314fbd42d084080b5d85261c94/src/Traits/Rest/ProvidesHttpHeaders.php#L25-L28
train
CalderaWP/caldera-interop
src/Traits/Rest/ProvidesHttpHeaders.php
ProvidesHttpHeaders.setHeader
public function setHeader(string $headerName, $headerValue): HttpRequestContract { $this->headers[ $headerName ] = $headerValue; return $this; }
php
public function setHeader(string $headerName, $headerValue): HttpRequestContract { $this->headers[ $headerName ] = $headerValue; return $this; }
[ "public", "function", "setHeader", "(", "string", "$", "headerName", ",", "$", "headerValue", ")", ":", "HttpRequestContract", "{", "$", "this", "->", "headers", "[", "$", "headerName", "]", "=", "$", "headerValue", ";", "return", "$", "this", ";", "}" ]
Set header in request @param string $headerName @param mixed $headerValue @return HttpRequestContract
[ "Set", "header", "in", "request" ]
d25c4bc930200b314fbd42d084080b5d85261c94
https://github.com/CalderaWP/caldera-interop/blob/d25c4bc930200b314fbd42d084080b5d85261c94/src/Traits/Rest/ProvidesHttpHeaders.php#L53-L57
train
nails/module-blog
blog/controllers/_blog.php
NAILS_Blog_Controller.loadSkinAssets
protected function loadSkinAssets($aAssets, $aCssInline, $aJsInline, $sUrl) { $oAsset = Factory::service('Asset'); // CSS and JS if (!empty($aAssets) && is_array($aAssets)) { foreach ($aAssets as $asset) { if (is_string($asset)) { $oAsset->lo...
php
protected function loadSkinAssets($aAssets, $aCssInline, $aJsInline, $sUrl) { $oAsset = Factory::service('Asset'); // CSS and JS if (!empty($aAssets) && is_array($aAssets)) { foreach ($aAssets as $asset) { if (is_string($asset)) { $oAsset->lo...
[ "protected", "function", "loadSkinAssets", "(", "$", "aAssets", ",", "$", "aCssInline", ",", "$", "aJsInline", ",", "$", "sUrl", ")", "{", "$", "oAsset", "=", "Factory", "::", "service", "(", "'Asset'", ")", ";", "// CSS and JS", "if", "(", "!", "empty"...
Loads any assets required by the skin @param array $aAssets An array of skin assets @param array $aCssInline An array of inline CSS @param array $aJsInline An array of inline JS @param string $sUrl The URL to the skin's root directory @return void
[ "Loads", "any", "assets", "required", "by", "the", "skin" ]
7b369c5209f4343fff7c7e2a22c237d5a95c8c24
https://github.com/nails/module-blog/blob/7b369c5209f4343fff7c7e2a22c237d5a95c8c24/blog/controllers/_blog.php#L165-L199
train
swokit/utils
src/AsyncTimer.php
AsyncTimer.tick
public static function tick(float $ms, callable $callback, $params = null) { $tid = Timer::tick($ms, $callback, $params); // save meta info self::$timers[$tid] = [ 'type' => 'tick', 'ctime' => \time(), // add time. 'interval' => $ms, ]; ...
php
public static function tick(float $ms, callable $callback, $params = null) { $tid = Timer::tick($ms, $callback, $params); // save meta info self::$timers[$tid] = [ 'type' => 'tick', 'ctime' => \time(), // add time. 'interval' => $ms, ]; ...
[ "public", "static", "function", "tick", "(", "float", "$", "ms", ",", "callable", "$", "callback", ",", "$", "params", "=", "null", ")", "{", "$", "tid", "=", "Timer", "::", "tick", "(", "$", "ms", ",", "$", "callback", ",", "$", "params", ")", "...
add a interval timer @param float $ms @param callable $callback @param mixed $params @return mixed
[ "add", "a", "interval", "timer" ]
a91688ee6970e33be14047bf4714da3299796f56
https://github.com/swokit/utils/blob/a91688ee6970e33be14047bf4714da3299796f56/src/AsyncTimer.php#L31-L43
train
fridge-project/dbal
src/Fridge/DBAL/Type/Type.php
Type.getType
public static function getType($type) { if (!isset(static::$mappedTypeInstances[$type])) { if (!static::hasType($type)) { throw TypeException::typeDoesNotExist($type); } static::$mappedTypeInstances[$type] = new static::$mappedTypeClasses[$type](); ...
php
public static function getType($type) { if (!isset(static::$mappedTypeInstances[$type])) { if (!static::hasType($type)) { throw TypeException::typeDoesNotExist($type); } static::$mappedTypeInstances[$type] = new static::$mappedTypeClasses[$type](); ...
[ "public", "static", "function", "getType", "(", "$", "type", ")", "{", "if", "(", "!", "isset", "(", "static", "::", "$", "mappedTypeInstances", "[", "$", "type", "]", ")", ")", "{", "if", "(", "!", "static", "::", "hasType", "(", "$", "type", ")",...
Gets a type. @param string $type The type name. @throws \Fridge\DBAL\Exception\TypeException If the type does not exist. @return \Fridge\DBAL\Type\TypeInterface The type.
[ "Gets", "a", "type", "." ]
d0b8c3551922d696836487aa0eb1bd74014edcd4
https://github.com/fridge-project/dbal/blob/d0b8c3551922d696836487aa0eb1bd74014edcd4/src/Fridge/DBAL/Type/Type.php#L108-L119
train
fridge-project/dbal
src/Fridge/DBAL/Type/Type.php
Type.overrideType
public static function overrideType($type, $class) { if (!static::hasType($type)) { throw TypeException::typeDoesNotExist($type); } if (!class_exists($class)) { throw TypeException::classNotFound($class); } if (!in_array('Fridge\DBAL\Type\TypeInterfa...
php
public static function overrideType($type, $class) { if (!static::hasType($type)) { throw TypeException::typeDoesNotExist($type); } if (!class_exists($class)) { throw TypeException::classNotFound($class); } if (!in_array('Fridge\DBAL\Type\TypeInterfa...
[ "public", "static", "function", "overrideType", "(", "$", "type", ",", "$", "class", ")", "{", "if", "(", "!", "static", "::", "hasType", "(", "$", "type", ")", ")", "{", "throw", "TypeException", "::", "typeDoesNotExist", "(", "$", "type", ")", ";", ...
Overrides an existing type. @param string $type The type name. @param string $class The type class. @throws \Fridge\DBAL\Exception\TypeException If the type does not exist, if the class can not be found or if the class does not implement the TypeInterface.
[ "Overrides", "an", "existing", "type", "." ]
d0b8c3551922d696836487aa0eb1bd74014edcd4
https://github.com/fridge-project/dbal/blob/d0b8c3551922d696836487aa0eb1bd74014edcd4/src/Fridge/DBAL/Type/Type.php#L156-L175
train
danielgp/common-lib
source/MySQLiByDanielGPnumbers.php
MySQLiByDanielGPnumbers.getFieldOutputEnumSetReadOnly
protected function getFieldOutputEnumSetReadOnly($val, $adnlThings) { $inputFeatures = [ 'name' => $val['COLUMN_NAME'] . $adnlThings['suffix'], 'id' => $val['COLUMN_NAME'], 'readonly' => 'readonly', 'class' => 'input_readonly', 'size' ...
php
protected function getFieldOutputEnumSetReadOnly($val, $adnlThings) { $inputFeatures = [ 'name' => $val['COLUMN_NAME'] . $adnlThings['suffix'], 'id' => $val['COLUMN_NAME'], 'readonly' => 'readonly', 'class' => 'input_readonly', 'size' ...
[ "protected", "function", "getFieldOutputEnumSetReadOnly", "(", "$", "val", ",", "$", "adnlThings", ")", "{", "$", "inputFeatures", "=", "[", "'name'", "=>", "$", "val", "[", "'COLUMN_NAME'", "]", ".", "$", "adnlThings", "[", "'suffix'", "]", ",", "'id'", "...
Creates an input for ENUM or SET if marked Read-Only @param array $val @param array $adnlThings @return string
[ "Creates", "an", "input", "for", "ENUM", "or", "SET", "if", "marked", "Read", "-", "Only" ]
627b99b4408414c7cd21a6c8016f6468dc9216b2
https://github.com/danielgp/common-lib/blob/627b99b4408414c7cd21a6c8016f6468dc9216b2/source/MySQLiByDanielGPnumbers.php#L48-L59
train
danielgp/common-lib
source/MySQLiByDanielGPnumbers.php
MySQLiByDanielGPnumbers.getFieldOutputTT
protected function getFieldOutputTT($value, $szN, $iar = []) { $inAdtnl = [ 'id' => $value['COLUMN_NAME'], 'maxlength' => $szN, 'name' => $value['COLUMN_NAME'], 'size' => $szN, 'type' => 'text', 'value' => $thi...
php
protected function getFieldOutputTT($value, $szN, $iar = []) { $inAdtnl = [ 'id' => $value['COLUMN_NAME'], 'maxlength' => $szN, 'name' => $value['COLUMN_NAME'], 'size' => $szN, 'type' => 'text', 'value' => $thi...
[ "protected", "function", "getFieldOutputTT", "(", "$", "value", ",", "$", "szN", ",", "$", "iar", "=", "[", "]", ")", "{", "$", "inAdtnl", "=", "[", "'id'", "=>", "$", "value", "[", "'COLUMN_NAME'", "]", ",", "'maxlength'", "=>", "$", "szN", ",", "...
Builds output as text input type @param array $value @param integer $szN @param array $iar @return string
[ "Builds", "output", "as", "text", "input", "type" ]
627b99b4408414c7cd21a6c8016f6468dc9216b2
https://github.com/danielgp/common-lib/blob/627b99b4408414c7cd21a6c8016f6468dc9216b2/source/MySQLiByDanielGPnumbers.php#L69-L83
train
danielgp/common-lib
source/MySQLiByDanielGPnumbers.php
MySQLiByDanielGPnumbers.getFieldValue
protected function getFieldValue($details) { $this->initializeSprGlbAndSession(); $rqCN = $this->tCmnRequest->request->get($details['COLUMN_NAME']); if (!is_null($rqCN)) { if (($details['IS_NULLABLE'] == 'YES') && ($rqCN == '')) { return 'NULL'; } ...
php
protected function getFieldValue($details) { $this->initializeSprGlbAndSession(); $rqCN = $this->tCmnRequest->request->get($details['COLUMN_NAME']); if (!is_null($rqCN)) { if (($details['IS_NULLABLE'] == 'YES') && ($rqCN == '')) { return 'NULL'; } ...
[ "protected", "function", "getFieldValue", "(", "$", "details", ")", "{", "$", "this", "->", "initializeSprGlbAndSession", "(", ")", ";", "$", "rqCN", "=", "$", "this", "->", "tCmnRequest", "->", "request", "->", "get", "(", "$", "details", "[", "'COLUMN_NA...
Returns given value for a field from REQUEST global variable @param array $details @return string
[ "Returns", "given", "value", "for", "a", "field", "from", "REQUEST", "global", "variable" ]
627b99b4408414c7cd21a6c8016f6468dc9216b2
https://github.com/danielgp/common-lib/blob/627b99b4408414c7cd21a6c8016f6468dc9216b2/source/MySQLiByDanielGPnumbers.php#L91-L102
train
danielgp/common-lib
source/MySQLiByDanielGPnumbers.php
MySQLiByDanielGPnumbers.setFieldLabel
protected function setFieldLabel($details, $features, $fieldLabel) { $aLabel = ['for' => $details['COLUMN_NAME'], 'id' => $details['COLUMN_NAME'] . '_label']; if (isset($features['disabled'])) { if (in_array($details['COLUMN_NAME'], $features['disabled'])) { $aLabel = arr...
php
protected function setFieldLabel($details, $features, $fieldLabel) { $aLabel = ['for' => $details['COLUMN_NAME'], 'id' => $details['COLUMN_NAME'] . '_label']; if (isset($features['disabled'])) { if (in_array($details['COLUMN_NAME'], $features['disabled'])) { $aLabel = arr...
[ "protected", "function", "setFieldLabel", "(", "$", "details", ",", "$", "features", ",", "$", "fieldLabel", ")", "{", "$", "aLabel", "=", "[", "'for'", "=>", "$", "details", "[", "'COLUMN_NAME'", "]", ",", "'id'", "=>", "$", "details", "[", "'COLUMN_NAM...
Prepares the label for inputs @param array $details @param array $features @param string $fieldLabel @return string
[ "Prepares", "the", "label", "for", "inputs" ]
627b99b4408414c7cd21a6c8016f6468dc9216b2
https://github.com/danielgp/common-lib/blob/627b99b4408414c7cd21a6c8016f6468dc9216b2/source/MySQLiByDanielGPnumbers.php#L129-L138
train
danielgp/common-lib
source/MySQLiByDanielGPnumbers.php
MySQLiByDanielGPnumbers.setFieldNumbers
protected function setFieldNumbers($fieldDetails, $outputFormated = false) { $sRtrn = $this->setFieldSpecific($fieldDetails); if ($outputFormated) { foreach ($sRtrn as $key => $value) { $sRtrn[$key] = $this->setNumberFormat($value); } } return ...
php
protected function setFieldNumbers($fieldDetails, $outputFormated = false) { $sRtrn = $this->setFieldSpecific($fieldDetails); if ($outputFormated) { foreach ($sRtrn as $key => $value) { $sRtrn[$key] = $this->setNumberFormat($value); } } return ...
[ "protected", "function", "setFieldNumbers", "(", "$", "fieldDetails", ",", "$", "outputFormated", "=", "false", ")", "{", "$", "sRtrn", "=", "$", "this", "->", "setFieldSpecific", "(", "$", "fieldDetails", ")", ";", "if", "(", "$", "outputFormated", ")", "...
Returns maximum length for a given MySQL field @param array $fieldDetails @param boolean $outputFormated @return array
[ "Returns", "maximum", "length", "for", "a", "given", "MySQL", "field" ]
627b99b4408414c7cd21a6c8016f6468dc9216b2
https://github.com/danielgp/common-lib/blob/627b99b4408414c7cd21a6c8016f6468dc9216b2/source/MySQLiByDanielGPnumbers.php#L147-L156
train
danielgp/common-lib
source/MySQLiByDanielGPnumbers.php
MySQLiByDanielGPnumbers.setFieldSpecific
private function setFieldSpecific($fieldDetails) { if (in_array($fieldDetails['DATA_TYPE'], ['char', 'varchar', 'tinytext', 'text', 'mediumtext', 'longtext'])) { return ['M' => $fieldDetails['CHARACTER_MAXIMUM_LENGTH']]; } elseif (in_array($fieldDetails['DATA_TYPE'], ['decimal', 'numeric...
php
private function setFieldSpecific($fieldDetails) { if (in_array($fieldDetails['DATA_TYPE'], ['char', 'varchar', 'tinytext', 'text', 'mediumtext', 'longtext'])) { return ['M' => $fieldDetails['CHARACTER_MAXIMUM_LENGTH']]; } elseif (in_array($fieldDetails['DATA_TYPE'], ['decimal', 'numeric...
[ "private", "function", "setFieldSpecific", "(", "$", "fieldDetails", ")", "{", "if", "(", "in_array", "(", "$", "fieldDetails", "[", "'DATA_TYPE'", "]", ",", "[", "'char'", ",", "'varchar'", ",", "'tinytext'", ",", "'text'", ",", "'mediumtext'", ",", "'longt...
Establishes numbers of fields @param array $fieldDetails @return array
[ "Establishes", "numbers", "of", "fields" ]
627b99b4408414c7cd21a6c8016f6468dc9216b2
https://github.com/danielgp/common-lib/blob/627b99b4408414c7cd21a6c8016f6468dc9216b2/source/MySQLiByDanielGPnumbers.php#L164-L174
train
danielgp/common-lib
source/MySQLiByDanielGPnumbers.php
MySQLiByDanielGPnumbers.setFormButtons
protected function setFormButtons($feat, $hiddenInfo = []) { $btn = []; $btn[] = '<input type="submit" id="submit" style="margin-left:220px;" value="' . $this->lclMsgCmn('i18n_Form_ButtonSave') . '" />'; if (isset($feat['insertAndUpdate'])) { $btn[] = '<input type="...
php
protected function setFormButtons($feat, $hiddenInfo = []) { $btn = []; $btn[] = '<input type="submit" id="submit" style="margin-left:220px;" value="' . $this->lclMsgCmn('i18n_Form_ButtonSave') . '" />'; if (isset($feat['insertAndUpdate'])) { $btn[] = '<input type="...
[ "protected", "function", "setFormButtons", "(", "$", "feat", ",", "$", "hiddenInfo", "=", "[", "]", ")", "{", "$", "btn", "=", "[", "]", ";", "$", "btn", "[", "]", "=", "'<input type=\"submit\" id=\"submit\" style=\"margin-left:220px;\" value=\"'", ".", "$", "...
Form default buttons @param array $feat @param array $hiddenInfo @return string
[ "Form", "default", "buttons" ]
627b99b4408414c7cd21a6c8016f6468dc9216b2
https://github.com/danielgp/common-lib/blob/627b99b4408414c7cd21a6c8016f6468dc9216b2/source/MySQLiByDanielGPnumbers.php#L216-L230
train
rawphp/RawMail
src/RawPHP/RawMail/Mail.php
Mail.init
public function init( $config = NULL ) { $this->mailer = new PHPMailer(); foreach ( $config as $key => $value ) { switch ( $key ) { case 'from_email': $this->mailer->From = $value; break; case '...
php
public function init( $config = NULL ) { $this->mailer = new PHPMailer(); foreach ( $config as $key => $value ) { switch ( $key ) { case 'from_email': $this->mailer->From = $value; break; case '...
[ "public", "function", "init", "(", "$", "config", "=", "NULL", ")", "{", "$", "this", "->", "mailer", "=", "new", "PHPMailer", "(", ")", ";", "foreach", "(", "$", "config", "as", "$", "key", "=>", "$", "value", ")", "{", "switch", "(", "$", "key"...
Initialises the mailer. @param array $config configuration array @action ON_INIT_ACTION
[ "Initialises", "the", "mailer", "." ]
b84e7cc76b7e5db87ea8aabd77417f72162f47ab
https://github.com/rawphp/RawMail/blob/b84e7cc76b7e5db87ea8aabd77417f72162f47ab/src/RawPHP/RawMail/Mail.php#L87-L134
train
rawphp/RawMail
src/RawPHP/RawMail/Mail.php
Mail.addCC
public function addCC( $email ) { if ( is_array( $email ) ) { $this->mailer->addCC( $email[ 'email' ], $email[ 'name' ] ); } else { $this->mailer->addCC( $email ); } }
php
public function addCC( $email ) { if ( is_array( $email ) ) { $this->mailer->addCC( $email[ 'email' ], $email[ 'name' ] ); } else { $this->mailer->addCC( $email ); } }
[ "public", "function", "addCC", "(", "$", "email", ")", "{", "if", "(", "is_array", "(", "$", "email", ")", ")", "{", "$", "this", "->", "mailer", "->", "addCC", "(", "$", "email", "[", "'email'", "]", ",", "$", "email", "[", "'name'", "]", ")", ...
Adds a CC address to the email. @param mixed $email email string or email|name array array( 'name' => 'Information', 'email' => 'name@email.com' ); @action ON_ADD_CC_ACTION
[ "Adds", "a", "CC", "address", "to", "the", "email", "." ]
b84e7cc76b7e5db87ea8aabd77417f72162f47ab
https://github.com/rawphp/RawMail/blob/b84e7cc76b7e5db87ea8aabd77417f72162f47ab/src/RawPHP/RawMail/Mail.php#L216-L226
train
rawphp/RawMail
src/RawPHP/RawMail/Mail.php
Mail.addBCC
public function addBCC( $email ) { if ( is_array( $email ) ) { $this->mailer->addBCC( $email[ 'email' ], $email[ 'name' ] ); } else { $this->mailer->addBCC( $email ); } }
php
public function addBCC( $email ) { if ( is_array( $email ) ) { $this->mailer->addBCC( $email[ 'email' ], $email[ 'name' ] ); } else { $this->mailer->addBCC( $email ); } }
[ "public", "function", "addBCC", "(", "$", "email", ")", "{", "if", "(", "is_array", "(", "$", "email", ")", ")", "{", "$", "this", "->", "mailer", "->", "addBCC", "(", "$", "email", "[", "'email'", "]", ",", "$", "email", "[", "'name'", "]", ")",...
Adds a BCC address to the email. @param mixed $email email string or email|name array array( 'name' => 'Information', 'email' => 'name@email.com' ); @action ON_ADD_BCC_ACTION
[ "Adds", "a", "BCC", "address", "to", "the", "email", "." ]
b84e7cc76b7e5db87ea8aabd77417f72162f47ab
https://github.com/rawphp/RawMail/blob/b84e7cc76b7e5db87ea8aabd77417f72162f47ab/src/RawPHP/RawMail/Mail.php#L236-L246
train
lightwerk/SurfCaptain
Classes/Lightwerk/SurfCaptain/Domain/Model/Deployment.php
Deployment.getReferenceName
public function getReferenceName() { $options = $this->getOptions(); if (!empty($options['tag'])) { return 'Tag: ' . $options['tag']; } elseif (!empty($options['branch'])) { return 'Branch: ' . $options['branch']; } elseif (!empty($options['sha1'])) { ...
php
public function getReferenceName() { $options = $this->getOptions(); if (!empty($options['tag'])) { return 'Tag: ' . $options['tag']; } elseif (!empty($options['branch'])) { return 'Branch: ' . $options['branch']; } elseif (!empty($options['sha1'])) { ...
[ "public", "function", "getReferenceName", "(", ")", "{", "$", "options", "=", "$", "this", "->", "getOptions", "(", ")", ";", "if", "(", "!", "empty", "(", "$", "options", "[", "'tag'", "]", ")", ")", "{", "return", "'Tag: '", ".", "$", "options", ...
Since sha1 is always shipped with branch and tag configuration, we consider it for referenceName only if neither tag nor branch was set. @return string
[ "Since", "sha1", "is", "always", "shipped", "with", "branch", "and", "tag", "configuration", "we", "consider", "it", "for", "referenceName", "only", "if", "neither", "tag", "nor", "branch", "was", "set", "." ]
2865e963fd634504d8923902cf422873749a0940
https://github.com/lightwerk/SurfCaptain/blob/2865e963fd634504d8923902cf422873749a0940/Classes/Lightwerk/SurfCaptain/Domain/Model/Deployment.php#L211-L222
train
ReindeerWeb/ClassHelper
src/ClassHelper.php
ClassHelper.singleton
public static function singleton($class = null) { if (!$class) { $class = get_called_class(); } if (!isset(self::$singletons[$class])) { self::$singletons[$class] = self::create($class); } return self::$singletons[$class]; }
php
public static function singleton($class = null) { if (!$class) { $class = get_called_class(); } if (!isset(self::$singletons[$class])) { self::$singletons[$class] = self::create($class); } return self::$singletons[$class]; }
[ "public", "static", "function", "singleton", "(", "$", "class", "=", "null", ")", "{", "if", "(", "!", "$", "class", ")", "{", "$", "class", "=", "get_called_class", "(", ")", ";", "}", "if", "(", "!", "isset", "(", "self", "::", "$", "singletons",...
Creates a class instance by the "singleton" design pattern. It will always return the same instance for this class. @param string $class Optional classname to create, if the called class should not be used @return static The singleton instance
[ "Creates", "a", "class", "instance", "by", "the", "singleton", "design", "pattern", ".", "It", "will", "always", "return", "the", "same", "instance", "for", "this", "class", "." ]
5d53f884d5d4e790c659ac5c5a0c155076ac8c3a
https://github.com/ReindeerWeb/ClassHelper/blob/5d53f884d5d4e790c659ac5c5a0c155076ac8c3a/src/ClassHelper.php#L62-L73
train
climphp/Clim
Clim/App.php
App.handleException
protected function handleException(Exception $e) { // if ($e instanceof MethodNotAllowedException) { // $handler = 'notAllowedHandler'; // $params = [$e->getRequest(), $e->getResponse(), $e->getAllowedMethods()]; // } elseif ($e instanceof NotFoundException) { // ...
php
protected function handleException(Exception $e) { // if ($e instanceof MethodNotAllowedException) { // $handler = 'notAllowedHandler'; // $params = [$e->getRequest(), $e->getResponse(), $e->getAllowedMethods()]; // } elseif ($e instanceof NotFoundException) { // ...
[ "protected", "function", "handleException", "(", "Exception", "$", "e", ")", "{", "// if ($e instanceof MethodNotAllowedException) {", "// $handler = 'notAllowedHandler';", "// $params = [$e->getRequest(), $e->getResponse(), $e->getAllowedMethods()];", "// } elseif ($e instanceof Not...
Call relevant handler from the Container if needed. If it doesn't exist, then just print error @param Exception $e @return Context
[ "Call", "relevant", "handler", "from", "the", "Container", "if", "needed", ".", "If", "it", "doesn", "t", "exist", "then", "just", "print", "error" ]
d2d09a82e1b7a0b8d454e585e6db421ff02ec8e4
https://github.com/climphp/Clim/blob/d2d09a82e1b7a0b8d454e585e6db421ff02ec8e4/Clim/App.php#L180-L206
train
Linkvalue-Interne/MajoraFrameworkExtraBundle
src/Majora/Framework/Loader/Bridge/Api/ApiLoaderTrait.php
ApiLoaderTrait.apiCall
private function apiCall( $method, array $query = array(), callable $onSuccess, $emptyValue = null ) { try { return $onSuccess( $this->restApiClient->$method($query) ); } catch (BadResponseException $e) { if (($respo...
php
private function apiCall( $method, array $query = array(), callable $onSuccess, $emptyValue = null ) { try { return $onSuccess( $this->restApiClient->$method($query) ); } catch (BadResponseException $e) { if (($respo...
[ "private", "function", "apiCall", "(", "$", "method", ",", "array", "$", "query", "=", "array", "(", ")", ",", "callable", "$", "onSuccess", ",", "$", "emptyValue", "=", "null", ")", "{", "try", "{", "return", "$", "onSuccess", "(", "$", "this", "->"...
Performs an Api call on given method. @param string $method @param array $query @param callable $onSuccess @param mixed $emptyValue
[ "Performs", "an", "Api", "call", "on", "given", "method", "." ]
6f368380cfc39d27fafb0844e9a53b4d86d7c034
https://github.com/Linkvalue-Interne/MajoraFrameworkExtraBundle/blob/6f368380cfc39d27fafb0844e9a53b4d86d7c034/src/Majora/Framework/Loader/Bridge/Api/ApiLoaderTrait.php#L68-L87
train
helsingborg-stad/better-post-UI
source/php/Components/PageAttributes.php
PageAttributes.hasKey
public function hasKey(string $needle, array $haystack) : bool { foreach ($haystack as $key => $value) { if ($key === $needle) { return true; } if (is_array($value)) { if ($x = $this->hasKey($needle, $value)) { return $...
php
public function hasKey(string $needle, array $haystack) : bool { foreach ($haystack as $key => $value) { if ($key === $needle) { return true; } if (is_array($value)) { if ($x = $this->hasKey($needle, $value)) { return $...
[ "public", "function", "hasKey", "(", "string", "$", "needle", ",", "array", "$", "haystack", ")", ":", "bool", "{", "foreach", "(", "$", "haystack", "as", "$", "key", "=>", "$", "value", ")", "{", "if", "(", "$", "key", "===", "$", "needle", ")", ...
Check if array has key recursivly @param string $needle Array key to find @param array $haystack Array to search @return boolean
[ "Check", "if", "array", "has", "key", "recursivly" ]
0454e8d6f42787244d02f0e976825ed8dca579f0
https://github.com/helsingborg-stad/better-post-UI/blob/0454e8d6f42787244d02f0e976825ed8dca579f0/source/php/Components/PageAttributes.php#L56-L71
train
PatrolServer/patrolsdk-php
lib/Bucket.php
Bucket.save
public function save() { $bucket = $this->_post('servers/' . $this->server_id . '/software_bucket/' . $this->key, $this->dirty_values); $this->mergeValues($bucket); }
php
public function save() { $bucket = $this->_post('servers/' . $this->server_id . '/software_bucket/' . $this->key, $this->dirty_values); $this->mergeValues($bucket); }
[ "public", "function", "save", "(", ")", "{", "$", "bucket", "=", "$", "this", "->", "_post", "(", "'servers/'", ".", "$", "this", "->", "server_id", ".", "'/software_bucket/'", ".", "$", "this", "->", "key", ",", "$", "this", "->", "dirty_values", ")",...
Saves a bucket, if the bucket does not exist, a new bucket will be created
[ "Saves", "a", "bucket", "if", "the", "bucket", "does", "not", "exist", "a", "new", "bucket", "will", "be", "created" ]
2451f0d2ba2bb5bc3d7e47cfc110f7f272620db2
https://github.com/PatrolServer/patrolsdk-php/blob/2451f0d2ba2bb5bc3d7e47cfc110f7f272620db2/lib/Bucket.php#L42-L45
train
stubbles/stubbles-webapp-session
src/main/php/id/NoneDurableSessionId.php
NoneDurableSessionId.name
public function name() { if (null === $this->sessionName) { $characters = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'; $this->sessionName = ''; for ($i = 0; $i < 32; $i++) { $this->sessionName .= $characters[rand(0, strlen($characters)...
php
public function name() { if (null === $this->sessionName) { $characters = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'; $this->sessionName = ''; for ($i = 0; $i < 32; $i++) { $this->sessionName .= $characters[rand(0, strlen($characters)...
[ "public", "function", "name", "(", ")", "{", "if", "(", "null", "===", "$", "this", "->", "sessionName", ")", "{", "$", "characters", "=", "'0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'", ";", "$", "this", "->", "sessionName", "=", "''", ";", ...
returns session name @return string
[ "returns", "session", "name" ]
2976fa28995bfb6ad00e3eac59ad689dd7892450
https://github.com/stubbles/stubbles-webapp-session/blob/2976fa28995bfb6ad00e3eac59ad689dd7892450/src/main/php/id/NoneDurableSessionId.php#L49-L60
train
attogram/shared-media-orm
src/Attogram/SharedMedia/Orm/Map/C2PTableMap.php
C2PTableMap.doInsert
public static function doInsert($criteria, ConnectionInterface $con = null) { if (null === $con) { $con = Propel::getServiceContainer()->getWriteConnection(C2PTableMap::DATABASE_NAME); } if ($criteria instanceof Criteria) { $criteria = clone $criteria; // rename for ...
php
public static function doInsert($criteria, ConnectionInterface $con = null) { if (null === $con) { $con = Propel::getServiceContainer()->getWriteConnection(C2PTableMap::DATABASE_NAME); } if ($criteria instanceof Criteria) { $criteria = clone $criteria; // rename for ...
[ "public", "static", "function", "doInsert", "(", "$", "criteria", ",", "ConnectionInterface", "$", "con", "=", "null", ")", "{", "if", "(", "null", "===", "$", "con", ")", "{", "$", "con", "=", "Propel", "::", "getServiceContainer", "(", ")", "->", "ge...
Performs an INSERT on the database, given a C2P or Criteria object. @param mixed $criteria Criteria or C2P object containing data that is used to create the INSERT statement. @param ConnectionInterface $con the ConnectionInterface connection to use @return mixed The new primary key. @throws Pro...
[ "Performs", "an", "INSERT", "on", "the", "database", "given", "a", "C2P", "or", "Criteria", "object", "." ]
81b5ef7d749b1e50f51e95747ce24cf8ce6f21d8
https://github.com/attogram/shared-media-orm/blob/81b5ef7d749b1e50f51e95747ce24cf8ce6f21d8/src/Attogram/SharedMedia/Orm/Map/C2PTableMap.php#L464-L485
train
mullanaphy/variable
src/PHY/Variable.php
Variable.convertVariableTo
public static function convertVariableTo(\PHY\Variable\AVar $variable, $convertTo = 'Obj') { $method = 'to'.$convertTo; if (!is_callable([$variable, $method])) { throw new \PHY\Variable\Exception('Could not convert "'.$variable->getType().'" to "'.$convertTo.'"'); ...
php
public static function convertVariableTo(\PHY\Variable\AVar $variable, $convertTo = 'Obj') { $method = 'to'.$convertTo; if (!is_callable([$variable, $method])) { throw new \PHY\Variable\Exception('Could not convert "'.$variable->getType().'" to "'.$convertTo.'"'); ...
[ "public", "static", "function", "convertVariableTo", "(", "\\", "PHY", "\\", "Variable", "\\", "AVar", "$", "variable", ",", "$", "convertTo", "=", "'Obj'", ")", "{", "$", "method", "=", "'to'", ".", "$", "convertTo", ";", "if", "(", "!", "is_callable", ...
Convert a variable to a different type. @param \PHY\Variable\AVar $variable @param string $convertTo @return \PHY\Variable\AVar
[ "Convert", "a", "variable", "to", "a", "different", "type", "." ]
e4eb274a1799a25e33e5e21cd260603c74628031
https://github.com/mullanaphy/variable/blob/e4eb274a1799a25e33e5e21cd260603c74628031/src/PHY/Variable.php#L50-L58
train
sourceboxio/sdk
src/Register/MicroService.php
MicroService.registerRoutes
protected function registerRoutes() { $http = Arr::get($this->triggers, 'http'); if (is_null($http)) { return; } // Validar try { Validator::validate($http, ['route' => 'required', 'methods' => 'required', 'function' => 'required']); } catch (...
php
protected function registerRoutes() { $http = Arr::get($this->triggers, 'http'); if (is_null($http)) { return; } // Validar try { Validator::validate($http, ['route' => 'required', 'methods' => 'required', 'function' => 'required']); } catch (...
[ "protected", "function", "registerRoutes", "(", ")", "{", "$", "http", "=", "Arr", "::", "get", "(", "$", "this", "->", "triggers", ",", "'http'", ")", ";", "if", "(", "is_null", "(", "$", "http", ")", ")", "{", "return", ";", "}", "// Validar", "t...
Registrar rotas.
[ "Registrar", "rotas", "." ]
e16e9e92580d48c2a348d119c2829a8d38528681
https://github.com/sourceboxio/sdk/blob/e16e9e92580d48c2a348d119c2829a8d38528681/src/Register/MicroService.php#L76-L111
train
Dhii/exception-helper-base
src/CreateRuntimeExceptionCapableTrait.php
CreateRuntimeExceptionCapableTrait._createRuntimeException
protected function _createRuntimeException($message = null, $code = null, $previous = null) { return new RuntimeException($message, $code, $previous); }
php
protected function _createRuntimeException($message = null, $code = null, $previous = null) { return new RuntimeException($message, $code, $previous); }
[ "protected", "function", "_createRuntimeException", "(", "$", "message", "=", "null", ",", "$", "code", "=", "null", ",", "$", "previous", "=", "null", ")", "{", "return", "new", "RuntimeException", "(", "$", "message", ",", "$", "code", ",", "$", "previ...
Creates a new Runtime exception. @since [*next-version*] @param string|Stringable|int|float|bool|null $message The message, if any. @param int|float|string|Stringable|null $code The numeric error code, if any. @param RootException|null $previous The inner exception, if any. @return Runti...
[ "Creates", "a", "new", "Runtime", "exception", "." ]
e97bfa6c0f79ea079e36b2f1d8f84d7566a3ccf5
https://github.com/Dhii/exception-helper-base/blob/e97bfa6c0f79ea079e36b2f1d8f84d7566a3ccf5/src/CreateRuntimeExceptionCapableTrait.php#L26-L29
train
jenskooij/cloudcontrol
src/storage/Repository.php
Repository.init
public function init($baseStorageDefaultPath, $baseStorageSqlPath) { $storageDefaultPath = realpath($baseStorageDefaultPath); $contentSqlPath = realpath($baseStorageSqlPath); $this->initConfigStorage($storageDefaultPath); $this->initContentDb($contentSqlPath); $this->save()...
php
public function init($baseStorageDefaultPath, $baseStorageSqlPath) { $storageDefaultPath = realpath($baseStorageDefaultPath); $contentSqlPath = realpath($baseStorageSqlPath); $this->initConfigStorage($storageDefaultPath); $this->initContentDb($contentSqlPath); $this->save()...
[ "public", "function", "init", "(", "$", "baseStorageDefaultPath", ",", "$", "baseStorageSqlPath", ")", "{", "$", "storageDefaultPath", "=", "realpath", "(", "$", "baseStorageDefaultPath", ")", ";", "$", "contentSqlPath", "=", "realpath", "(", "$", "baseStorageSqlP...
Initiates default storage @param $baseStorageDefaultPath @param $baseStorageSqlPath
[ "Initiates", "default", "storage" ]
76e5d9ac8f9c50d06d39a995d13cc03742536548
https://github.com/jenskooij/cloudcontrol/blob/76e5d9ac8f9c50d06d39a995d13cc03742536548/src/storage/Repository.php#L107-L116
train
jenskooij/cloudcontrol
src/storage/Repository.php
Repository.save
public function save() { $host = $this; array_map(function ($value) use ($host) { $host->saveSubset($value); }, $this->fileBasedSubsets); }
php
public function save() { $host = $this; array_map(function ($value) use ($host) { $host->saveSubset($value); }, $this->fileBasedSubsets); }
[ "public", "function", "save", "(", ")", "{", "$", "host", "=", "$", "this", ";", "array_map", "(", "function", "(", "$", "value", ")", "use", "(", "$", "host", ")", "{", "$", "host", "->", "saveSubset", "(", "$", "value", ")", ";", "}", ",", "$...
Persist all subsets
[ "Persist", "all", "subsets" ]
76e5d9ac8f9c50d06d39a995d13cc03742536548
https://github.com/jenskooij/cloudcontrol/blob/76e5d9ac8f9c50d06d39a995d13cc03742536548/src/storage/Repository.php#L163-L169
train
jenskooij/cloudcontrol
src/storage/Repository.php
Repository.saveSubset
public function saveSubset($subset) { $changes = $subset . 'Changes'; if ($this->$changes === true) { if (!defined('JSON_PRETTY_PRINT')) { $json = json_encode($this->$subset); } else { $json = json_encode($this->$subset, JSON_PRETTY_PRINT); ...
php
public function saveSubset($subset) { $changes = $subset . 'Changes'; if ($this->$changes === true) { if (!defined('JSON_PRETTY_PRINT')) { $json = json_encode($this->$subset); } else { $json = json_encode($this->$subset, JSON_PRETTY_PRINT); ...
[ "public", "function", "saveSubset", "(", "$", "subset", ")", "{", "$", "changes", "=", "$", "subset", ".", "'Changes'", ";", "if", "(", "$", "this", "->", "$", "changes", "===", "true", ")", "{", "if", "(", "!", "defined", "(", "'JSON_PRETTY_PRINT'", ...
Persist subset to disk @param $subset
[ "Persist", "subset", "to", "disk" ]
76e5d9ac8f9c50d06d39a995d13cc03742536548
https://github.com/jenskooij/cloudcontrol/blob/76e5d9ac8f9c50d06d39a995d13cc03742536548/src/storage/Repository.php#L175-L189
train
jenskooij/cloudcontrol
src/storage/Repository.php
Repository.loadSubset
protected function loadSubset($subset) { $subsetStoragePath = $this->storagePath . DIRECTORY_SEPARATOR . $subset . '.json'; $json = file_get_contents($subsetStoragePath); $json = json_decode($json); $this->$subset = $json; return $json; }
php
protected function loadSubset($subset) { $subsetStoragePath = $this->storagePath . DIRECTORY_SEPARATOR . $subset . '.json'; $json = file_get_contents($subsetStoragePath); $json = json_decode($json); $this->$subset = $json; return $json; }
[ "protected", "function", "loadSubset", "(", "$", "subset", ")", "{", "$", "subsetStoragePath", "=", "$", "this", "->", "storagePath", ".", "DIRECTORY_SEPARATOR", ".", "$", "subset", ".", "'.json'", ";", "$", "json", "=", "file_get_contents", "(", "$", "subse...
Load subset from disk @param $subset @return mixed|string
[ "Load", "subset", "from", "disk" ]
76e5d9ac8f9c50d06d39a995d13cc03742536548
https://github.com/jenskooij/cloudcontrol/blob/76e5d9ac8f9c50d06d39a995d13cc03742536548/src/storage/Repository.php#L196-L203
train
fabiopaiva/ZfcUserCrud
src/ZfcUserCrud/Entity/User.php
User.addRoles
public function addRoles(Collection $roles) { foreach($roles as $role){ $this->roles->add($role); } }
php
public function addRoles(Collection $roles) { foreach($roles as $role){ $this->roles->add($role); } }
[ "public", "function", "addRoles", "(", "Collection", "$", "roles", ")", "{", "foreach", "(", "$", "roles", "as", "$", "role", ")", "{", "$", "this", "->", "roles", "->", "add", "(", "$", "role", ")", ";", "}", "}" ]
Add a role to the user. @param Role $role @return void
[ "Add", "a", "role", "to", "the", "user", "." ]
8e93ab4e7b3594df5245ce8732fc0334ce4a3d40
https://github.com/fabiopaiva/ZfcUserCrud/blob/8e93ab4e7b3594df5245ce8732fc0334ce4a3d40/src/ZfcUserCrud/Entity/User.php#L244-L250
train
Torann/skosh-generator
src/Builder.php
Builder.registerTwigExtensions
private function registerTwigExtensions() { foreach ($this->app->getSetting('twig_extensions', []) as $extension) { $this->twig->addExtension(new $extension($this)); } }
php
private function registerTwigExtensions() { foreach ($this->app->getSetting('twig_extensions', []) as $extension) { $this->twig->addExtension(new $extension($this)); } }
[ "private", "function", "registerTwigExtensions", "(", ")", "{", "foreach", "(", "$", "this", "->", "app", "->", "getSetting", "(", "'twig_extensions'", ",", "[", "]", ")", "as", "$", "extension", ")", "{", "$", "this", "->", "twig", "->", "addExtension", ...
Register custom twig extensions.
[ "Register", "custom", "twig", "extensions", "." ]
ea60e037d92398d7c146eb2349735d5692e3c48c
https://github.com/Torann/skosh-generator/blob/ea60e037d92398d7c146eb2349735d5692e3c48c/src/Builder.php#L126-L131
train
Torann/skosh-generator
src/Builder.php
Builder.getUrl
public function getUrl($url) { if (!$url || starts_with($url, ['#', '//', 'mailto:', 'tel:', 'http'])) { return $url; } // Get URL root $root = $this->app->getSetting('url'); $url = trim($root, '/') . '/' . trim($url, '/'); // Force trailing slash ...
php
public function getUrl($url) { if (!$url || starts_with($url, ['#', '//', 'mailto:', 'tel:', 'http'])) { return $url; } // Get URL root $root = $this->app->getSetting('url'); $url = trim($root, '/') . '/' . trim($url, '/'); // Force trailing slash ...
[ "public", "function", "getUrl", "(", "$", "url", ")", "{", "if", "(", "!", "$", "url", "||", "starts_with", "(", "$", "url", ",", "[", "'#'", ",", "'//'", ",", "'mailto:'", ",", "'tel:'", ",", "'http'", "]", ")", ")", "{", "return", "$", "url", ...
Get the URL for the given page. @param string $url @return string
[ "Get", "the", "URL", "for", "the", "given", "page", "." ]
ea60e037d92398d7c146eb2349735d5692e3c48c
https://github.com/Torann/skosh-generator/blob/ea60e037d92398d7c146eb2349735d5692e3c48c/src/Builder.php#L159-L178
train
Torann/skosh-generator
src/Builder.php
Builder.getAsset
public function getAsset($path) { // Absolute path will not be in manifest if ($path[0] === '/') { return $this->getUrl($path); } // Get manifest $asset = $this->manifest->get($path); return $this->getUrl('/assets/' . trim($asset, '/')); }
php
public function getAsset($path) { // Absolute path will not be in manifest if ($path[0] === '/') { return $this->getUrl($path); } // Get manifest $asset = $this->manifest->get($path); return $this->getUrl('/assets/' . trim($asset, '/')); }
[ "public", "function", "getAsset", "(", "$", "path", ")", "{", "// Absolute path will not be in manifest", "if", "(", "$", "path", "[", "0", "]", "===", "'/'", ")", "{", "return", "$", "this", "->", "getUrl", "(", "$", "path", ")", ";", "}", "// Get manif...
Check asset manifest for a file @param string $path @return string
[ "Check", "asset", "manifest", "for", "a", "file" ]
ea60e037d92398d7c146eb2349735d5692e3c48c
https://github.com/Torann/skosh-generator/blob/ea60e037d92398d7c146eb2349735d5692e3c48c/src/Builder.php#L186-L197
train
Torann/skosh-generator
src/Builder.php
Builder.build
public function build() { $this->app->writeln("\n<comment>Adding root pages</comment>"); $this->addPages('\\Skosh\\Content\\Page'); $this->app->writeln("\n<comment>Adding posts</comment>"); $this->addPages('\\Skosh\\Content\\Post', 'path', '_posts'); $this->app->writeln("\n...
php
public function build() { $this->app->writeln("\n<comment>Adding root pages</comment>"); $this->addPages('\\Skosh\\Content\\Page'); $this->app->writeln("\n<comment>Adding posts</comment>"); $this->addPages('\\Skosh\\Content\\Post', 'path', '_posts'); $this->app->writeln("\n...
[ "public", "function", "build", "(", ")", "{", "$", "this", "->", "app", "->", "writeln", "(", "\"\\n<comment>Adding root pages</comment>\"", ")", ";", "$", "this", "->", "addPages", "(", "'\\\\Skosh\\\\Content\\\\Page'", ")", ";", "$", "this", "->", "app", "->...
Renders the site @return void
[ "Renders", "the", "site" ]
ea60e037d92398d7c146eb2349735d5692e3c48c
https://github.com/Torann/skosh-generator/blob/ea60e037d92398d7c146eb2349735d5692e3c48c/src/Builder.php#L204-L229
train
Torann/skosh-generator
src/Builder.php
Builder.savePage
public function savePage($target, $html) { $fs = new Filesystem(); $fs->dumpFile($this->target . DIRECTORY_SEPARATOR . $target, $html); }
php
public function savePage($target, $html) { $fs = new Filesystem(); $fs->dumpFile($this->target . DIRECTORY_SEPARATOR . $target, $html); }
[ "public", "function", "savePage", "(", "$", "target", ",", "$", "html", ")", "{", "$", "fs", "=", "new", "Filesystem", "(", ")", ";", "$", "fs", "->", "dumpFile", "(", "$", "this", "->", "target", ".", "DIRECTORY_SEPARATOR", ".", "$", "target", ",", ...
Save page to target file. @param string $html @param string $target
[ "Save", "page", "to", "target", "file", "." ]
ea60e037d92398d7c146eb2349735d5692e3c48c
https://github.com/Torann/skosh-generator/blob/ea60e037d92398d7c146eb2349735d5692e3c48c/src/Builder.php#L271-L275
train
Torann/skosh-generator
src/Builder.php
Builder.getParent
public function getParent($parentId) { if ($parentId && isset($this->site->pages[$parentId])) { return $this->site->pages[$parentId]; } return []; }
php
public function getParent($parentId) { if ($parentId && isset($this->site->pages[$parentId])) { return $this->site->pages[$parentId]; } return []; }
[ "public", "function", "getParent", "(", "$", "parentId", ")", "{", "if", "(", "$", "parentId", "&&", "isset", "(", "$", "this", "->", "site", "->", "pages", "[", "$", "parentId", "]", ")", ")", "{", "return", "$", "this", "->", "site", "->", "pages...
Get parent content. @param string $parentId @return array
[ "Get", "parent", "content", "." ]
ea60e037d92398d7c146eb2349735d5692e3c48c
https://github.com/Torann/skosh-generator/blob/ea60e037d92398d7c146eb2349735d5692e3c48c/src/Builder.php#L283-L290
train
Torann/skosh-generator
src/Builder.php
Builder.getPosts
public function getPosts(Content $content) { if (isset($this->site->categories[$content->id])) { return $this->site->categories[$content->id]; } else { if (isset($content->category) && isset($this->site->categories[$content->category])) { return $this-...
php
public function getPosts(Content $content) { if (isset($this->site->categories[$content->id])) { return $this->site->categories[$content->id]; } else { if (isset($content->category) && isset($this->site->categories[$content->category])) { return $this-...
[ "public", "function", "getPosts", "(", "Content", "$", "content", ")", "{", "if", "(", "isset", "(", "$", "this", "->", "site", "->", "categories", "[", "$", "content", "->", "id", "]", ")", ")", "{", "return", "$", "this", "->", "site", "->", "cat...
Get posts for given content. @param Content $content @return array
[ "Get", "posts", "for", "given", "content", "." ]
ea60e037d92398d7c146eb2349735d5692e3c48c
https://github.com/Torann/skosh-generator/blob/ea60e037d92398d7c146eb2349735d5692e3c48c/src/Builder.php#L298-L310
train
Torann/skosh-generator
src/Builder.php
Builder.createServerConfig
public function createServerConfig() { // Load config $config = new Config($this->app->getEnvironment(), '.env'); // Save to protected file $config->export($this->target . DIRECTORY_SEPARATOR . '.env.php'); }
php
public function createServerConfig() { // Load config $config = new Config($this->app->getEnvironment(), '.env'); // Save to protected file $config->export($this->target . DIRECTORY_SEPARATOR . '.env.php'); }
[ "public", "function", "createServerConfig", "(", ")", "{", "// Load config", "$", "config", "=", "new", "Config", "(", "$", "this", "->", "app", "->", "getEnvironment", "(", ")", ",", "'.env'", ")", ";", "// Save to protected file", "$", "config", "->", "exp...
Create a server config file @return void
[ "Create", "a", "server", "config", "file" ]
ea60e037d92398d7c146eb2349735d5692e3c48c
https://github.com/Torann/skosh-generator/blob/ea60e037d92398d7c146eb2349735d5692e3c48c/src/Builder.php#L317-L324
train
Torann/skosh-generator
src/Builder.php
Builder.copyStaticFiles
public function copyStaticFiles() { $exclude = ['js', 'javascripts', 'stylesheets', 'less', 'sass']; // Include the excludes from the config $exclude = array_merge($exclude, (array) $this->app->getSetting('exclude', [])); // Create pattern $pattern = '/\\.(' . implode("|", ...
php
public function copyStaticFiles() { $exclude = ['js', 'javascripts', 'stylesheets', 'less', 'sass']; // Include the excludes from the config $exclude = array_merge($exclude, (array) $this->app->getSetting('exclude', [])); // Create pattern $pattern = '/\\.(' . implode("|", ...
[ "public", "function", "copyStaticFiles", "(", ")", "{", "$", "exclude", "=", "[", "'js'", ",", "'javascripts'", ",", "'stylesheets'", ",", "'less'", ",", "'sass'", "]", ";", "// Include the excludes from the config", "$", "exclude", "=", "array_merge", "(", "$",...
Copy static files to target Ignoring JS, CSS & LESS - Gulp handles that @return void
[ "Copy", "static", "files", "to", "target", "Ignoring", "JS", "CSS", "&", "LESS", "-", "Gulp", "handles", "that" ]
ea60e037d92398d7c146eb2349735d5692e3c48c
https://github.com/Torann/skosh-generator/blob/ea60e037d92398d7c146eb2349735d5692e3c48c/src/Builder.php#L332-L390
train
Torann/skosh-generator
src/Builder.php
Builder.cleanTarget
public function cleanTarget() { $filesystem = new Filesystem(); // Get files and directories to remove $files = array_diff(scandir($this->target), ['.', '..']); $files = preg_grep('/[^.gitignore]/i', $files); // Remove files foreach ($files as $file) { $...
php
public function cleanTarget() { $filesystem = new Filesystem(); // Get files and directories to remove $files = array_diff(scandir($this->target), ['.', '..']); $files = preg_grep('/[^.gitignore]/i', $files); // Remove files foreach ($files as $file) { $...
[ "public", "function", "cleanTarget", "(", ")", "{", "$", "filesystem", "=", "new", "Filesystem", "(", ")", ";", "// Get files and directories to remove", "$", "files", "=", "array_diff", "(", "scandir", "(", "$", "this", "->", "target", ")", ",", "[", "'.'",...
Clean target directory @return void
[ "Clean", "target", "directory" ]
ea60e037d92398d7c146eb2349735d5692e3c48c
https://github.com/Torann/skosh-generator/blob/ea60e037d92398d7c146eb2349735d5692e3c48c/src/Builder.php#L397-L412
train
Torann/skosh-generator
src/Builder.php
Builder.addPages
private function addPages($class, $path = 'notPath', $filter = '_') { $finder = new Finder(); $finder->files() ->in($this->source) ->$path($filter) ->name('/\\.(md|textile|xml|twig)$/'); foreach ($finder as $file) { $page = new $class(...
php
private function addPages($class, $path = 'notPath', $filter = '_') { $finder = new Finder(); $finder->files() ->in($this->source) ->$path($filter) ->name('/\\.(md|textile|xml|twig)$/'); foreach ($finder as $file) { $page = new $class(...
[ "private", "function", "addPages", "(", "$", "class", ",", "$", "path", "=", "'notPath'", ",", "$", "filter", "=", "'_'", ")", "{", "$", "finder", "=", "new", "Finder", "(", ")", ";", "$", "finder", "->", "files", "(", ")", "->", "in", "(", "$", ...
Add pages for rendering @param string $class @param string $path @param string $filter @return void
[ "Add", "pages", "for", "rendering" ]
ea60e037d92398d7c146eb2349735d5692e3c48c
https://github.com/Torann/skosh-generator/blob/ea60e037d92398d7c146eb2349735d5692e3c48c/src/Builder.php#L422-L443
train
gplcart/cli
controllers/commands/File.php
File.cmdGetFile
public function cmdGetFile() { $result = $this->getListFile(); $this->outputFormat($result); $this->outputFormatTableFile($result); $this->output(); }
php
public function cmdGetFile() { $result = $this->getListFile(); $this->outputFormat($result); $this->outputFormatTableFile($result); $this->output(); }
[ "public", "function", "cmdGetFile", "(", ")", "{", "$", "result", "=", "$", "this", "->", "getListFile", "(", ")", ";", "$", "this", "->", "outputFormat", "(", "$", "result", ")", ";", "$", "this", "->", "outputFormatTableFile", "(", "$", "result", ")"...
Callback for "file-get" command
[ "Callback", "for", "file", "-", "get", "command" ]
e57dba53e291a225b4bff0c0d9b23d685dd1c125
https://github.com/gplcart/cli/blob/e57dba53e291a225b4bff0c0d9b23d685dd1c125/controllers/commands/File.php#L40-L46
train
gplcart/cli
controllers/commands/File.php
File.cmdDeleteFile
public function cmdDeleteFile() { $id = $this->getParam(0); $all = $this->getParam('all'); if (empty($id) && empty($all)) { $this->errorAndExit($this->text('Invalid command')); } $options = null; if (isset($id)) { if ($this->getParam('type'...
php
public function cmdDeleteFile() { $id = $this->getParam(0); $all = $this->getParam('all'); if (empty($id) && empty($all)) { $this->errorAndExit($this->text('Invalid command')); } $options = null; if (isset($id)) { if ($this->getParam('type'...
[ "public", "function", "cmdDeleteFile", "(", ")", "{", "$", "id", "=", "$", "this", "->", "getParam", "(", "0", ")", ";", "$", "all", "=", "$", "this", "->", "getParam", "(", "'all'", ")", ";", "if", "(", "empty", "(", "$", "id", ")", "&&", "emp...
Callback for "file-delete" command
[ "Callback", "for", "file", "-", "delete", "command" ]
e57dba53e291a225b4bff0c0d9b23d685dd1c125
https://github.com/gplcart/cli/blob/e57dba53e291a225b4bff0c0d9b23d685dd1c125/controllers/commands/File.php#L51-L100
train
gplcart/cli
controllers/commands/File.php
File.cmdUpdateFile
public function cmdUpdateFile() { $params = $this->getParam(); if (empty($params[0]) || count($params) < 2) { $this->errorAndExit($this->text('Invalid command')); } if (!is_numeric($params[0])) { $this->errorAndExit($this->text('Invalid argument')); ...
php
public function cmdUpdateFile() { $params = $this->getParam(); if (empty($params[0]) || count($params) < 2) { $this->errorAndExit($this->text('Invalid command')); } if (!is_numeric($params[0])) { $this->errorAndExit($this->text('Invalid argument')); ...
[ "public", "function", "cmdUpdateFile", "(", ")", "{", "$", "params", "=", "$", "this", "->", "getParam", "(", ")", ";", "if", "(", "empty", "(", "$", "params", "[", "0", "]", ")", "||", "count", "(", "$", "params", ")", "<", "2", ")", "{", "$",...
Callback for "file-update" command
[ "Callback", "for", "file", "-", "update", "command" ]
e57dba53e291a225b4bff0c0d9b23d685dd1c125
https://github.com/gplcart/cli/blob/e57dba53e291a225b4bff0c0d9b23d685dd1c125/controllers/commands/File.php#L137-L155
train
gplcart/cli
controllers/commands/File.php
File.addFile
protected function addFile() { if (!$this->isError()) { $id = $this->file->add($this->getSubmitted()); if (empty($id)) { $this->errorAndExit($this->text('Unexpected result')); } $this->line($id); } }
php
protected function addFile() { if (!$this->isError()) { $id = $this->file->add($this->getSubmitted()); if (empty($id)) { $this->errorAndExit($this->text('Unexpected result')); } $this->line($id); } }
[ "protected", "function", "addFile", "(", ")", "{", "if", "(", "!", "$", "this", "->", "isError", "(", ")", ")", "{", "$", "id", "=", "$", "this", "->", "file", "->", "add", "(", "$", "this", "->", "getSubmitted", "(", ")", ")", ";", "if", "(", ...
Add a new file record
[ "Add", "a", "new", "file", "record" ]
e57dba53e291a225b4bff0c0d9b23d685dd1c125
https://github.com/gplcart/cli/blob/e57dba53e291a225b4bff0c0d9b23d685dd1c125/controllers/commands/File.php#L228-L237
train
gplcart/cli
controllers/commands/File.php
File.updateFile
protected function updateFile($file_id) { if (!$this->isError() && !$this->file->update($file_id, $this->getSubmitted())) { $this->errorAndExit($this->text('Unexpected result')); } }
php
protected function updateFile($file_id) { if (!$this->isError() && !$this->file->update($file_id, $this->getSubmitted())) { $this->errorAndExit($this->text('Unexpected result')); } }
[ "protected", "function", "updateFile", "(", "$", "file_id", ")", "{", "if", "(", "!", "$", "this", "->", "isError", "(", ")", "&&", "!", "$", "this", "->", "file", "->", "update", "(", "$", "file_id", ",", "$", "this", "->", "getSubmitted", "(", ")...
Updates a file record @param string $file_id
[ "Updates", "a", "file", "record" ]
e57dba53e291a225b4bff0c0d9b23d685dd1c125
https://github.com/gplcart/cli/blob/e57dba53e291a225b4bff0c0d9b23d685dd1c125/controllers/commands/File.php#L243-L248
train
gplcart/cli
controllers/commands/File.php
File.submitAddFile
protected function submitAddFile() { $this->setSubmitted(null, $this->getParam()); $this->validateComponent('file'); $this->addFile(); }
php
protected function submitAddFile() { $this->setSubmitted(null, $this->getParam()); $this->validateComponent('file'); $this->addFile(); }
[ "protected", "function", "submitAddFile", "(", ")", "{", "$", "this", "->", "setSubmitted", "(", "null", ",", "$", "this", "->", "getParam", "(", ")", ")", ";", "$", "this", "->", "validateComponent", "(", "'file'", ")", ";", "$", "this", "->", "addFil...
Add a new file record at once
[ "Add", "a", "new", "file", "record", "at", "once" ]
e57dba53e291a225b4bff0c0d9b23d685dd1c125
https://github.com/gplcart/cli/blob/e57dba53e291a225b4bff0c0d9b23d685dd1c125/controllers/commands/File.php#L253-L258
train
gplcart/cli
controllers/commands/File.php
File.wizardAddFile
protected function wizardAddFile() { $this->validatePrompt('path', $this->text('Path'), 'file'); $this->validatePrompt('entity', $this->text('Entity'), 'file'); $this->validatePrompt('entity_id', $this->text('Entity ID'), 'file', 0); $this->validatePrompt('title', $this->text('Title'...
php
protected function wizardAddFile() { $this->validatePrompt('path', $this->text('Path'), 'file'); $this->validatePrompt('entity', $this->text('Entity'), 'file'); $this->validatePrompt('entity_id', $this->text('Entity ID'), 'file', 0); $this->validatePrompt('title', $this->text('Title'...
[ "protected", "function", "wizardAddFile", "(", ")", "{", "$", "this", "->", "validatePrompt", "(", "'path'", ",", "$", "this", "->", "text", "(", "'Path'", ")", ",", "'file'", ")", ";", "$", "this", "->", "validatePrompt", "(", "'entity'", ",", "$", "t...
Add a new file record step by step
[ "Add", "a", "new", "file", "record", "step", "by", "step" ]
e57dba53e291a225b4bff0c0d9b23d685dd1c125
https://github.com/gplcart/cli/blob/e57dba53e291a225b4bff0c0d9b23d685dd1c125/controllers/commands/File.php#L263-L274
train
agentmedia/phine-builtin
src/BuiltIn/Modules/Backend/RegisterConfirmForm.php
RegisterConfirmForm.SaveGroups
private function SaveGroups() { $assignedIDs = $this->AssignedGroupIDs(); $selectedIDs = Request::PostArray('Group'); $this->ClearMembergroups($selectedIDs); foreach ($selectedIDs as $selectedID) { if (!in_array($selectedID, $assignedIDs)) { ...
php
private function SaveGroups() { $assignedIDs = $this->AssignedGroupIDs(); $selectedIDs = Request::PostArray('Group'); $this->ClearMembergroups($selectedIDs); foreach ($selectedIDs as $selectedID) { if (!in_array($selectedID, $assignedIDs)) { ...
[ "private", "function", "SaveGroups", "(", ")", "{", "$", "assignedIDs", "=", "$", "this", "->", "AssignedGroupIDs", "(", ")", ";", "$", "selectedIDs", "=", "Request", "::", "PostArray", "(", "'Group'", ")", ";", "$", "this", "->", "ClearMembergroups", "(",...
Saves the groups
[ "Saves", "the", "groups" ]
4dd05bc406a71e997bd4eaa16b12e23dbe62a456
https://github.com/agentmedia/phine-builtin/blob/4dd05bc406a71e997bd4eaa16b12e23dbe62a456/src/BuiltIn/Modules/Backend/RegisterConfirmForm.php#L146-L161
train
975L/ConfigBundle
Twig/ConfigParam.php
ConfigParam.configParam
public function configParam($parameter) { $value = $this->container->getParameter($parameter); return is_array($value) ? json_encode($value) : $value; }
php
public function configParam($parameter) { $value = $this->container->getParameter($parameter); return is_array($value) ? json_encode($value) : $value; }
[ "public", "function", "configParam", "(", "$", "parameter", ")", "{", "$", "value", "=", "$", "this", "->", "container", "->", "getParameter", "(", "$", "parameter", ")", ";", "return", "is_array", "(", "$", "value", ")", "?", "json_encode", "(", "$", ...
Returns the specified container's parameter @return string
[ "Returns", "the", "specified", "container", "s", "parameter" ]
1f9a9e937dbb79ad06fe5d456e7536d58bd56e19
https://github.com/975L/ConfigBundle/blob/1f9a9e937dbb79ad06fe5d456e7536d58bd56e19/Twig/ConfigParam.php#L48-L53
train
net-tools/core
src/ExceptionHandlers/ExceptionHandler.php
ExceptionHandler._getException
protected function _getException(\Throwable $e, $h1) { try { return $this->_getFormatterStrategy()->format($e, $h1); } catch (\Throwable $e2) { return "Error '" . get_class($e2) . "' during processing of exception '" . get_class($e) . "' with message '{$e2->getMessage()}'."; } }
php
protected function _getException(\Throwable $e, $h1) { try { return $this->_getFormatterStrategy()->format($e, $h1); } catch (\Throwable $e2) { return "Error '" . get_class($e2) . "' during processing of exception '" . get_class($e) . "' with message '{$e2->getMessage()}'."; } }
[ "protected", "function", "_getException", "(", "\\", "Throwable", "$", "e", ",", "$", "h1", ")", "{", "try", "{", "return", "$", "this", "->", "_getFormatterStrategy", "(", ")", "->", "format", "(", "$", "e", ",", "$", "h1", ")", ";", "}", "catch", ...
Get exception stack trace as a string @param \Throwable $e Exception to handle @param string $h1 The title displayed on the error page @return string Exception stack trace as a string
[ "Get", "exception", "stack", "trace", "as", "a", "string" ]
51446641cee22c0cf53d2b409c76cc8bd1a187e7
https://github.com/net-tools/core/blob/51446641cee22c0cf53d2b409c76cc8bd1a187e7/src/ExceptionHandlers/ExceptionHandler.php#L29-L39
train
net-tools/core
src/ExceptionHandlers/ExceptionHandler.php
ExceptionHandler._handleXMLHTTPCommandException
protected function _handleXMLHTTPCommandException(\Throwable $e) { // send xmlhttp headers header("Content-Type: application/json; charset=utf-8"); // no cache header("Expires: Sat, 1 Jan 2005 00:00:00 GMT"); header("Last-Modified: ".gmdate( "D, d M Y H:i:s")." GMT"); header("Cache-Control: no-cache,...
php
protected function _handleXMLHTTPCommandException(\Throwable $e) { // send xmlhttp headers header("Content-Type: application/json; charset=utf-8"); // no cache header("Expires: Sat, 1 Jan 2005 00:00:00 GMT"); header("Last-Modified: ".gmdate( "D, d M Y H:i:s")." GMT"); header("Cache-Control: no-cache,...
[ "protected", "function", "_handleXMLHTTPCommandException", "(", "\\", "Throwable", "$", "e", ")", "{", "// send xmlhttp headers", "header", "(", "\"Content-Type: application/json; charset=utf-8\"", ")", ";", "// no cache", "header", "(", "\"Expires: Sat, 1 Jan 2005 00:00:00 GMT...
Handle an exception during an XMLHTTP request. The XMLHTTP request JSON response will contain a 'exception' property with the exception data formatted as a human-readable string. The JSON formatted exception is outputed directly to standard output. @param \Throwable $e Exception
[ "Handle", "an", "exception", "during", "an", "XMLHTTP", "request", "." ]
51446641cee22c0cf53d2b409c76cc8bd1a187e7
https://github.com/net-tools/core/blob/51446641cee22c0cf53d2b409c76cc8bd1a187e7/src/ExceptionHandlers/ExceptionHandler.php#L174-L190
train
freddieannobil/doo-pagination
src/DooPagination.php
DooPagination.end
public function end() { # Calculate the Beginning + The maximum amount of results $calc = $this->start() + $this->max; # Only return this if it is not above the total otherwise return our maximum # example, 24 + 6 = 30, but with only 26 reselts it will display the total results iste...
php
public function end() { # Calculate the Beginning + The maximum amount of results $calc = $this->start() + $this->max; # Only return this if it is not above the total otherwise return our maximum # example, 24 + 6 = 30, but with only 26 reselts it will display the total results iste...
[ "public", "function", "end", "(", ")", "{", "# Calculate the Beginning + The maximum amount of results", "$", "calc", "=", "$", "this", "->", "start", "(", ")", "+", "$", "this", "->", "max", ";", "# Only return this if it is not above the total otherwise return our maxim...
This calculates the end of our result set, based on our current page @return int Final Calculation of where our result set should end
[ "This", "calculates", "the", "end", "of", "our", "result", "set", "based", "on", "our", "current", "page" ]
7f638c5647585386a71190610592249fd7f735de
https://github.com/freddieannobil/doo-pagination/blob/7f638c5647585386a71190610592249fd7f735de/src/DooPagination.php#L72-L83
train
freddieannobil/doo-pagination
src/DooPagination.php
DooPagination.info
public function info($html) { $tags = array('{total}', '{start}', '{end}', '{page}', '{pages}'); $code = array($this->total, $this->start() + 1, $this->end(), $this->get, $this->pages()); return str_replace($tags, $code, $html); }
php
public function info($html) { $tags = array('{total}', '{start}', '{end}', '{page}', '{pages}'); $code = array($this->total, $this->start() + 1, $this->end(), $this->get, $this->pages()); return str_replace($tags, $code, $html); }
[ "public", "function", "info", "(", "$", "html", ")", "{", "$", "tags", "=", "array", "(", "'{total}'", ",", "'{start}'", ",", "'{end}'", ",", "'{page}'", ",", "'{pages}'", ")", ";", "$", "code", "=", "array", "(", "$", "this", "->", "total", ",", "...
Based on which page you are this returns informations like, start result, end result, total results, current page, total pages @param string $html The HTML you wish to use to display the link @return mixed return information we may need to display
[ "Based", "on", "which", "page", "you", "are", "this", "returns", "informations", "like", "start", "result", "end", "result", "total", "results", "current", "page", "total", "pages" ]
7f638c5647585386a71190610592249fd7f735de
https://github.com/freddieannobil/doo-pagination/blob/7f638c5647585386a71190610592249fd7f735de/src/DooPagination.php#L99-L105
train
freddieannobil/doo-pagination
src/DooPagination.php
DooPagination.first
public function first($html, $html2 = '') { # Only show if you are not on page 1, otherwise show HTML2 $r = ($this->get != 1) ? str_replace('{nr}', 1, $html) : str_replace('{nr}', 1, $html2); return $r; }
php
public function first($html, $html2 = '') { # Only show if you are not on page 1, otherwise show HTML2 $r = ($this->get != 1) ? str_replace('{nr}', 1, $html) : str_replace('{nr}', 1, $html2); return $r; }
[ "public", "function", "first", "(", "$", "html", ",", "$", "html2", "=", "''", ")", "{", "# Only show if you are not on page 1, otherwise show HTML2", "$", "r", "=", "(", "$", "this", "->", "get", "!=", "1", ")", "?", "str_replace", "(", "'{nr}'", ",", "1"...
This shows the 'first' link with custom html @param string $html The HTML you wish to use to display the link @return string The Same HTML replaced the tags with the proper number
[ "This", "shows", "the", "first", "link", "with", "custom", "html" ]
7f638c5647585386a71190610592249fd7f735de
https://github.com/freddieannobil/doo-pagination/blob/7f638c5647585386a71190610592249fd7f735de/src/DooPagination.php#L112-L118
train
freddieannobil/doo-pagination
src/DooPagination.php
DooPagination.previous
public function previous($html, $html2 = '') { # Only show if you are not on page 1, otherwise show HTML2 $r = ($this->get != 1) ? str_replace('{nr}', $this->get - 1, $html) : str_replace('{nr}', $this->get - 1, $html2); return $r; }
php
public function previous($html, $html2 = '') { # Only show if you are not on page 1, otherwise show HTML2 $r = ($this->get != 1) ? str_replace('{nr}', $this->get - 1, $html) : str_replace('{nr}', $this->get - 1, $html2); return $r; }
[ "public", "function", "previous", "(", "$", "html", ",", "$", "html2", "=", "''", ")", "{", "# Only show if you are not on page 1, otherwise show HTML2", "$", "r", "=", "(", "$", "this", "->", "get", "!=", "1", ")", "?", "str_replace", "(", "'{nr}'", ",", ...
This shows the 'previous' link with custom html @param string $html The HTML you wish to use to display the link @return string The Same HTML replaced the tags with the proper number
[ "This", "shows", "the", "previous", "link", "with", "custom", "html" ]
7f638c5647585386a71190610592249fd7f735de
https://github.com/freddieannobil/doo-pagination/blob/7f638c5647585386a71190610592249fd7f735de/src/DooPagination.php#L125-L131
train
freddieannobil/doo-pagination
src/DooPagination.php
DooPagination.next
public function next($html, $html2 = '') { # Only show if you are not on the last page $r = ($this->get < $this->pages()) ? str_replace('{nr}', $this->get + 1, $html) : str_replace('{nr}', $this->get + 1, $html2); return $r; }
php
public function next($html, $html2 = '') { # Only show if you are not on the last page $r = ($this->get < $this->pages()) ? str_replace('{nr}', $this->get + 1, $html) : str_replace('{nr}', $this->get + 1, $html2); return $r; }
[ "public", "function", "next", "(", "$", "html", ",", "$", "html2", "=", "''", ")", "{", "# Only show if you are not on the last page", "$", "r", "=", "(", "$", "this", "->", "get", "<", "$", "this", "->", "pages", "(", ")", ")", "?", "str_replace", "("...
This shows the 'next' link with custom html @param string $html The HTML you wish to use to display the link @return string The Same HTML replaced the tags with the proper number
[ "This", "shows", "the", "next", "link", "with", "custom", "html" ]
7f638c5647585386a71190610592249fd7f735de
https://github.com/freddieannobil/doo-pagination/blob/7f638c5647585386a71190610592249fd7f735de/src/DooPagination.php#L138-L144
train
freddieannobil/doo-pagination
src/DooPagination.php
DooPagination.last
public function last($html, $html2 = '') { # Only show if you are not on the last page $r = ($this->get < $this->pages()) ? str_replace('{nr}', $this->pages(), $html) : str_replace('{nr}', $this->pages(), $html2); return $r; }
php
public function last($html, $html2 = '') { # Only show if you are not on the last page $r = ($this->get < $this->pages()) ? str_replace('{nr}', $this->pages(), $html) : str_replace('{nr}', $this->pages(), $html2); return $r; }
[ "public", "function", "last", "(", "$", "html", ",", "$", "html2", "=", "''", ")", "{", "# Only show if you are not on the last page", "$", "r", "=", "(", "$", "this", "->", "get", "<", "$", "this", "->", "pages", "(", ")", ")", "?", "str_replace", "("...
This shows the 'last' link with custom html @param string $html The HTML you wish to use to display the link @return string The Same HTML replaced the tags with the proper number
[ "This", "shows", "the", "last", "link", "with", "custom", "html" ]
7f638c5647585386a71190610592249fd7f735de
https://github.com/freddieannobil/doo-pagination/blob/7f638c5647585386a71190610592249fd7f735de/src/DooPagination.php#L151-L157
train
freddieannobil/doo-pagination
src/DooPagination.php
DooPagination.numbers
public function numbers($link, $current, $reversed = false) { $r = ''; $range = floor(($this->max_items - 1) / 2); if (!$this->max_items) { $page_nums = range(1, $this->pages()); } else { $lower_limit = max($this->get - $range, 1); $upper_limit = m...
php
public function numbers($link, $current, $reversed = false) { $r = ''; $range = floor(($this->max_items - 1) / 2); if (!$this->max_items) { $page_nums = range(1, $this->pages()); } else { $lower_limit = max($this->get - $range, 1); $upper_limit = m...
[ "public", "function", "numbers", "(", "$", "link", ",", "$", "current", ",", "$", "reversed", "=", "false", ")", "{", "$", "r", "=", "''", ";", "$", "range", "=", "floor", "(", "(", "$", "this", "->", "max_items", "-", "1", ")", "/", "2", ")", ...
This shows an loop of 'numbers' with their appropriate link in custom html @param string $link The HTML to display a number with a link @param string $current The HTML to display a the current page number without a link @param string $reversed Optional Parameter, set to true if you want the numbers reversed (align to r...
[ "This", "shows", "an", "loop", "of", "numbers", "with", "their", "appropriate", "link", "in", "custom", "html" ]
7f638c5647585386a71190610592249fd7f735de
https://github.com/freddieannobil/doo-pagination/blob/7f638c5647585386a71190610592249fd7f735de/src/DooPagination.php#L166-L190
train
tuanlq11/dbi18n
src/I18NDBTrait.php
I18NDBTrait.saveI18N
public function saveI18N() { if (empty($this->i18n_data)) return; $this->i18n_relation()->getQuery()->whereIn($this->getI18NCodeField(), array_keys($this->i18n_data))->delete(); foreach ($this->i18n_data as $locale => $data) { $obj = new $this->i18n_cl...
php
public function saveI18N() { if (empty($this->i18n_data)) return; $this->i18n_relation()->getQuery()->whereIn($this->getI18NCodeField(), array_keys($this->i18n_data))->delete(); foreach ($this->i18n_data as $locale => $data) { $obj = new $this->i18n_cl...
[ "public", "function", "saveI18N", "(", ")", "{", "if", "(", "empty", "(", "$", "this", "->", "i18n_data", ")", ")", "return", ";", "$", "this", "->", "i18n_relation", "(", ")", "->", "getQuery", "(", ")", "->", "whereIn", "(", "$", "this", "->", "g...
Store I18N to database
[ "Store", "I18N", "to", "database" ]
56d01eceae043f2770e01b92e7bcc7e52a5047e7
https://github.com/tuanlq11/dbi18n/blob/56d01eceae043f2770e01b92e7bcc7e52a5047e7/src/I18NDBTrait.php#L59-L69
train
tuanlq11/dbi18n
src/I18NDBTrait.php
I18NDBTrait.filterI18NColumn
public function filterI18NColumn() { $overrideData = array_only($this->attributes, $this->i18n_fillable); if (!empty($overrideData)) { $this->i18n_data[$this->i18n_default_locale] = $overrideData; foreach ($this->i18n_fillable as $key) { unset($this->$key); ...
php
public function filterI18NColumn() { $overrideData = array_only($this->attributes, $this->i18n_fillable); if (!empty($overrideData)) { $this->i18n_data[$this->i18n_default_locale] = $overrideData; foreach ($this->i18n_fillable as $key) { unset($this->$key); ...
[ "public", "function", "filterI18NColumn", "(", ")", "{", "$", "overrideData", "=", "array_only", "(", "$", "this", "->", "attributes", ",", "$", "this", "->", "i18n_fillable", ")", ";", "if", "(", "!", "empty", "(", "$", "overrideData", ")", ")", "{", ...
Filter & remove i18n column from attributes. Mean, is not save to model self.
[ "Filter", "&", "remove", "i18n", "column", "from", "attributes", ".", "Mean", "is", "not", "save", "to", "model", "self", "." ]
56d01eceae043f2770e01b92e7bcc7e52a5047e7
https://github.com/tuanlq11/dbi18n/blob/56d01eceae043f2770e01b92e7bcc7e52a5047e7/src/I18NDBTrait.php#L75-L89
train
tuanlq11/dbi18n
src/I18NDBTrait.php
I18NDBTrait.scopeI18N
public function scopeI18N($query, $locale = null) { $i18nTranAlias = "i18n_translation"; $i18nAlias = "i18n"; $primary = $this->primaryKey; $i18nPrimary = $this->i18n_primary; $table = $this->table; $i18n_table = (new $this->i18n_class())->getTa...
php
public function scopeI18N($query, $locale = null) { $i18nTranAlias = "i18n_translation"; $i18nAlias = "i18n"; $primary = $this->primaryKey; $i18nPrimary = $this->i18n_primary; $table = $this->table; $i18n_table = (new $this->i18n_class())->getTa...
[ "public", "function", "scopeI18N", "(", "$", "query", ",", "$", "locale", "=", "null", ")", "{", "$", "i18nTranAlias", "=", "\"i18n_translation\"", ";", "$", "i18nAlias", "=", "\"i18n\"", ";", "$", "primary", "=", "$", "this", "->", "primaryKey", ";", "$...
Join I18N data to this @param $query Builder @param $locale string|null @return Builder
[ "Join", "I18N", "data", "to", "this" ]
56d01eceae043f2770e01b92e7bcc7e52a5047e7
https://github.com/tuanlq11/dbi18n/blob/56d01eceae043f2770e01b92e7bcc7e52a5047e7/src/I18NDBTrait.php#L123-L147
train
ARCANESOFT/Auth
src/Seeds/PermissionsSeeder.php
PermissionsSeeder.seed
public function seed(array $seeds) { foreach ($seeds as $seed) { /** @var \Arcanesoft\Auth\Models\PermissionsGroup $group */ $group = PermissionsGroup::create($seed['group']); $permissions = array_map(function ($permission) { return new Permission(...
php
public function seed(array $seeds) { foreach ($seeds as $seed) { /** @var \Arcanesoft\Auth\Models\PermissionsGroup $group */ $group = PermissionsGroup::create($seed['group']); $permissions = array_map(function ($permission) { return new Permission(...
[ "public", "function", "seed", "(", "array", "$", "seeds", ")", "{", "foreach", "(", "$", "seeds", "as", "$", "seed", ")", "{", "/** @var \\Arcanesoft\\Auth\\Models\\PermissionsGroup $group */", "$", "group", "=", "PermissionsGroup", "::", "create", "(", "$", "...
Seed permissions. @param array $seeds
[ "Seed", "permissions", "." ]
b33ca82597a76b1e395071f71ae3e51f1ec67e62
https://github.com/ARCANESOFT/Auth/blob/b33ca82597a76b1e395071f71ae3e51f1ec67e62/src/Seeds/PermissionsSeeder.php#L25-L36
train
solid-framework/core
src/Config/Config.php
Config.get
public function get(string $settingsField = null, $default = null) { // if no settings field was given return all settings if (is_null($settingsField)) { return $this->settings; } $setting = $this->settings; foreach (explode('.', $settingsField) as $field) { ...
php
public function get(string $settingsField = null, $default = null) { // if no settings field was given return all settings if (is_null($settingsField)) { return $this->settings; } $setting = $this->settings; foreach (explode('.', $settingsField) as $field) { ...
[ "public", "function", "get", "(", "string", "$", "settingsField", "=", "null", ",", "$", "default", "=", "null", ")", "{", "// if no settings field was given return all settings", "if", "(", "is_null", "(", "$", "settingsField", ")", ")", "{", "return", "$", "...
Returns the given settings field if set or the default value Note: If no settings field is given all settings are returned. @api @since 0.1.0 @param string $settingsField The settings field to retrieve. @param mixed $default The default value to use. @return mixed
[ "Returns", "the", "given", "settings", "field", "if", "set", "or", "the", "default", "value" ]
418e78fc4c630c35a147832615adda0336271569
https://github.com/solid-framework/core/blob/418e78fc4c630c35a147832615adda0336271569/src/Config/Config.php#L79-L97
train
solid-framework/core
src/Config/Config.php
Config.merge
public function merge(array $settings, string $field = null, bool $mergeArrays = false) { $merged = self::mergeSettings($this->get($field), $settings, $mergeArrays); if (!is_null($field)) { $this->put($field, $merged); } else { $this->set($merged); } }
php
public function merge(array $settings, string $field = null, bool $mergeArrays = false) { $merged = self::mergeSettings($this->get($field), $settings, $mergeArrays); if (!is_null($field)) { $this->put($field, $merged); } else { $this->set($merged); } }
[ "public", "function", "merge", "(", "array", "$", "settings", ",", "string", "$", "field", "=", "null", ",", "bool", "$", "mergeArrays", "=", "false", ")", "{", "$", "merged", "=", "self", "::", "mergeSettings", "(", "$", "this", "->", "get", "(", "$...
Merges the given settings into the given field @api @since 0.1.0 @param array $settings The settings to merge into the given field. @param string|null $field The field to merge the given settings into. @param bool $mergeArrays Whether to merge indexed arrays. @return void
[ "Merges", "the", "given", "settings", "into", "the", "given", "field" ]
418e78fc4c630c35a147832615adda0336271569
https://github.com/solid-framework/core/blob/418e78fc4c630c35a147832615adda0336271569/src/Config/Config.php#L137-L146
train
solid-framework/core
src/Config/Config.php
Config.mergeSettings
private static function mergeSettings(array $a, array $b, $mergeArrays = false): array { foreach ($b as $key => $value) { if (array_key_exists($key, $a)) { if (self::isAssoc($a[$key]) && self::isAssoc($b[$key])) { $a[$key] = self::mergeSettings( ...
php
private static function mergeSettings(array $a, array $b, $mergeArrays = false): array { foreach ($b as $key => $value) { if (array_key_exists($key, $a)) { if (self::isAssoc($a[$key]) && self::isAssoc($b[$key])) { $a[$key] = self::mergeSettings( ...
[ "private", "static", "function", "mergeSettings", "(", "array", "$", "a", ",", "array", "$", "b", ",", "$", "mergeArrays", "=", "false", ")", ":", "array", "{", "foreach", "(", "$", "b", "as", "$", "key", "=>", "$", "value", ")", "{", "if", "(", ...
Recursively merges the two given arrays giving priority to the second @internal @since 0.1.0 @param array $a The array to merge in the second array into. @param array $b The array to merge into the first array. @param bool $mergeArrays Whether to merge indexed arrays. @return array
[ "Recursively", "merges", "the", "two", "given", "arrays", "giving", "priority", "to", "the", "second" ]
418e78fc4c630c35a147832615adda0336271569
https://github.com/solid-framework/core/blob/418e78fc4c630c35a147832615adda0336271569/src/Config/Config.php#L158-L179
train
FlexModel/FlexModel
src/FlexModel.php
FlexModel.load
public function load(DOMDocument $domDocument, $cachePath, $xmlSchemaFile = null) { $this->domDocument = $domDocument; $this->cachePath = $cachePath; if (isset($xmlSchemaFile)) { $this->xmlSchemaFile = $xmlSchemaFile; } $this->loadConfiguration(); }
php
public function load(DOMDocument $domDocument, $cachePath, $xmlSchemaFile = null) { $this->domDocument = $domDocument; $this->cachePath = $cachePath; if (isset($xmlSchemaFile)) { $this->xmlSchemaFile = $xmlSchemaFile; } $this->loadConfiguration(); }
[ "public", "function", "load", "(", "DOMDocument", "$", "domDocument", ",", "$", "cachePath", ",", "$", "xmlSchemaFile", "=", "null", ")", "{", "$", "this", "->", "domDocument", "=", "$", "domDocument", ";", "$", "this", "->", "cachePath", "=", "$", "cach...
Loads the XML configuration. @param DOMDocument $domDocument @param string $cachePath @param string|null $xmlSchemaFile
[ "Loads", "the", "XML", "configuration", "." ]
83368c13a7c8c2cf0ee95b36fe81d84a7129fee2
https://github.com/FlexModel/FlexModel/blob/83368c13a7c8c2cf0ee95b36fe81d84a7129fee2/src/FlexModel.php#L88-L97
train
FlexModel/FlexModel
src/FlexModel.php
FlexModel.reload
public function reload() { $this->configuration = null; $this->load($this->domDocument, $this->cachePath, $this->xmlSchemaFile); }
php
public function reload() { $this->configuration = null; $this->load($this->domDocument, $this->cachePath, $this->xmlSchemaFile); }
[ "public", "function", "reload", "(", ")", "{", "$", "this", "->", "configuration", "=", "null", ";", "$", "this", "->", "load", "(", "$", "this", "->", "domDocument", ",", "$", "this", "->", "cachePath", ",", "$", "this", "->", "xmlSchemaFile", ")", ...
Reloads the configuration.
[ "Reloads", "the", "configuration", "." ]
83368c13a7c8c2cf0ee95b36fe81d84a7129fee2
https://github.com/FlexModel/FlexModel/blob/83368c13a7c8c2cf0ee95b36fe81d84a7129fee2/src/FlexModel.php#L102-L107
train
FlexModel/FlexModel
src/FlexModel.php
FlexModel.hasField
public function hasField($objectName, $fieldName) { $field = $this->getField($objectName, $fieldName); return is_array($field); }
php
public function hasField($objectName, $fieldName) { $field = $this->getField($objectName, $fieldName); return is_array($field); }
[ "public", "function", "hasField", "(", "$", "objectName", ",", "$", "fieldName", ")", "{", "$", "field", "=", "$", "this", "->", "getField", "(", "$", "objectName", ",", "$", "fieldName", ")", ";", "return", "is_array", "(", "$", "field", ")", ";", "...
Returns true when the configuration of an object contains the specified field name. @param string $objectName @param string $fieldName @return bool
[ "Returns", "true", "when", "the", "configuration", "of", "an", "object", "contains", "the", "specified", "field", "name", "." ]
83368c13a7c8c2cf0ee95b36fe81d84a7129fee2
https://github.com/FlexModel/FlexModel/blob/83368c13a7c8c2cf0ee95b36fe81d84a7129fee2/src/FlexModel.php#L163-L168
train
FlexModel/FlexModel
src/FlexModel.php
FlexModel.getObjectNames
public function getObjectNames() { $objectNames = array(); if (is_array($this->configuration)) { $objectNames = array_keys($this->configuration); } return $objectNames; }
php
public function getObjectNames() { $objectNames = array(); if (is_array($this->configuration)) { $objectNames = array_keys($this->configuration); } return $objectNames; }
[ "public", "function", "getObjectNames", "(", ")", "{", "$", "objectNames", "=", "array", "(", ")", ";", "if", "(", "is_array", "(", "$", "this", "->", "configuration", ")", ")", "{", "$", "objectNames", "=", "array_keys", "(", "$", "this", "->", "confi...
Returns all configured object names. @return array
[ "Returns", "all", "configured", "object", "names", "." ]
83368c13a7c8c2cf0ee95b36fe81d84a7129fee2
https://github.com/FlexModel/FlexModel/blob/83368c13a7c8c2cf0ee95b36fe81d84a7129fee2/src/FlexModel.php#L187-L195
train
FlexModel/FlexModel
src/FlexModel.php
FlexModel.getModelConfiguration
public function getModelConfiguration($objectName) { if (isset($this->configuration[$objectName])) { $modelConfiguration = $this->configuration[$objectName]; $modelConfiguration['__object_name'] = $objectName; if (isset($modelConfiguration['fields']) === false) { ...
php
public function getModelConfiguration($objectName) { if (isset($this->configuration[$objectName])) { $modelConfiguration = $this->configuration[$objectName]; $modelConfiguration['__object_name'] = $objectName; if (isset($modelConfiguration['fields']) === false) { ...
[ "public", "function", "getModelConfiguration", "(", "$", "objectName", ")", "{", "if", "(", "isset", "(", "$", "this", "->", "configuration", "[", "$", "objectName", "]", ")", ")", "{", "$", "modelConfiguration", "=", "$", "this", "->", "configuration", "[...
Returns the model for the specified object. @param string $objectName @return array|null
[ "Returns", "the", "model", "for", "the", "specified", "object", "." ]
83368c13a7c8c2cf0ee95b36fe81d84a7129fee2
https://github.com/FlexModel/FlexModel/blob/83368c13a7c8c2cf0ee95b36fe81d84a7129fee2/src/FlexModel.php#L204-L215
train
FlexModel/FlexModel
src/FlexModel.php
FlexModel.getFormConfiguration
public function getFormConfiguration($objectName, $formName) { $modelConfiguration = $this->getModelConfiguration($objectName); if (isset($modelConfiguration['forms'][$formName])) { $formConfiguration = $modelConfiguration['forms'][$formName]; foreach ($formConfiguration['fie...
php
public function getFormConfiguration($objectName, $formName) { $modelConfiguration = $this->getModelConfiguration($objectName); if (isset($modelConfiguration['forms'][$formName])) { $formConfiguration = $modelConfiguration['forms'][$formName]; foreach ($formConfiguration['fie...
[ "public", "function", "getFormConfiguration", "(", "$", "objectName", ",", "$", "formName", ")", "{", "$", "modelConfiguration", "=", "$", "this", "->", "getModelConfiguration", "(", "$", "objectName", ")", ";", "if", "(", "isset", "(", "$", "modelConfiguratio...
Returns field configuration of the specified form in the object. @param string $objectName @param string $formName @return array
[ "Returns", "field", "configuration", "of", "the", "specified", "form", "in", "the", "object", "." ]
83368c13a7c8c2cf0ee95b36fe81d84a7129fee2
https://github.com/FlexModel/FlexModel/blob/83368c13a7c8c2cf0ee95b36fe81d84a7129fee2/src/FlexModel.php#L225-L241
train
FlexModel/FlexModel
src/FlexModel.php
FlexModel.getViewConfiguration
public function getViewConfiguration($objectName, $viewName) { $modelConfiguration = $this->getModelConfiguration($objectName); if (isset($modelConfiguration['views'][$viewName])) { $viewConfiguration = $modelConfiguration['views'][$viewName]; if (isset($viewConfiguration['fi...
php
public function getViewConfiguration($objectName, $viewName) { $modelConfiguration = $this->getModelConfiguration($objectName); if (isset($modelConfiguration['views'][$viewName])) { $viewConfiguration = $modelConfiguration['views'][$viewName]; if (isset($viewConfiguration['fi...
[ "public", "function", "getViewConfiguration", "(", "$", "objectName", ",", "$", "viewName", ")", "{", "$", "modelConfiguration", "=", "$", "this", "->", "getModelConfiguration", "(", "$", "objectName", ")", ";", "if", "(", "isset", "(", "$", "modelConfiguratio...
Returns field configuration of the specified view in the object. @param string $objectName @param string $viewName @return array|null
[ "Returns", "field", "configuration", "of", "the", "specified", "view", "in", "the", "object", "." ]
83368c13a7c8c2cf0ee95b36fe81d84a7129fee2
https://github.com/FlexModel/FlexModel/blob/83368c13a7c8c2cf0ee95b36fe81d84a7129fee2/src/FlexModel.php#L251-L270
train
FlexModel/FlexModel
src/FlexModel.php
FlexModel.getViewConfigurationsByViewgroupOfView
public function getViewConfigurationsByViewgroupOfView($objectName, $viewName) { $viewConfigurations = array(); $modelConfiguration = $this->getModelConfiguration($objectName); $viewConfiguration = $this->getViewConfiguration($objectName, $viewName); if (isset($viewConfiguration['vi...
php
public function getViewConfigurationsByViewgroupOfView($objectName, $viewName) { $viewConfigurations = array(); $modelConfiguration = $this->getModelConfiguration($objectName); $viewConfiguration = $this->getViewConfiguration($objectName, $viewName); if (isset($viewConfiguration['vi...
[ "public", "function", "getViewConfigurationsByViewgroupOfView", "(", "$", "objectName", ",", "$", "viewName", ")", "{", "$", "viewConfigurations", "=", "array", "(", ")", ";", "$", "modelConfiguration", "=", "$", "this", "->", "getModelConfiguration", "(", "$", ...
Returns all the field configurations of views in the viewgroup of the specified view name. @param string $objectName @param string $viewName @return array
[ "Returns", "all", "the", "field", "configurations", "of", "views", "in", "the", "viewgroup", "of", "the", "specified", "view", "name", "." ]
83368c13a7c8c2cf0ee95b36fe81d84a7129fee2
https://github.com/FlexModel/FlexModel/blob/83368c13a7c8c2cf0ee95b36fe81d84a7129fee2/src/FlexModel.php#L280-L296
train
FlexModel/FlexModel
src/FlexModel.php
FlexModel.getFieldNames
public function getFieldNames($objectName) { $fieldNames = array(); $modelConfiguration = $this->getModelConfiguration($objectName); if (isset($modelConfiguration['__field_index'])) { $fieldNames = array_keys($modelConfiguration['__field_index']); } return $field...
php
public function getFieldNames($objectName) { $fieldNames = array(); $modelConfiguration = $this->getModelConfiguration($objectName); if (isset($modelConfiguration['__field_index'])) { $fieldNames = array_keys($modelConfiguration['__field_index']); } return $field...
[ "public", "function", "getFieldNames", "(", "$", "objectName", ")", "{", "$", "fieldNames", "=", "array", "(", ")", ";", "$", "modelConfiguration", "=", "$", "this", "->", "getModelConfiguration", "(", "$", "objectName", ")", ";", "if", "(", "isset", "(", ...
Returns the field names of the specified object. @return array
[ "Returns", "the", "field", "names", "of", "the", "specified", "object", "." ]
83368c13a7c8c2cf0ee95b36fe81d84a7129fee2
https://github.com/FlexModel/FlexModel/blob/83368c13a7c8c2cf0ee95b36fe81d84a7129fee2/src/FlexModel.php#L303-L312
train
FlexModel/FlexModel
src/FlexModel.php
FlexModel.getFieldNamesByView
public function getFieldNamesByView($objectName, $viewName) { $fieldNames = array(); $fieldConfigurations = $this->getFieldsByView($objectName, $viewName); foreach ($fieldConfigurations as $fieldConfiguration) { array_push($fieldNames, $fieldConfiguration['name']); } ...
php
public function getFieldNamesByView($objectName, $viewName) { $fieldNames = array(); $fieldConfigurations = $this->getFieldsByView($objectName, $viewName); foreach ($fieldConfigurations as $fieldConfiguration) { array_push($fieldNames, $fieldConfiguration['name']); } ...
[ "public", "function", "getFieldNamesByView", "(", "$", "objectName", ",", "$", "viewName", ")", "{", "$", "fieldNames", "=", "array", "(", ")", ";", "$", "fieldConfigurations", "=", "$", "this", "->", "getFieldsByView", "(", "$", "objectName", ",", "$", "v...
Returns the field names of the specified view in the object. @param string $objectName @param string $viewName @return array
[ "Returns", "the", "field", "names", "of", "the", "specified", "view", "in", "the", "object", "." ]
83368c13a7c8c2cf0ee95b36fe81d84a7129fee2
https://github.com/FlexModel/FlexModel/blob/83368c13a7c8c2cf0ee95b36fe81d84a7129fee2/src/FlexModel.php#L322-L331
train
FlexModel/FlexModel
src/FlexModel.php
FlexModel.getFields
public function getFields($objectName) { $fieldConfigurations = array(); $modelConfiguration = $this->getModelConfiguration($objectName); if (is_array($modelConfiguration)) { $fieldConfigurations = $modelConfiguration['fields']; } return $fieldConfigurations; ...
php
public function getFields($objectName) { $fieldConfigurations = array(); $modelConfiguration = $this->getModelConfiguration($objectName); if (is_array($modelConfiguration)) { $fieldConfigurations = $modelConfiguration['fields']; } return $fieldConfigurations; ...
[ "public", "function", "getFields", "(", "$", "objectName", ")", "{", "$", "fieldConfigurations", "=", "array", "(", ")", ";", "$", "modelConfiguration", "=", "$", "this", "->", "getModelConfiguration", "(", "$", "objectName", ")", ";", "if", "(", "is_array",...
Returns all fields for the object. @param string $objectName @return array
[ "Returns", "all", "fields", "for", "the", "object", "." ]
83368c13a7c8c2cf0ee95b36fe81d84a7129fee2
https://github.com/FlexModel/FlexModel/blob/83368c13a7c8c2cf0ee95b36fe81d84a7129fee2/src/FlexModel.php#L340-L349
train
FlexModel/FlexModel
src/FlexModel.php
FlexModel.getFieldsByDatatype
public function getFieldsByDatatype($objectName, $datatype) { $datatypeFieldConfigurations = array(); $fieldConfigurations = $this->getFields($objectName); foreach ($fieldConfigurations as $fieldConfiguration) { if ($fieldConfiguration['datatype'] == $datatype) { ...
php
public function getFieldsByDatatype($objectName, $datatype) { $datatypeFieldConfigurations = array(); $fieldConfigurations = $this->getFields($objectName); foreach ($fieldConfigurations as $fieldConfiguration) { if ($fieldConfiguration['datatype'] == $datatype) { ...
[ "public", "function", "getFieldsByDatatype", "(", "$", "objectName", ",", "$", "datatype", ")", "{", "$", "datatypeFieldConfigurations", "=", "array", "(", ")", ";", "$", "fieldConfigurations", "=", "$", "this", "->", "getFields", "(", "$", "objectName", ")", ...
Returns all fields with the specified datatype for an object. @param string $objectName @param string $datatype @return array
[ "Returns", "all", "fields", "with", "the", "specified", "datatype", "for", "an", "object", "." ]
83368c13a7c8c2cf0ee95b36fe81d84a7129fee2
https://github.com/FlexModel/FlexModel/blob/83368c13a7c8c2cf0ee95b36fe81d84a7129fee2/src/FlexModel.php#L359-L371
train
FlexModel/FlexModel
src/FlexModel.php
FlexModel.getFieldsByView
public function getFieldsByView($objectName, $viewName) { $fieldConfigurations = array(); $viewConfiguration = $this->getViewConfiguration($objectName, $viewName); if (is_array($viewConfiguration)) { $fieldConfigurations = $viewConfiguration["fields"]; foreach ($fiel...
php
public function getFieldsByView($objectName, $viewName) { $fieldConfigurations = array(); $viewConfiguration = $this->getViewConfiguration($objectName, $viewName); if (is_array($viewConfiguration)) { $fieldConfigurations = $viewConfiguration["fields"]; foreach ($fiel...
[ "public", "function", "getFieldsByView", "(", "$", "objectName", ",", "$", "viewName", ")", "{", "$", "fieldConfigurations", "=", "array", "(", ")", ";", "$", "viewConfiguration", "=", "$", "this", "->", "getViewConfiguration", "(", "$", "objectName", ",", "...
Returns the fields in the object view. @param string $objectName @param string $viewName @return array
[ "Returns", "the", "fields", "in", "the", "object", "view", "." ]
83368c13a7c8c2cf0ee95b36fe81d84a7129fee2
https://github.com/FlexModel/FlexModel/blob/83368c13a7c8c2cf0ee95b36fe81d84a7129fee2/src/FlexModel.php#L381-L395
train
FlexModel/FlexModel
src/FlexModel.php
FlexModel.getField
public function getField($objectName, $fieldName, $excludeFormDefaults = true) { $modelConfiguration = $this->getModelConfiguration($objectName); if (isset($modelConfiguration['__field_index'][$fieldName])) { $fieldConfiguration = array_replace_recursive($this->defaultFieldConfiguration,...
php
public function getField($objectName, $fieldName, $excludeFormDefaults = true) { $modelConfiguration = $this->getModelConfiguration($objectName); if (isset($modelConfiguration['__field_index'][$fieldName])) { $fieldConfiguration = array_replace_recursive($this->defaultFieldConfiguration,...
[ "public", "function", "getField", "(", "$", "objectName", ",", "$", "fieldName", ",", "$", "excludeFormDefaults", "=", "true", ")", "{", "$", "modelConfiguration", "=", "$", "this", "->", "getModelConfiguration", "(", "$", "objectName", ")", ";", "if", "(", ...
Returns the configuration of a field in the specified object. @param string $objectName @param string $fieldName @return array|null
[ "Returns", "the", "configuration", "of", "a", "field", "in", "the", "specified", "object", "." ]
83368c13a7c8c2cf0ee95b36fe81d84a7129fee2
https://github.com/FlexModel/FlexModel/blob/83368c13a7c8c2cf0ee95b36fe81d84a7129fee2/src/FlexModel.php#L405-L416
train
FlexModel/FlexModel
src/FlexModel.php
FlexModel.getReferencedField
public function getReferencedField($objectName, $fieldName, array & $excludedFieldNameParts = array(), $objectReferencesOnly = true) { $foundFieldName = null; $fieldNameParts = explode('_', $fieldName); $excludedFieldNameParts = array(); $initial = false; while (count($fieldN...
php
public function getReferencedField($objectName, $fieldName, array & $excludedFieldNameParts = array(), $objectReferencesOnly = true) { $foundFieldName = null; $fieldNameParts = explode('_', $fieldName); $excludedFieldNameParts = array(); $initial = false; while (count($fieldN...
[ "public", "function", "getReferencedField", "(", "$", "objectName", ",", "$", "fieldName", ",", "array", "&", "$", "excludedFieldNameParts", "=", "array", "(", ")", ",", "$", "objectReferencesOnly", "=", "true", ")", "{", "$", "foundFieldName", "=", "null", ...
Returns the field reference of the specified object. The returned excluded field name parts can be used to retrieve the field for the referenced object. @param string $objectName @param string $fieldName @param array $excludedFieldNameParts @param bool $objectReferencesOnly @return array|null
[ "Returns", "the", "field", "reference", "of", "the", "specified", "object", ".", "The", "returned", "excluded", "field", "name", "parts", "can", "be", "used", "to", "retrieve", "the", "field", "for", "the", "referenced", "object", "." ]
83368c13a7c8c2cf0ee95b36fe81d84a7129fee2
https://github.com/FlexModel/FlexModel/blob/83368c13a7c8c2cf0ee95b36fe81d84a7129fee2/src/FlexModel.php#L429-L452
train
FlexModel/FlexModel
src/FlexModel.php
FlexModel.generateCacheFile
private function generateCacheFile() { $previousErrorSetting = libxml_use_internal_errors(true); libxml_clear_errors(); if (@$this->domDocument->schemaValidate($this->xmlSchemaFile)) { $this->domDocument->preserveWhiteSpace = false; // Reload the XML to strip whitespa...
php
private function generateCacheFile() { $previousErrorSetting = libxml_use_internal_errors(true); libxml_clear_errors(); if (@$this->domDocument->schemaValidate($this->xmlSchemaFile)) { $this->domDocument->preserveWhiteSpace = false; // Reload the XML to strip whitespa...
[ "private", "function", "generateCacheFile", "(", ")", "{", "$", "previousErrorSetting", "=", "libxml_use_internal_errors", "(", "true", ")", ";", "libxml_clear_errors", "(", ")", ";", "if", "(", "@", "$", "this", "->", "domDocument", "->", "schemaValidate", "(",...
Generates the cache file.
[ "Generates", "the", "cache", "file", "." ]
83368c13a7c8c2cf0ee95b36fe81d84a7129fee2
https://github.com/FlexModel/FlexModel/blob/83368c13a7c8c2cf0ee95b36fe81d84a7129fee2/src/FlexModel.php#L525-L554
train
romm/configuration_object
Classes/Service/Items/Cache/CacheService.php
CacheService.configurationObjectAfter
public function configurationObjectAfter(GetConfigurationObjectDTO $serviceDataTransferObject) { $this->delay( self::PRIORITY_SAVE_OBJECT_IN_CACHE, function (GetConfigurationObjectDTO $serviceDataTransferObject) { $cacheHash = $this->getConfigurationObjectCacheHash($s...
php
public function configurationObjectAfter(GetConfigurationObjectDTO $serviceDataTransferObject) { $this->delay( self::PRIORITY_SAVE_OBJECT_IN_CACHE, function (GetConfigurationObjectDTO $serviceDataTransferObject) { $cacheHash = $this->getConfigurationObjectCacheHash($s...
[ "public", "function", "configurationObjectAfter", "(", "GetConfigurationObjectDTO", "$", "serviceDataTransferObject", ")", "{", "$", "this", "->", "delay", "(", "self", "::", "PRIORITY_SAVE_OBJECT_IN_CACHE", ",", "function", "(", "GetConfigurationObjectDTO", "$", "service...
After a configuration object has been built, it is stored in the cache. @param GetConfigurationObjectDTO $serviceDataTransferObject
[ "After", "a", "configuration", "object", "has", "been", "built", "it", "is", "stored", "in", "the", "cache", "." ]
d3a40903386c2e0766bd8279337fe6da45cf5ce3
https://github.com/romm/configuration_object/blob/d3a40903386c2e0766bd8279337fe6da45cf5ce3/Classes/Service/Items/Cache/CacheService.php#L161-L173
train
libreworks/caridea-validate
src/Rule/Set.php
Set.add
public function add(\Caridea\Validate\Rule ...$rules): self { $this->rules = array_merge($this->rules, $rules); return $this; }
php
public function add(\Caridea\Validate\Rule ...$rules): self { $this->rules = array_merge($this->rules, $rules); return $this; }
[ "public", "function", "add", "(", "\\", "Caridea", "\\", "Validate", "\\", "Rule", "...", "$", "rules", ")", ":", "self", "{", "$", "this", "->", "rules", "=", "array_merge", "(", "$", "this", "->", "rules", ",", "$", "rules", ")", ";", "return", "...
Adds one or more `Rule`s into this `Set`. @param \Caridea\Validate\Rule ...$rules The rules to add @return $this Provides a fluent interface
[ "Adds", "one", "or", "more", "Rule", "s", "into", "this", "Set", "." ]
625835694d34591bfb1e3b2ce60c2cc28a28d006
https://github.com/libreworks/caridea-validate/blob/625835694d34591bfb1e3b2ce60c2cc28a28d006/src/Rule/Set.php#L59-L63
train
libreworks/caridea-validate
src/Rule/Set.php
Set.addAll
public function addAll(array $rules): self { try { return $this->add(...$rules); } catch (\TypeError $e) { throw new \InvalidArgumentException('Only Rule objects are allowed', 0, $e); } }
php
public function addAll(array $rules): self { try { return $this->add(...$rules); } catch (\TypeError $e) { throw new \InvalidArgumentException('Only Rule objects are allowed', 0, $e); } }
[ "public", "function", "addAll", "(", "array", "$", "rules", ")", ":", "self", "{", "try", "{", "return", "$", "this", "->", "add", "(", "...", "$", "rules", ")", ";", "}", "catch", "(", "\\", "TypeError", "$", "e", ")", "{", "throw", "new", "\\",...
Adds several `Rule`s into this `Set`. @param \Caridea\Validate\Rule[] $rules The rules to add @return $this Provides a fluent interface @throws \InvalidArgumentException if `$rules` contains invalid types
[ "Adds", "several", "Rule", "s", "into", "this", "Set", "." ]
625835694d34591bfb1e3b2ce60c2cc28a28d006
https://github.com/libreworks/caridea-validate/blob/625835694d34591bfb1e3b2ce60c2cc28a28d006/src/Rule/Set.php#L72-L79
train
libreworks/caridea-validate
src/Rule/Set.php
Set.merge
public function merge(Set $rules): self { $this->rules = array_merge($this->rules, $rules->rules); return $this; }
php
public function merge(Set $rules): self { $this->rules = array_merge($this->rules, $rules->rules); return $this; }
[ "public", "function", "merge", "(", "Set", "$", "rules", ")", ":", "self", "{", "$", "this", "->", "rules", "=", "array_merge", "(", "$", "this", "->", "rules", ",", "$", "rules", "->", "rules", ")", ";", "return", "$", "this", ";", "}" ]
Adds the entries from another `Set` into this one. @param \Caridea\Validate\Rule\Set $rules The rules to add @return $this Provides a fluent interface
[ "Adds", "the", "entries", "from", "another", "Set", "into", "this", "one", "." ]
625835694d34591bfb1e3b2ce60c2cc28a28d006
https://github.com/libreworks/caridea-validate/blob/625835694d34591bfb1e3b2ce60c2cc28a28d006/src/Rule/Set.php#L87-L91
train
vanilla/garden-daemon
src/Daemon.php
Daemon.initializeDaemon
protected function initializeDaemon() { declare (ticks = 100); // Install signal handlers pcntl_signal(SIGHUP, [$this, 'handleSignal']); pcntl_signal(SIGINT, [$this, 'handleSignal']); pcntl_signal(SIGTERM, [$this, 'handleSignal']); pcntl_signal(SIGCHLD, [$this, 'handleSi...
php
protected function initializeDaemon() { declare (ticks = 100); // Install signal handlers pcntl_signal(SIGHUP, [$this, 'handleSignal']); pcntl_signal(SIGINT, [$this, 'handleSignal']); pcntl_signal(SIGTERM, [$this, 'handleSignal']); pcntl_signal(SIGCHLD, [$this, 'handleSi...
[ "protected", "function", "initializeDaemon", "(", ")", "{", "declare", "(", "ticks", "=", "100", ")", ";", "// Install signal handlers", "pcntl_signal", "(", "SIGHUP", ",", "[", "$", "this", ",", "'handleSignal'", "]", ")", ";", "pcntl_signal", "(", "SIGINT", ...
Post-daemonize initialization
[ "Post", "-", "daemonize", "initialization" ]
13a5cbbac08ab6473e4b11bf00179fe1e26235a6
https://github.com/vanilla/garden-daemon/blob/13a5cbbac08ab6473e4b11bf00179fe1e26235a6/src/Daemon.php#L474-L484
train
vanilla/garden-daemon
src/Daemon.php
Daemon.getPayloadInstance
protected function getPayloadInstance(): AppInterface { if (!($this->instance instanceof AppInterface)) { $appName = $this->get('appname', null); $appNamespace = $this->get('appnamespace', null); // Run App $appClassName = ucfirst($appName); if (!is_n...
php
protected function getPayloadInstance(): AppInterface { if (!($this->instance instanceof AppInterface)) { $appName = $this->get('appname', null); $appNamespace = $this->get('appnamespace', null); // Run App $appClassName = ucfirst($appName); if (!is_n...
[ "protected", "function", "getPayloadInstance", "(", ")", ":", "AppInterface", "{", "if", "(", "!", "(", "$", "this", "->", "instance", "instanceof", "AppInterface", ")", ")", "{", "$", "appName", "=", "$", "this", "->", "get", "(", "'appname'", ",", "nul...
Get an instance of the app @return AppInterface
[ "Get", "an", "instance", "of", "the", "app" ]
13a5cbbac08ab6473e4b11bf00179fe1e26235a6
https://github.com/vanilla/garden-daemon/blob/13a5cbbac08ab6473e4b11bf00179fe1e26235a6/src/Daemon.php#L491-L505
train
vanilla/garden-daemon
src/Daemon.php
Daemon.payloadExec
protected function payloadExec($method, $args = []) { $this->getPayloadInstance(); if (method_exists($this->instance, $method)) { return $this->di->call([$this->instance, $method], $args); } return null; }
php
protected function payloadExec($method, $args = []) { $this->getPayloadInstance(); if (method_exists($this->instance, $method)) { return $this->di->call([$this->instance, $method], $args); } return null; }
[ "protected", "function", "payloadExec", "(", "$", "method", ",", "$", "args", "=", "[", "]", ")", "{", "$", "this", "->", "getPayloadInstance", "(", ")", ";", "if", "(", "method_exists", "(", "$", "this", "->", "instance", ",", "$", "method", ")", ")...
Execute callback on payload @param string $method @param mixed $args @return mixed
[ "Execute", "callback", "on", "payload" ]
13a5cbbac08ab6473e4b11bf00179fe1e26235a6
https://github.com/vanilla/garden-daemon/blob/13a5cbbac08ab6473e4b11bf00179fe1e26235a6/src/Daemon.php#L514-L520
train