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
beyoio/beyod
Parser.php
Parser.input
public function input($buffer, $connection) { $len = strlen($buffer); if ($this->max_packet_size >0 && $len >= $this->max_packet_size) { throw new \Exception($connection.' request packet size exceed max_packet_size ', Server::ERROR_LARGE_PACKET); } retur...
php
public function input($buffer, $connection) { $len = strlen($buffer); if ($this->max_packet_size >0 && $len >= $this->max_packet_size) { throw new \Exception($connection.' request packet size exceed max_packet_size ', Server::ERROR_LARGE_PACKET); } retur...
[ "public", "function", "input", "(", "$", "buffer", ",", "$", "connection", ")", "{", "$", "len", "=", "strlen", "(", "$", "buffer", ")", ";", "if", "(", "$", "this", "->", "max_packet_size", ">", "0", "&&", "$", "len", ">=", "$", "this", "->", "m...
Determines whether the current connection has received the complete packet, zero value indicates that a complete packet is not received yet, positive value indicates that a complete packet has been received and represents the number of bytes of the packet, negative value indicates that the data is invalid or unrecogniz...
[ "Determines", "whether", "the", "current", "connection", "has", "received", "the", "complete", "packet", "zero", "value", "indicates", "that", "a", "complete", "packet", "is", "not", "received", "yet", "positive", "value", "indicates", "that", "a", "complete", "...
11941db9c4ae4abbca6c8e634d21873c690efc79
https://github.com/beyoio/beyod/blob/11941db9c4ae4abbca6c8e634d21873c690efc79/Parser.php#L51-L60
train
kiwi-26/line-bot-test-helper
src/WebhookEvent.php
WebhookEvent.body
public function body() { $event = []; if (!empty($this->replyToken)) { $event['replyToken'] = $this->replyToken; } $event['type'] = $this->eventType(); $event['timestamp'] = time(); $event['source'] = $this->source; $event['message'] = $this->message; ...
php
public function body() { $event = []; if (!empty($this->replyToken)) { $event['replyToken'] = $this->replyToken; } $event['type'] = $this->eventType(); $event['timestamp'] = time(); $event['source'] = $this->source; $event['message'] = $this->message; ...
[ "public", "function", "body", "(", ")", "{", "$", "event", "=", "[", "]", ";", "if", "(", "!", "empty", "(", "$", "this", "->", "replyToken", ")", ")", "{", "$", "event", "[", "'replyToken'", "]", "=", "$", "this", "->", "replyToken", ";", "}", ...
Build webhook event and return body. Original webhook request body has this signature. @return String json encoded body.
[ "Build", "webhook", "event", "and", "return", "body", ".", "Original", "webhook", "request", "body", "has", "this", "signature", "." ]
e1d6fb611e73016a5242c4b28238686926f262ba
https://github.com/kiwi-26/line-bot-test-helper/blob/e1d6fb611e73016a5242c4b28238686926f262ba/src/WebhookEvent.php#L40-L51
train
luoxiaojun1992/lb_framework
components/traits/lb/Config.php
Config.getCustomConfig
public function getCustomConfig($name = '') { $custom_config = $this->getConfigByName('custom'); return $name ? ($custom_config[$name] ?? null) : $custom_config; }
php
public function getCustomConfig($name = '') { $custom_config = $this->getConfigByName('custom'); return $name ? ($custom_config[$name] ?? null) : $custom_config; }
[ "public", "function", "getCustomConfig", "(", "$", "name", "=", "''", ")", "{", "$", "custom_config", "=", "$", "this", "->", "getConfigByName", "(", "'custom'", ")", ";", "return", "$", "name", "?", "(", "$", "custom_config", "[", "$", "name", "]", "?...
Get Custom Configuration @param string $name @return array|null
[ "Get", "Custom", "Configuration" ]
12a865729e7738d7d1e07371ad7203243c4571fa
https://github.com/luoxiaojun1992/lb_framework/blob/12a865729e7738d7d1e07371ad7203243c4571fa/components/traits/lb/Config.php#L100-L104
train
luoxiaojun1992/lb_framework
components/traits/lb/Config.php
Config.getConfigByName
public function getConfigByName($config_name) { if ($this->isSingle()) { if (isset($this->containers['config'])) { return $this->containers['config']->get($config_name); } } return []; }
php
public function getConfigByName($config_name) { if ($this->isSingle()) { if (isset($this->containers['config'])) { return $this->containers['config']->get($config_name); } } return []; }
[ "public", "function", "getConfigByName", "(", "$", "config_name", ")", "{", "if", "(", "$", "this", "->", "isSingle", "(", ")", ")", "{", "if", "(", "isset", "(", "$", "this", "->", "containers", "[", "'config'", "]", ")", ")", "{", "return", "$", ...
Get Configuration By Name @param $config_name @return array
[ "Get", "Configuration", "By", "Name" ]
12a865729e7738d7d1e07371ad7203243c4571fa
https://github.com/luoxiaojun1992/lb_framework/blob/12a865729e7738d7d1e07371ad7203243c4571fa/components/traits/lb/Config.php#L215-L223
train
luoxiaojun1992/lb_framework
components/traits/lb/Config.php
Config.getUrlManagerConfig
public function getUrlManagerConfig($item) { $urlManager = $this->getConfigByName('urlManager'); if (isset($urlManager[$item])) { return $urlManager[$item]; } return false; }
php
public function getUrlManagerConfig($item) { $urlManager = $this->getConfigByName('urlManager'); if (isset($urlManager[$item])) { return $urlManager[$item]; } return false; }
[ "public", "function", "getUrlManagerConfig", "(", "$", "item", ")", "{", "$", "urlManager", "=", "$", "this", "->", "getConfigByName", "(", "'urlManager'", ")", ";", "if", "(", "isset", "(", "$", "urlManager", "[", "$", "item", "]", ")", ")", "{", "ret...
Get Url Manager Config By Item Name @param $item @return bool
[ "Get", "Url", "Manager", "Config", "By", "Item", "Name" ]
12a865729e7738d7d1e07371ad7203243c4571fa
https://github.com/luoxiaojun1992/lb_framework/blob/12a865729e7738d7d1e07371ad7203243c4571fa/components/traits/lb/Config.php#L231-L238
train
luoxiaojun1992/lb_framework
components/traits/lb/Config.php
Config.getJsFiles
public function getJsFiles($controller_id, $template_id) { $js_files = []; $asset_config = $this->getConfigByName('assets'); if (isset($asset_config[$controller_id][$template_id]['js'])) { $js_files = $asset_config[$controller_id][$template_id]['js']; } return $js...
php
public function getJsFiles($controller_id, $template_id) { $js_files = []; $asset_config = $this->getConfigByName('assets'); if (isset($asset_config[$controller_id][$template_id]['js'])) { $js_files = $asset_config[$controller_id][$template_id]['js']; } return $js...
[ "public", "function", "getJsFiles", "(", "$", "controller_id", ",", "$", "template_id", ")", "{", "$", "js_files", "=", "[", "]", ";", "$", "asset_config", "=", "$", "this", "->", "getConfigByName", "(", "'assets'", ")", ";", "if", "(", "isset", "(", "...
Get Js Files @param $controller_id @param $template_id @return array
[ "Get", "Js", "Files" ]
12a865729e7738d7d1e07371ad7203243c4571fa
https://github.com/luoxiaojun1992/lb_framework/blob/12a865729e7738d7d1e07371ad7203243c4571fa/components/traits/lb/Config.php#L267-L275
train
luoxiaojun1992/lb_framework
components/traits/lb/Config.php
Config.getCssFiles
public function getCssFiles($controller_id, $template_id) { $css_files = []; $asset_config = $this->getConfigByName('assets'); if (isset($asset_config[$controller_id][$template_id]['css'])) { $css_files = $asset_config[$controller_id][$template_id]['css']; } retur...
php
public function getCssFiles($controller_id, $template_id) { $css_files = []; $asset_config = $this->getConfigByName('assets'); if (isset($asset_config[$controller_id][$template_id]['css'])) { $css_files = $asset_config[$controller_id][$template_id]['css']; } retur...
[ "public", "function", "getCssFiles", "(", "$", "controller_id", ",", "$", "template_id", ")", "{", "$", "css_files", "=", "[", "]", ";", "$", "asset_config", "=", "$", "this", "->", "getConfigByName", "(", "'assets'", ")", ";", "if", "(", "isset", "(", ...
Get Css Files @param $controller_id @param $template_id @return array
[ "Get", "Css", "Files" ]
12a865729e7738d7d1e07371ad7203243c4571fa
https://github.com/luoxiaojun1992/lb_framework/blob/12a865729e7738d7d1e07371ad7203243c4571fa/components/traits/lb/Config.php#L284-L292
train
Synapse-Cmf/synapse-cmf
src/Synapse/Cmf/Framework/Engine/Decorator/Component/ComponentDecorator.php
ComponentDecorator.prepare
public function prepare( $content, ThemeInterface $theme, TemplateInterface $template, ZoneInterface $zone, ComponentInterface $component ) { $this->contextStack->push( $this->contextBuilder ->setContent($content) ->setTheme...
php
public function prepare( $content, ThemeInterface $theme, TemplateInterface $template, ZoneInterface $zone, ComponentInterface $component ) { $this->contextStack->push( $this->contextBuilder ->setContent($content) ->setTheme...
[ "public", "function", "prepare", "(", "$", "content", ",", "ThemeInterface", "$", "theme", ",", "TemplateInterface", "$", "template", ",", "ZoneInterface", "$", "zone", ",", "ComponentInterface", "$", "component", ")", "{", "$", "this", "->", "contextStack", "...
Prepare decorator context. @param ContentInterface|Content $content @param ThemeInterface $theme @param TemplateInterface $template @param ZoneInterface $zone @param ComponentInterface $component @return self
[ "Prepare", "decorator", "context", "." ]
d8122a4150a83d5607289724425cf35c56a5e880
https://github.com/Synapse-Cmf/synapse-cmf/blob/d8122a4150a83d5607289724425cf35c56a5e880/src/Synapse/Cmf/Framework/Engine/Decorator/Component/ComponentDecorator.php#L64-L82
train
znframework/package-hypertext
BootstrapAttributes.php
BootstrapAttributes.usePropertyOptions
protected function usePropertyOptions($selector, $content, $type) { $this->isBootstrapAttribute('on', function($return) use($type) { $this->settings['attr']['on'] = Base::suffix($return, '.bs.' . $type); }); return $this->bootstrapObjectOptions($selector === 'all' ? '[da...
php
protected function usePropertyOptions($selector, $content, $type) { $this->isBootstrapAttribute('on', function($return) use($type) { $this->settings['attr']['on'] = Base::suffix($return, '.bs.' . $type); }); return $this->bootstrapObjectOptions($selector === 'all' ? '[da...
[ "protected", "function", "usePropertyOptions", "(", "$", "selector", ",", "$", "content", ",", "$", "type", ")", "{", "$", "this", "->", "isBootstrapAttribute", "(", "'on'", ",", "function", "(", "$", "return", ")", "use", "(", "$", "type", ")", "{", "...
Protected use property options
[ "Protected", "use", "property", "options" ]
12bbc3bd47a2fae735f638a3e01cc82c1b9c9005
https://github.com/znframework/package-hypertext/blob/12bbc3bd47a2fae735f638a3e01cc82c1b9c9005/BootstrapAttributes.php#L56-L64
train
Etenil/assegai
src/assegai/modules/mail/services/ses/utilities/complextype.class.php
CFComplexType.json
public static function json($json, $member = '', $default_key = '') { return self::option_group(json_decode($json, true), $member, $default_key); }
php
public static function json($json, $member = '', $default_key = '') { return self::option_group(json_decode($json, true), $member, $default_key); }
[ "public", "static", "function", "json", "(", "$", "json", ",", "$", "member", "=", "''", ",", "$", "default_key", "=", "''", ")", "{", "return", "self", "::", "option_group", "(", "json_decode", "(", "$", "json", ",", "true", ")", ",", "$", "member",...
Takes a JSON object, as a string, to convert to query string keys. @param string $json (Required) A JSON object. The JSON string should use canonical rules (e.g., double quotes, quoted keys) as is required by PHP's <php:json_encode()> function. @param string $member (Optional) The name of the "member" property that AW...
[ "Takes", "a", "JSON", "object", "as", "a", "string", "to", "convert", "to", "query", "string", "keys", "." ]
d43cce1a88f1c332f60dd0a4374b17764852af9e
https://github.com/Etenil/assegai/blob/d43cce1a88f1c332f60dd0a4374b17764852af9e/src/assegai/modules/mail/services/ses/utilities/complextype.class.php#L39-L42
train
Etenil/assegai
src/assegai/modules/mail/services/ses/utilities/complextype.class.php
CFComplexType.yaml
public static function yaml($yaml, $member = '', $default_key = '') { return self::option_group(sfYaml::load($yaml), $member, $default_key); }
php
public static function yaml($yaml, $member = '', $default_key = '') { return self::option_group(sfYaml::load($yaml), $member, $default_key); }
[ "public", "static", "function", "yaml", "(", "$", "yaml", ",", "$", "member", "=", "''", ",", "$", "default_key", "=", "''", ")", "{", "return", "self", "::", "option_group", "(", "sfYaml", "::", "load", "(", "$", "yaml", ")", ",", "$", "member", "...
Takes a YAML object, as a string, to convert to query string keys. @param string $yaml (Required) A YAML object. @param string $member (Optional) The name of the "member" property that AWS uses for lists in certain services. Defaults to an empty string. @param string $default_key (Optional) The default key to use when...
[ "Takes", "a", "YAML", "object", "as", "a", "string", "to", "convert", "to", "query", "string", "keys", "." ]
d43cce1a88f1c332f60dd0a4374b17764852af9e
https://github.com/Etenil/assegai/blob/d43cce1a88f1c332f60dd0a4374b17764852af9e/src/assegai/modules/mail/services/ses/utilities/complextype.class.php#L52-L55
train
alekitto/metadata
lib/Exception/InvalidArgumentException.php
InvalidArgumentException.create
public static function create($reason): self { $arguments = func_get_args(); switch ($reason) { case static::CLASS_DOES_NOT_EXIST: $message = sprintf('Class %s does not exist. Cannot retrieve its metadata', $arguments[1]); return new static($message); ...
php
public static function create($reason): self { $arguments = func_get_args(); switch ($reason) { case static::CLASS_DOES_NOT_EXIST: $message = sprintf('Class %s does not exist. Cannot retrieve its metadata', $arguments[1]); return new static($message); ...
[ "public", "static", "function", "create", "(", "$", "reason", ")", ":", "self", "{", "$", "arguments", "=", "func_get_args", "(", ")", ";", "switch", "(", "$", "reason", ")", "{", "case", "static", "::", "CLASS_DOES_NOT_EXIST", ":", "$", "message", "=", ...
Create a new instance of InvalidArgumentException with meaningful message. @param $reason @return self
[ "Create", "a", "new", "instance", "of", "InvalidArgumentException", "with", "meaningful", "message", "." ]
0422ac8d7fe72d5fa8cc51b6f1e173866e8afb2c
https://github.com/alekitto/metadata/blob/0422ac8d7fe72d5fa8cc51b6f1e173866e8afb2c/lib/Exception/InvalidArgumentException.php#L20-L62
train
event-bus/event-dispatcher
src/Util/Pattern/PatternFactory.php
PatternFactory.getPatternFor
public static function getPatternFor(Pattern $parent, $word) { if (self::isWildcard($word)) { return self::getWildcardPattern($parent, $word); } return new Word($word); }
php
public static function getPatternFor(Pattern $parent, $word) { if (self::isWildcard($word)) { return self::getWildcardPattern($parent, $word); } return new Word($word); }
[ "public", "static", "function", "getPatternFor", "(", "Pattern", "$", "parent", ",", "$", "word", ")", "{", "if", "(", "self", "::", "isWildcard", "(", "$", "word", ")", ")", "{", "return", "self", "::", "getWildcardPattern", "(", "$", "parent", ",", "...
Builds a pattern node based on a given word and its parent. @param Pattern $parent The parent pattern object, in case a loop node will be built. @param string $word A single word from a composite pattern. @return Pattern A pattern object.
[ "Builds", "a", "pattern", "node", "based", "on", "a", "given", "word", "and", "its", "parent", "." ]
0954a9fe0084fbd096b1c32e386c21fb4754b5ff
https://github.com/event-bus/event-dispatcher/blob/0954a9fe0084fbd096b1c32e386c21fb4754b5ff/src/Util/Pattern/PatternFactory.php#L20-L27
train
as3io/modlr
src/Models/Collections/ModelCollection.php
ModelCollection.loadFromStore
protected function loadFromStore() { if (false === $this->isLoaded()) { // Loads collection from the database on iteration. $models = $this->store->loadCollection($this); $this->setModels($models); $this->loaded = true; } }
php
protected function loadFromStore() { if (false === $this->isLoaded()) { // Loads collection from the database on iteration. $models = $this->store->loadCollection($this); $this->setModels($models); $this->loaded = true; } }
[ "protected", "function", "loadFromStore", "(", ")", "{", "if", "(", "false", "===", "$", "this", "->", "isLoaded", "(", ")", ")", "{", "// Loads collection from the database on iteration.", "$", "models", "=", "$", "this", "->", "store", "->", "loadCollection", ...
Loads this collection from the store.
[ "Loads", "this", "collection", "from", "the", "store", "." ]
7e684b88bb22a2e18397df9402075c6533084b16
https://github.com/as3io/modlr/blob/7e684b88bb22a2e18397df9402075c6533084b16/src/Models/Collections/ModelCollection.php#L103-L111
train
alphacomm/alpharpc
src/AlphaRPC/Worker/WorkerCommunication.php
WorkerCommunication.setDelay
public function setDelay($delay) { if (!ctype_digit((string) $delay)) { throw new \InvalidArgumentException('Delay must be a number.'); } $this->delay = $delay; return $this; }
php
public function setDelay($delay) { if (!ctype_digit((string) $delay)) { throw new \InvalidArgumentException('Delay must be a number.'); } $this->delay = $delay; return $this; }
[ "public", "function", "setDelay", "(", "$", "delay", ")", "{", "if", "(", "!", "ctype_digit", "(", "(", "string", ")", "$", "delay", ")", ")", "{", "throw", "new", "\\", "InvalidArgumentException", "(", "'Delay must be a number.'", ")", ";", "}", "$", "t...
The time it takes for the handler to respond. @param int $delay @throws \InvalidArgumentException @return WorkerCommunication
[ "The", "time", "it", "takes", "for", "the", "handler", "to", "respond", "." ]
cf162854500554c4ba8d39f2675de35a49c30ed0
https://github.com/alphacomm/alpharpc/blob/cf162854500554c4ba8d39f2675de35a49c30ed0/src/AlphaRPC/Worker/WorkerCommunication.php#L115-L123
train
alphacomm/alpharpc
src/AlphaRPC/Worker/WorkerCommunication.php
WorkerCommunication.start
public function start() { $this->workerHandlerReady = true; $this->serviceStreamReady = true; $this->sendToService(new ActionListRequest()); }
php
public function start() { $this->workerHandlerReady = true; $this->serviceStreamReady = true; $this->sendToService(new ActionListRequest()); }
[ "public", "function", "start", "(", ")", "{", "$", "this", "->", "workerHandlerReady", "=", "true", ";", "$", "this", "->", "serviceStreamReady", "=", "true", ";", "$", "this", "->", "sendToService", "(", "new", "ActionListRequest", "(", ")", ")", ";", "...
Initializes the worker.
[ "Initializes", "the", "worker", "." ]
cf162854500554c4ba8d39f2675de35a49c30ed0
https://github.com/alphacomm/alpharpc/blob/cf162854500554c4ba8d39f2675de35a49c30ed0/src/AlphaRPC/Worker/WorkerCommunication.php#L128-L133
train
alphacomm/alpharpc
src/AlphaRPC/Worker/WorkerCommunication.php
WorkerCommunication.process
public function process() { if ($this->worker->getState() == Worker::INVALID) { throw new \RuntimeException('Invalid state to process.'); } $expiry = 5000 + $this->delay; if ($this->worker->isExpired($expiry)) { $this->getLogger()->debug('Worker is expired, n...
php
public function process() { if ($this->worker->getState() == Worker::INVALID) { throw new \RuntimeException('Invalid state to process.'); } $expiry = 5000 + $this->delay; if ($this->worker->isExpired($expiry)) { $this->getLogger()->debug('Worker is expired, n...
[ "public", "function", "process", "(", ")", "{", "if", "(", "$", "this", "->", "worker", "->", "getState", "(", ")", "==", "Worker", "::", "INVALID", ")", "{", "throw", "new", "\\", "RuntimeException", "(", "'Invalid state to process.'", ")", ";", "}", "$...
Perform one service cycle. This method checks whether there are any new requests to be handled, either from the Worker Handler or from the Service.
[ "Perform", "one", "service", "cycle", ".", "This", "method", "checks", "whether", "there", "are", "any", "new", "requests", "to", "be", "handled", "either", "from", "the", "Worker", "Handler", "or", "from", "the", "Service", "." ]
cf162854500554c4ba8d39f2675de35a49c30ed0
https://github.com/alphacomm/alpharpc/blob/cf162854500554c4ba8d39f2675de35a49c30ed0/src/AlphaRPC/Worker/WorkerCommunication.php#L140-L168
train
alphacomm/alpharpc
src/AlphaRPC/Worker/WorkerCommunication.php
WorkerCommunication.createWorkerHandlerStream
protected function createWorkerHandlerStream(Socket $socket) { $socket->setId('manager'); $this->getPoller()->add($socket, ZMQ::POLL_IN); $that = $this; $this->workerHandlerStream = $socket->getStream(); $this->workerHandlerStream->addListener(StreamInterface::MESSAGE, funct...
php
protected function createWorkerHandlerStream(Socket $socket) { $socket->setId('manager'); $this->getPoller()->add($socket, ZMQ::POLL_IN); $that = $this; $this->workerHandlerStream = $socket->getStream(); $this->workerHandlerStream->addListener(StreamInterface::MESSAGE, funct...
[ "protected", "function", "createWorkerHandlerStream", "(", "Socket", "$", "socket", ")", "{", "$", "socket", "->", "setId", "(", "'manager'", ")", ";", "$", "this", "->", "getPoller", "(", ")", "->", "add", "(", "$", "socket", ",", "ZMQ", "::", "POLL_IN"...
Creates a socket to communicate with the worker handler. @param Socket $socket @return null
[ "Creates", "a", "socket", "to", "communicate", "with", "the", "worker", "handler", "." ]
cf162854500554c4ba8d39f2675de35a49c30ed0
https://github.com/alphacomm/alpharpc/blob/cf162854500554c4ba8d39f2675de35a49c30ed0/src/AlphaRPC/Worker/WorkerCommunication.php#L177-L195
train
alphacomm/alpharpc
src/AlphaRPC/Worker/WorkerCommunication.php
WorkerCommunication.createServiceStream
protected function createServiceStream(Socket $socket) { $socket->setId('worker_service'); $this->getPoller()->add($socket, ZMQ::POLL_IN); $that = $this; $this->serviceStream = $socket->getStream(); $this->serviceStream->addListener(StreamInterface::MESSAGE, function (Messag...
php
protected function createServiceStream(Socket $socket) { $socket->setId('worker_service'); $this->getPoller()->add($socket, ZMQ::POLL_IN); $that = $this; $this->serviceStream = $socket->getStream(); $this->serviceStream->addListener(StreamInterface::MESSAGE, function (Messag...
[ "protected", "function", "createServiceStream", "(", "Socket", "$", "socket", ")", "{", "$", "socket", "->", "setId", "(", "'worker_service'", ")", ";", "$", "this", "->", "getPoller", "(", ")", "->", "add", "(", "$", "socket", ",", "ZMQ", "::", "POLL_IN...
Creates a socket to communicate with the service. @param Socket $socket @return null
[ "Creates", "a", "socket", "to", "communicate", "with", "the", "service", "." ]
cf162854500554c4ba8d39f2675de35a49c30ed0
https://github.com/alphacomm/alpharpc/blob/cf162854500554c4ba8d39f2675de35a49c30ed0/src/AlphaRPC/Worker/WorkerCommunication.php#L204-L222
train
alphacomm/alpharpc
src/AlphaRPC/Worker/WorkerCommunication.php
WorkerCommunication.onWorkerHandlerMessage
public function onWorkerHandlerMessage(MessageInterface $msg) { $this->workerHandlerReady = true; $this->worker->touch(); if ($msg instanceof Destroy) { $this->worker->setState(Worker::INVALID); return; } if ($msg instanceof ExecuteJobRequest) { ...
php
public function onWorkerHandlerMessage(MessageInterface $msg) { $this->workerHandlerReady = true; $this->worker->touch(); if ($msg instanceof Destroy) { $this->worker->setState(Worker::INVALID); return; } if ($msg instanceof ExecuteJobRequest) { ...
[ "public", "function", "onWorkerHandlerMessage", "(", "MessageInterface", "$", "msg", ")", "{", "$", "this", "->", "workerHandlerReady", "=", "true", ";", "$", "this", "->", "worker", "->", "touch", "(", ")", ";", "if", "(", "$", "msg", "instanceof", "Destr...
Handles a Message from the Worker Handler. @param MessageInterface $msg
[ "Handles", "a", "Message", "from", "the", "Worker", "Handler", "." ]
cf162854500554c4ba8d39f2675de35a49c30ed0
https://github.com/alphacomm/alpharpc/blob/cf162854500554c4ba8d39f2675de35a49c30ed0/src/AlphaRPC/Worker/WorkerCommunication.php#L243-L267
train
alphacomm/alpharpc
src/AlphaRPC/Worker/WorkerCommunication.php
WorkerCommunication.handleHeartbeatResponse
private function handleHeartbeatResponse() { $state = $this->worker->getState(); if (Worker::BUSY == $state) { /** * We should only reply in the following cases: * - A heartbeat is about to expire. * - We have a result. */ r...
php
private function handleHeartbeatResponse() { $state = $this->worker->getState(); if (Worker::BUSY == $state) { /** * We should only reply in the following cases: * - A heartbeat is about to expire. * - We have a result. */ r...
[ "private", "function", "handleHeartbeatResponse", "(", ")", "{", "$", "state", "=", "$", "this", "->", "worker", "->", "getState", "(", ")", ";", "if", "(", "Worker", "::", "BUSY", "==", "$", "state", ")", "{", "/**\n * We should only reply in the ...
Handles the heartbeat response from the worker handler.
[ "Handles", "the", "heartbeat", "response", "from", "the", "worker", "handler", "." ]
cf162854500554c4ba8d39f2675de35a49c30ed0
https://github.com/alphacomm/alpharpc/blob/cf162854500554c4ba8d39f2675de35a49c30ed0/src/AlphaRPC/Worker/WorkerCommunication.php#L272-L308
train
alphacomm/alpharpc
src/AlphaRPC/Worker/WorkerCommunication.php
WorkerCommunication.onServiceMessage
public function onServiceMessage(MessageInterface $msg) { $this->serviceStreamReady = true; $this->getLogger()->debug('Received Service Message of Type: '.get_class($msg)); if ($msg instanceof ActionListResponse) { $actions = $msg->getActions(); $this->getLogger()->...
php
public function onServiceMessage(MessageInterface $msg) { $this->serviceStreamReady = true; $this->getLogger()->debug('Received Service Message of Type: '.get_class($msg)); if ($msg instanceof ActionListResponse) { $actions = $msg->getActions(); $this->getLogger()->...
[ "public", "function", "onServiceMessage", "(", "MessageInterface", "$", "msg", ")", "{", "$", "this", "->", "serviceStreamReady", "=", "true", ";", "$", "this", "->", "getLogger", "(", ")", "->", "debug", "(", "'Received Service Message of Type: '", ".", "get_cl...
Handles a Message from the Service Handler. @param MessageInterface $msg
[ "Handles", "a", "Message", "from", "the", "Service", "Handler", "." ]
cf162854500554c4ba8d39f2675de35a49c30ed0
https://github.com/alphacomm/alpharpc/blob/cf162854500554c4ba8d39f2675de35a49c30ed0/src/AlphaRPC/Worker/WorkerCommunication.php#L315-L344
train
alphacomm/alpharpc
src/AlphaRPC/Worker/WorkerCommunication.php
WorkerCommunication.startJob
public function startJob(ExecuteJobRequest $request) { $this->worker->setState(Worker::BUSY); $requestId = $request->getRequestId(); $action = $request->getAction(); if (!$this->worker->hasAction($action)) { $this->getLogger()->debug('Action '.$action.' not found.'); ...
php
public function startJob(ExecuteJobRequest $request) { $this->worker->setState(Worker::BUSY); $requestId = $request->getRequestId(); $action = $request->getAction(); if (!$this->worker->hasAction($action)) { $this->getLogger()->debug('Action '.$action.' not found.'); ...
[ "public", "function", "startJob", "(", "ExecuteJobRequest", "$", "request", ")", "{", "$", "this", "->", "worker", "->", "setState", "(", "Worker", "::", "BUSY", ")", ";", "$", "requestId", "=", "$", "request", "->", "getRequestId", "(", ")", ";", "$", ...
Starts a Job. @param ExecuteJobRequest $request
[ "Starts", "a", "Job", "." ]
cf162854500554c4ba8d39f2675de35a49c30ed0
https://github.com/alphacomm/alpharpc/blob/cf162854500554c4ba8d39f2675de35a49c30ed0/src/AlphaRPC/Worker/WorkerCommunication.php#L351-L366
train
alphacomm/alpharpc
src/AlphaRPC/Worker/WorkerCommunication.php
WorkerCommunication.heartbeat
public function heartbeat() { $state = $this->worker->getState(); if (!in_array($state, array(Worker::BUSY, Worker::READY))) { return; } // Detect manager crash. $timeout = 2500; if (!$this->worker->isExpired($timeout)) { // Worker is pretty a...
php
public function heartbeat() { $state = $this->worker->getState(); if (!in_array($state, array(Worker::BUSY, Worker::READY))) { return; } // Detect manager crash. $timeout = 2500; if (!$this->worker->isExpired($timeout)) { // Worker is pretty a...
[ "public", "function", "heartbeat", "(", ")", "{", "$", "state", "=", "$", "this", "->", "worker", "->", "getState", "(", ")", ";", "if", "(", "!", "in_array", "(", "$", "state", ",", "array", "(", "Worker", "::", "BUSY", ",", "Worker", "::", "READY...
Performs a heartbeat with the Worker Handler.
[ "Performs", "a", "heartbeat", "with", "the", "Worker", "Handler", "." ]
cf162854500554c4ba8d39f2675de35a49c30ed0
https://github.com/alphacomm/alpharpc/blob/cf162854500554c4ba8d39f2675de35a49c30ed0/src/AlphaRPC/Worker/WorkerCommunication.php#L371-L399
train
alphacomm/alpharpc
src/AlphaRPC/Worker/WorkerCommunication.php
WorkerCommunication.handleResult
public function handleResult() { // No result $result = $this->worker->getResult(); if ($result === null) { return; } // Invalid worker state, wait for a response first. if (!$this->isWorkerHandlerReady()) { return; } $this->s...
php
public function handleResult() { // No result $result = $this->worker->getResult(); if ($result === null) { return; } // Invalid worker state, wait for a response first. if (!$this->isWorkerHandlerReady()) { return; } $this->s...
[ "public", "function", "handleResult", "(", ")", "{", "// No result", "$", "result", "=", "$", "this", "->", "worker", "->", "getResult", "(", ")", ";", "if", "(", "$", "result", "===", "null", ")", "{", "return", ";", "}", "// Invalid worker state, wait fo...
Sends when the Service is done working, this sends the result to the Worker Handler.
[ "Sends", "when", "the", "Service", "is", "done", "working", "this", "sends", "the", "result", "to", "the", "Worker", "Handler", "." ]
cf162854500554c4ba8d39f2675de35a49c30ed0
https://github.com/alphacomm/alpharpc/blob/cf162854500554c4ba8d39f2675de35a49c30ed0/src/AlphaRPC/Worker/WorkerCommunication.php#L404-L419
train
alphacomm/alpharpc
src/AlphaRPC/Worker/WorkerCommunication.php
WorkerCommunication.sendToWorkerHandler
public function sendToWorkerHandler(MessageInterface $msg) { if (!$this->isWorkerHandlerReady()) { $this->getLogger()->debug('WorkerHandler socket not ready to send.'); return; } $this->workerHandlerReady = false; $this->workerHandlerStream->send($msg); ...
php
public function sendToWorkerHandler(MessageInterface $msg) { if (!$this->isWorkerHandlerReady()) { $this->getLogger()->debug('WorkerHandler socket not ready to send.'); return; } $this->workerHandlerReady = false; $this->workerHandlerStream->send($msg); ...
[ "public", "function", "sendToWorkerHandler", "(", "MessageInterface", "$", "msg", ")", "{", "if", "(", "!", "$", "this", "->", "isWorkerHandlerReady", "(", ")", ")", "{", "$", "this", "->", "getLogger", "(", ")", "->", "debug", "(", "'WorkerHandler socket no...
Send the given Message to the Worker Handler. @param MessageInterface $msg
[ "Send", "the", "given", "Message", "to", "the", "Worker", "Handler", "." ]
cf162854500554c4ba8d39f2675de35a49c30ed0
https://github.com/alphacomm/alpharpc/blob/cf162854500554c4ba8d39f2675de35a49c30ed0/src/AlphaRPC/Worker/WorkerCommunication.php#L426-L436
train
alphacomm/alpharpc
src/AlphaRPC/Worker/WorkerCommunication.php
WorkerCommunication.sendToService
public function sendToService(MessageInterface $msg) { if (!$this->isServiceStreamReady()) { $this->getLogger()->debug('Service socket not ready to send.'); return; } $this->getLogger()->debug('Sending to service.'); $this->serviceStreamReady = false; ...
php
public function sendToService(MessageInterface $msg) { if (!$this->isServiceStreamReady()) { $this->getLogger()->debug('Service socket not ready to send.'); return; } $this->getLogger()->debug('Sending to service.'); $this->serviceStreamReady = false; ...
[ "public", "function", "sendToService", "(", "MessageInterface", "$", "msg", ")", "{", "if", "(", "!", "$", "this", "->", "isServiceStreamReady", "(", ")", ")", "{", "$", "this", "->", "getLogger", "(", ")", "->", "debug", "(", "'Service socket not ready to s...
Send the given Message to the Service. @param MessageInterface $msg
[ "Send", "the", "given", "Message", "to", "the", "Service", "." ]
cf162854500554c4ba8d39f2675de35a49c30ed0
https://github.com/alphacomm/alpharpc/blob/cf162854500554c4ba8d39f2675de35a49c30ed0/src/AlphaRPC/Worker/WorkerCommunication.php#L443-L454
train
plumphp/plum-excel
src/ExcelWriter.php
ExcelWriter.finish
public function finish() { $writer = $this->writer; if (!$writer) { $writer = PHPExcel_IOFactory::createWriter($this->excel, $this->format); } $writer->save($this->filename); }
php
public function finish() { $writer = $this->writer; if (!$writer) { $writer = PHPExcel_IOFactory::createWriter($this->excel, $this->format); } $writer->save($this->filename); }
[ "public", "function", "finish", "(", ")", "{", "$", "writer", "=", "$", "this", "->", "writer", ";", "if", "(", "!", "$", "writer", ")", "{", "$", "writer", "=", "PHPExcel_IOFactory", "::", "createWriter", "(", "$", "this", "->", "excel", ",", "$", ...
Finish the writer.
[ "Finish", "the", "writer", "." ]
cc1dd308901b836676e077b13f01c0c87845c5f6
https://github.com/plumphp/plum-excel/blob/cc1dd308901b836676e077b13f01c0c87845c5f6/src/ExcelWriter.php#L156-L163
train
strident/Aegis
src/Aegis/Authentication/Authenticator/DelegatingAuthenticator.php
DelegatingAuthenticator.delegateAuthenticator
private function delegateAuthenticator(TokenInterface $token) { if ( ! $authenticator = $this->resolveAuthenticator($token)) { throw new \RuntimeException(sprintf( 'No authentication authenticator found for token: "%s".', get_class($token) )); ...
php
private function delegateAuthenticator(TokenInterface $token) { if ( ! $authenticator = $this->resolveAuthenticator($token)) { throw new \RuntimeException(sprintf( 'No authentication authenticator found for token: "%s".', get_class($token) )); ...
[ "private", "function", "delegateAuthenticator", "(", "TokenInterface", "$", "token", ")", "{", "if", "(", "!", "$", "authenticator", "=", "$", "this", "->", "resolveAuthenticator", "(", "$", "token", ")", ")", "{", "throw", "new", "\\", "RuntimeException", "...
Delegate a authenticator for a token. @param TokenInterface $token @return DelegatingAuthenticator
[ "Delegate", "a", "authenticator", "for", "a", "token", "." ]
954bd3d24808d77271844276ae31b41f4f039bd5
https://github.com/strident/Aegis/blob/954bd3d24808d77271844276ae31b41f4f039bd5/src/Aegis/Authentication/Authenticator/DelegatingAuthenticator.php#L123-L133
train
strident/Aegis
src/Aegis/Authentication/Authenticator/DelegatingAuthenticator.php
DelegatingAuthenticator.resolveAuthenticator
private function resolveAuthenticator(TokenInterface $token) { foreach ($this->authenticators as $authenticator) { if ($authenticator->supports($token)) { return $authenticator; } } return false; }
php
private function resolveAuthenticator(TokenInterface $token) { foreach ($this->authenticators as $authenticator) { if ($authenticator->supports($token)) { return $authenticator; } } return false; }
[ "private", "function", "resolveAuthenticator", "(", "TokenInterface", "$", "token", ")", "{", "foreach", "(", "$", "this", "->", "authenticators", "as", "$", "authenticator", ")", "{", "if", "(", "$", "authenticator", "->", "supports", "(", "$", "token", ")"...
Resolve a token to its authenticator. @param TokenInterface $token @return mixed
[ "Resolve", "a", "token", "to", "its", "authenticator", "." ]
954bd3d24808d77271844276ae31b41f4f039bd5
https://github.com/strident/Aegis/blob/954bd3d24808d77271844276ae31b41f4f039bd5/src/Aegis/Authentication/Authenticator/DelegatingAuthenticator.php#L142-L151
train
tigron/skeleton-error
lib/Skeleton/Error/Handler/Basic.php
Basic.handle
public function handle() { // If this is a reqular exception, always quit, else check the type if (!($this->exception instanceof \ErrorException)) { $this->quit = true; } else { // Only quit after specific error types switch ($this->exception->getSeverity()) { case E_ERROR: case E_CORE_ERROR: ...
php
public function handle() { // If this is a reqular exception, always quit, else check the type if (!($this->exception instanceof \ErrorException)) { $this->quit = true; } else { // Only quit after specific error types switch ($this->exception->getSeverity()) { case E_ERROR: case E_CORE_ERROR: ...
[ "public", "function", "handle", "(", ")", "{", "// If this is a reqular exception, always quit, else check the type", "if", "(", "!", "(", "$", "this", "->", "exception", "instanceof", "\\", "ErrorException", ")", ")", "{", "$", "this", "->", "quit", "=", "true", ...
Handle an error with the most basic handler @return string
[ "Handle", "an", "error", "with", "the", "most", "basic", "handler" ]
c0671ad52a4386d95179f1c47bedfdf754ee3611
https://github.com/tigron/skeleton-error/blob/c0671ad52a4386d95179f1c47bedfdf754ee3611/lib/Skeleton/Error/Handler/Basic.php#L24-L39
train
tigron/skeleton-error
lib/Skeleton/Error/Handler/Basic.php
Basic.get_subject
public static function get_subject($exception) { $application = null; try { $application = \Skeleton\Core\Application::get(); } catch (\Exception $e) {} if ($application === null) { $hostname = 'unknown'; $name = 'unknown'; } else { $hostname = $application->hostname; $name = $application->na...
php
public static function get_subject($exception) { $application = null; try { $application = \Skeleton\Core\Application::get(); } catch (\Exception $e) {} if ($application === null) { $hostname = 'unknown'; $name = 'unknown'; } else { $hostname = $application->hostname; $name = $application->na...
[ "public", "static", "function", "get_subject", "(", "$", "exception", ")", "{", "$", "application", "=", "null", ";", "try", "{", "$", "application", "=", "\\", "Skeleton", "\\", "Core", "\\", "Application", "::", "get", "(", ")", ";", "}", "catch", "(...
Produce a subject based on the error @param $exception (can be \Throwable or \Exception) @return string
[ "Produce", "a", "subject", "based", "on", "the", "error" ]
c0671ad52a4386d95179f1c47bedfdf754ee3611
https://github.com/tigron/skeleton-error/blob/c0671ad52a4386d95179f1c47bedfdf754ee3611/lib/Skeleton/Error/Handler/Basic.php#L61-L83
train
tigron/skeleton-error
lib/Skeleton/Error/Handler/Basic.php
Basic.get_html
public static function get_html($exception) { $subject = self::get_subject($exception); if ($exception instanceof \ErrorException) { $error_type = \Skeleton\Error\Util\Misc::translate_error_code($exception->getSeverity()); } else { $error_type = 'Exception'; } $error_info = ''; $error_info .= 'Error...
php
public static function get_html($exception) { $subject = self::get_subject($exception); if ($exception instanceof \ErrorException) { $error_type = \Skeleton\Error\Util\Misc::translate_error_code($exception->getSeverity()); } else { $error_type = 'Exception'; } $error_info = ''; $error_info .= 'Error...
[ "public", "static", "function", "get_html", "(", "$", "exception", ")", "{", "$", "subject", "=", "self", "::", "get_subject", "(", "$", "exception", ")", ";", "if", "(", "$", "exception", "instanceof", "\\", "ErrorException", ")", "{", "$", "error_type", ...
Produce some HTML around the error @param $exception (can be \Throwable or \Exception) @return string
[ "Produce", "some", "HTML", "around", "the", "error" ]
c0671ad52a4386d95179f1c47bedfdf754ee3611
https://github.com/tigron/skeleton-error/blob/c0671ad52a4386d95179f1c47bedfdf754ee3611/lib/Skeleton/Error/Handler/Basic.php#L91-L150
train
harp-orm/harp
src/Repo.php
Repo.loadRelFor
public function loadRelFor(Models $models, $relName, $flags = null) { $rel = $this->getRelOrError($relName); $foreign = $rel->loadModelsIfAvailable($models, $flags); $rel->linkModels($models, $foreign, function (AbstractLink $link) { $class = get_class($link->getModel()); ...
php
public function loadRelFor(Models $models, $relName, $flags = null) { $rel = $this->getRelOrError($relName); $foreign = $rel->loadModelsIfAvailable($models, $flags); $rel->linkModels($models, $foreign, function (AbstractLink $link) { $class = get_class($link->getModel()); ...
[ "public", "function", "loadRelFor", "(", "Models", "$", "models", ",", "$", "relName", ",", "$", "flags", "=", "null", ")", "{", "$", "rel", "=", "$", "this", "->", "getRelOrError", "(", "$", "relName", ")", ";", "$", "foreign", "=", "$", "rel", "-...
Load models for a given relation. @param Models $models @param string $relName @return Models @throws InvalidArgumentException If $relName does not belong to repo
[ "Load", "models", "for", "a", "given", "relation", "." ]
e0751696521164c86ccd0a76d708df490efd8306
https://github.com/harp-orm/harp/blob/e0751696521164c86ccd0a76d708df490efd8306/src/Repo.php#L137-L149
train
harp-orm/harp
src/Repo.php
Repo.loadAllRelsFor
public function loadAllRelsFor(Models $models, array $rels, $flags = null) { $rels = Arr::toAssoc($rels); foreach ($rels as $relName => $childRels) { $foreign = $this->loadRelFor($models, $relName, $flags); if ($childRels) { $rel = $this->getRel($relName); ...
php
public function loadAllRelsFor(Models $models, array $rels, $flags = null) { $rels = Arr::toAssoc($rels); foreach ($rels as $relName => $childRels) { $foreign = $this->loadRelFor($models, $relName, $flags); if ($childRels) { $rel = $this->getRel($relName); ...
[ "public", "function", "loadAllRelsFor", "(", "Models", "$", "models", ",", "array", "$", "rels", ",", "$", "flags", "=", "null", ")", "{", "$", "rels", "=", "Arr", "::", "toAssoc", "(", "$", "rels", ")", ";", "foreach", "(", "$", "rels", "as", "$",...
Load all the models for the provided relations. This is the meat of the eager loading @param Models $models @param array $rels @param int $flags @return Repo $this
[ "Load", "all", "the", "models", "for", "the", "provided", "relations", ".", "This", "is", "the", "meat", "of", "the", "eager", "loading" ]
e0751696521164c86ccd0a76d708df490efd8306
https://github.com/harp-orm/harp/blob/e0751696521164c86ccd0a76d708df490efd8306/src/Repo.php#L159-L173
train
harp-orm/harp
src/Repo.php
Repo.updateModels
public function updateModels(Models $models) { foreach ($models as $model) { if ($model->isSoftDeleted()) { $this->dispatchBeforeEvent($model, Event::DELETE); } else { $this->dispatchBeforeEvent($model, Event::UPDATE); $this->dispatchBe...
php
public function updateModels(Models $models) { foreach ($models as $model) { if ($model->isSoftDeleted()) { $this->dispatchBeforeEvent($model, Event::DELETE); } else { $this->dispatchBeforeEvent($model, Event::UPDATE); $this->dispatchBe...
[ "public", "function", "updateModels", "(", "Models", "$", "models", ")", "{", "foreach", "(", "$", "models", "as", "$", "model", ")", "{", "if", "(", "$", "model", "->", "isSoftDeleted", "(", ")", ")", "{", "$", "this", "->", "dispatchBeforeEvent", "("...
Call all the events associated with model updates. Perform the update itself. @param Models $models @return Repo $this
[ "Call", "all", "the", "events", "associated", "with", "model", "updates", ".", "Perform", "the", "update", "itself", "." ]
e0751696521164c86ccd0a76d708df490efd8306
https://github.com/harp-orm/harp/blob/e0751696521164c86ccd0a76d708df490efd8306/src/Repo.php#L181-L207
train
harp-orm/harp
src/Repo.php
Repo.deleteModels
public function deleteModels(Models $models) { foreach ($models as $model) { $this->dispatchBeforeEvent($model, Event::DELETE); } $this->deleteAll()->executeModels($models); foreach ($models as $model) { $this->dispatchAfterEvent($model, Event::DELETE); ...
php
public function deleteModels(Models $models) { foreach ($models as $model) { $this->dispatchBeforeEvent($model, Event::DELETE); } $this->deleteAll()->executeModels($models); foreach ($models as $model) { $this->dispatchAfterEvent($model, Event::DELETE); ...
[ "public", "function", "deleteModels", "(", "Models", "$", "models", ")", "{", "foreach", "(", "$", "models", "as", "$", "model", ")", "{", "$", "this", "->", "dispatchBeforeEvent", "(", "$", "model", ",", "Event", "::", "DELETE", ")", ";", "}", "$", ...
Call all the events associated with model deletion. Perform the deletion itself. @param Models $models @return Repo $this
[ "Call", "all", "the", "events", "associated", "with", "model", "deletion", ".", "Perform", "the", "deletion", "itself", "." ]
e0751696521164c86ccd0a76d708df490efd8306
https://github.com/harp-orm/harp/blob/e0751696521164c86ccd0a76d708df490efd8306/src/Repo.php#L215-L228
train
harp-orm/harp
src/Repo.php
Repo.insertModels
public function insertModels(Models $models) { foreach ($models as $model) { $this->dispatchBeforeEvent($model, Event::INSERT); $this->dispatchBeforeEvent($model, Event::SAVE); } $this->insertAll()->executeModels($models); foreach ($models as $model) { ...
php
public function insertModels(Models $models) { foreach ($models as $model) { $this->dispatchBeforeEvent($model, Event::INSERT); $this->dispatchBeforeEvent($model, Event::SAVE); } $this->insertAll()->executeModels($models); foreach ($models as $model) { ...
[ "public", "function", "insertModels", "(", "Models", "$", "models", ")", "{", "foreach", "(", "$", "models", "as", "$", "model", ")", "{", "$", "this", "->", "dispatchBeforeEvent", "(", "$", "model", ",", "Event", "::", "INSERT", ")", ";", "$", "this",...
Call all the events associated with model insertion. Perform the insertion itself. @param Models $models @return Repo $this
[ "Call", "all", "the", "events", "associated", "with", "model", "insertion", ".", "Perform", "the", "insertion", "itself", "." ]
e0751696521164c86ccd0a76d708df490efd8306
https://github.com/harp-orm/harp/blob/e0751696521164c86ccd0a76d708df490efd8306/src/Repo.php#L236-L255
train
Phpillip/phpillip
src/Console/Command/WatchCommand.php
WatchCommand.build
protected function build(OutputInterface $output) { $this->command->run($this->input, $output); $this->lastBuild = new DateTime(); }
php
protected function build(OutputInterface $output) { $this->command->run($this->input, $output); $this->lastBuild = new DateTime(); }
[ "protected", "function", "build", "(", "OutputInterface", "$", "output", ")", "{", "$", "this", "->", "command", "->", "run", "(", "$", "this", "->", "input", ",", "$", "output", ")", ";", "$", "this", "->", "lastBuild", "=", "new", "DateTime", "(", ...
Run the build command @param OutputInterface $output
[ "Run", "the", "build", "command" ]
c37afaafb536361e7e0b564659f1cd5b80b98be9
https://github.com/Phpillip/phpillip/blob/c37afaafb536361e7e0b564659f1cd5b80b98be9/src/Console/Command/WatchCommand.php#L88-L93
train
prooph/processing
library/Processor/Process.php
Process.setUp
public static function setUp(NodeName $nodeName, array $tasks, array $config = array()) { /** @var $instance Process */ $instance = new static(); $instance->assertConfig($config); $processId = ProcessId::generate(); $taskList = TaskList::scheduleTasks(TaskListId::linkWith(...
php
public static function setUp(NodeName $nodeName, array $tasks, array $config = array()) { /** @var $instance Process */ $instance = new static(); $instance->assertConfig($config); $processId = ProcessId::generate(); $taskList = TaskList::scheduleTasks(TaskListId::linkWith(...
[ "public", "static", "function", "setUp", "(", "NodeName", "$", "nodeName", ",", "array", "$", "tasks", ",", "array", "$", "config", "=", "array", "(", ")", ")", "{", "/** @var $instance Process */", "$", "instance", "=", "new", "static", "(", ")", ";", "...
Creates new process from given tasks and config @param NodeName $nodeName @param Task[] $tasks @param array $config @return static
[ "Creates", "new", "process", "from", "given", "tasks", "and", "config" ]
a2947bccbffeecc4ca93a15e38ab53814e3e53e5
https://github.com/prooph/processing/blob/a2947bccbffeecc4ca93a15e38ab53814e3e53e5/library/Processor/Process.php#L102-L116
train
prooph/processing
library/Processor/Process.php
Process.receiveMessage
public function receiveMessage($message, WorkflowEngine $workflowEngine) { if ($message instanceof WorkflowMessage) { if (MessageNameUtils::isProcessingCommand($message->messageName())) { $this->perform($workflowEngine, $message); return; } ...
php
public function receiveMessage($message, WorkflowEngine $workflowEngine) { if ($message instanceof WorkflowMessage) { if (MessageNameUtils::isProcessingCommand($message->messageName())) { $this->perform($workflowEngine, $message); return; } ...
[ "public", "function", "receiveMessage", "(", "$", "message", ",", "WorkflowEngine", "$", "workflowEngine", ")", "{", "if", "(", "$", "message", "instanceof", "WorkflowMessage", ")", "{", "if", "(", "MessageNameUtils", "::", "isProcessingCommand", "(", "$", "mess...
A Process can start or continue with the next step after it has received a message @param WorkflowMessage|LogMessage $message @param WorkflowEngine $workflowEngine @throws \RuntimeException @return void
[ "A", "Process", "can", "start", "or", "continue", "with", "the", "next", "step", "after", "it", "has", "received", "a", "message" ]
a2947bccbffeecc4ca93a15e38ab53814e3e53e5
https://github.com/prooph/processing/blob/a2947bccbffeecc4ca93a15e38ab53814e3e53e5/library/Processor/Process.php#L168-L197
train
oliwierptak/Everon1
src/Everon/Helper/Asserts/IsEmpty.php
IsEmpty.assertIsEmpty
public function assertIsEmpty($value, $message='%s must not be empty', $exception='Asserts') { if (isset($value) === false || empty($value)) { $this->throwException($exception, $message, $value); } }
php
public function assertIsEmpty($value, $message='%s must not be empty', $exception='Asserts') { if (isset($value) === false || empty($value)) { $this->throwException($exception, $message, $value); } }
[ "public", "function", "assertIsEmpty", "(", "$", "value", ",", "$", "message", "=", "'%s must not be empty'", ",", "$", "exception", "=", "'Asserts'", ")", "{", "if", "(", "isset", "(", "$", "value", ")", "===", "false", "||", "empty", "(", "$", "value",...
Verifies that the specified condition is not empty. The assertion fails if the condition is empty. @param mixed $value @param string $message @param string $exception @throws \Everon\Exception\Asserts
[ "Verifies", "that", "the", "specified", "condition", "is", "not", "empty", ".", "The", "assertion", "fails", "if", "the", "condition", "is", "empty", "." ]
ac93793d1fa517a8394db5f00062f1925dc218a3
https://github.com/oliwierptak/Everon1/blob/ac93793d1fa517a8394db5f00062f1925dc218a3/src/Everon/Helper/Asserts/IsEmpty.php#L23-L28
train
haldayne/fox
src/Expression.php
Expression.makeCallable
private static function makeCallable($expression) { if (! array_key_exists($expression, static::$map)) { $return = "return ($expression);"; try { $lambda = create_function(static::$signature, $return); } catch (\ParseError $ex) { $lambda = ...
php
private static function makeCallable($expression) { if (! array_key_exists($expression, static::$map)) { $return = "return ($expression);"; try { $lambda = create_function(static::$signature, $return); } catch (\ParseError $ex) { $lambda = ...
[ "private", "static", "function", "makeCallable", "(", "$", "expression", ")", "{", "if", "(", "!", "array_key_exists", "(", "$", "expression", ",", "static", "::", "$", "map", ")", ")", "{", "$", "return", "=", "\"return ($expression);\"", ";", "try", "{",...
Given a string expression, turn that into an anonymous function. Cache the result, so as to keep memory impacts low. @throw \LogicException
[ "Given", "a", "string", "expression", "turn", "that", "into", "an", "anonymous", "function", ".", "Cache", "the", "result", "so", "as", "to", "keep", "memory", "impacts", "low", "." ]
f5dcc3798cca0fdbfc6f448c5cb5a174eaab60eb
https://github.com/haldayne/fox/blob/f5dcc3798cca0fdbfc6f448c5cb5a174eaab60eb/src/Expression.php#L124-L145
train
stonedz/pff2
src/modules/cookies/Cookies.php
Cookies.setCookie
public function setCookie($cookieName, $value = null, $expire = null) { if ($expire !== null) { $expire = time() + (60 * 60 * $expire); } if (setcookie($cookieName, $this->encodeCookie($value), $expire, "/")) { return true; } else { return false; ...
php
public function setCookie($cookieName, $value = null, $expire = null) { if ($expire !== null) { $expire = time() + (60 * 60 * $expire); } if (setcookie($cookieName, $this->encodeCookie($value), $expire, "/")) { return true; } else { return false; ...
[ "public", "function", "setCookie", "(", "$", "cookieName", ",", "$", "value", "=", "null", ",", "$", "expire", "=", "null", ")", "{", "if", "(", "$", "expire", "!==", "null", ")", "{", "$", "expire", "=", "time", "(", ")", "+", "(", "60", "*", ...
Sets a cookie in the user's browser @param string $cookieName @param string|null $value The value to store in the cookie @param int|null $expire how many HOURS the cookie will be valid (set to 0 for session time) @return bool
[ "Sets", "a", "cookie", "in", "the", "user", "s", "browser" ]
ec3b087d4d4732816f61ac487f0cb25511e0da88
https://github.com/stonedz/pff2/blob/ec3b087d4d4732816f61ac487f0cb25511e0da88/src/modules/cookies/Cookies.php#L41-L51
train
stonedz/pff2
src/modules/cookies/Cookies.php
Cookies.getCookie
public function getCookie($cookieName) { if (isset($_COOKIE[$cookieName])) { return $this->decodeCookie($_COOKIE[$cookieName]); } else { return false; } }
php
public function getCookie($cookieName) { if (isset($_COOKIE[$cookieName])) { return $this->decodeCookie($_COOKIE[$cookieName]); } else { return false; } }
[ "public", "function", "getCookie", "(", "$", "cookieName", ")", "{", "if", "(", "isset", "(", "$", "_COOKIE", "[", "$", "cookieName", "]", ")", ")", "{", "return", "$", "this", "->", "decodeCookie", "(", "$", "_COOKIE", "[", "$", "cookieName", "]", "...
Check if a cookie is set and returns its content @param string $cookieName @return bool @retrurn string
[ "Check", "if", "a", "cookie", "is", "set", "and", "returns", "its", "content" ]
ec3b087d4d4732816f61ac487f0cb25511e0da88
https://github.com/stonedz/pff2/blob/ec3b087d4d4732816f61ac487f0cb25511e0da88/src/modules/cookies/Cookies.php#L76-L82
train
mpaleo/view-tags
src/ViewTags/TagsContainer.php
TagsContainer.taggedWith
public function taggedWith($tag) { $results = []; if (isset($this->tags[$tag])) { foreach ($this->tags[$tag] as $view) { $results[] = $view; } } return $results; }
php
public function taggedWith($tag) { $results = []; if (isset($this->tags[$tag])) { foreach ($this->tags[$tag] as $view) { $results[] = $view; } } return $results; }
[ "public", "function", "taggedWith", "(", "$", "tag", ")", "{", "$", "results", "=", "[", "]", ";", "if", "(", "isset", "(", "$", "this", "->", "tags", "[", "$", "tag", "]", ")", ")", "{", "foreach", "(", "$", "this", "->", "tags", "[", "$", "...
Return all the views for a given tag. @param $tag @return array
[ "Return", "all", "the", "views", "for", "a", "given", "tag", "." ]
7ca3308b616738e744a0435f581bbd705e59cad6
https://github.com/mpaleo/view-tags/blob/7ca3308b616738e744a0435f581bbd705e59cad6/src/ViewTags/TagsContainer.php#L41-L55
train
newup/core
src/Templates/Renderers/TemplateRenderer.php
TemplateRenderer.registerFilters
private function registerFilters() { $filters = config('app.render_filters', []); foreach ($filters as $filter) { $filter = app($filter); if ($filter instanceof FilterContract) { $this->twigEnvironment->addFilter(new \Twig_SimpleFilter($filter->getName(), $f...
php
private function registerFilters() { $filters = config('app.render_filters', []); foreach ($filters as $filter) { $filter = app($filter); if ($filter instanceof FilterContract) { $this->twigEnvironment->addFilter(new \Twig_SimpleFilter($filter->getName(), $f...
[ "private", "function", "registerFilters", "(", ")", "{", "$", "filters", "=", "config", "(", "'app.render_filters'", ",", "[", "]", ")", ";", "foreach", "(", "$", "filters", "as", "$", "filter", ")", "{", "$", "filter", "=", "app", "(", "$", "filter", ...
Registers the template filters.
[ "Registers", "the", "template", "filters", "." ]
54128903e7775e67d63284d958b46862c8df71f9
https://github.com/newup/core/blob/54128903e7775e67d63284d958b46862c8df71f9/src/Templates/Renderers/TemplateRenderer.php#L112-L125
train
newup/core
src/Templates/Renderers/TemplateRenderer.php
TemplateRenderer.addPath
public function addPath($path) { try { $this->twigFileLoader->addPath($path); } catch (\Twig_Error_Loader $e) { throw new InvalidPathException($e->getMessage()); } }
php
public function addPath($path) { try { $this->twigFileLoader->addPath($path); } catch (\Twig_Error_Loader $e) { throw new InvalidPathException($e->getMessage()); } }
[ "public", "function", "addPath", "(", "$", "path", ")", "{", "try", "{", "$", "this", "->", "twigFileLoader", "->", "addPath", "(", "$", "path", ")", ";", "}", "catch", "(", "\\", "Twig_Error_Loader", "$", "e", ")", "{", "throw", "new", "InvalidPathExc...
Adds a path to the template environment. @param $path @throws InvalidPathException
[ "Adds", "a", "path", "to", "the", "template", "environment", "." ]
54128903e7775e67d63284d958b46862c8df71f9
https://github.com/newup/core/blob/54128903e7775e67d63284d958b46862c8df71f9/src/Templates/Renderers/TemplateRenderer.php#L148-L155
train
newup/core
src/Templates/Renderers/TemplateRenderer.php
TemplateRenderer.getData
public function getData() { $systemInformation = []; $systemInformation['newup_version'] = Application::VERSION; return $this->dataArray + $systemInformation + $this->collectData(); }
php
public function getData() { $systemInformation = []; $systemInformation['newup_version'] = Application::VERSION; return $this->dataArray + $systemInformation + $this->collectData(); }
[ "public", "function", "getData", "(", ")", "{", "$", "systemInformation", "=", "[", "]", ";", "$", "systemInformation", "[", "'newup_version'", "]", "=", "Application", "::", "VERSION", ";", "return", "$", "this", "->", "dataArray", "+", "$", "systemInformat...
Gets the environment data. @return array
[ "Gets", "the", "environment", "data", "." ]
54128903e7775e67d63284d958b46862c8df71f9
https://github.com/newup/core/blob/54128903e7775e67d63284d958b46862c8df71f9/src/Templates/Renderers/TemplateRenderer.php#L203-L209
train
newup/core
src/Templates/Renderers/TemplateRenderer.php
TemplateRenderer.render
public function render($templateName) { try { return $this->twigEnvironment->render($templateName, $this->getData()); } catch (SecurityException $e) { throw new SecurityException($e->getMessage(), $e->getCode(), $e); } catch (\Twig_Error_Runtime $e) { thro...
php
public function render($templateName) { try { return $this->twigEnvironment->render($templateName, $this->getData()); } catch (SecurityException $e) { throw new SecurityException($e->getMessage(), $e->getCode(), $e); } catch (\Twig_Error_Runtime $e) { thro...
[ "public", "function", "render", "(", "$", "templateName", ")", "{", "try", "{", "return", "$", "this", "->", "twigEnvironment", "->", "render", "(", "$", "templateName", ",", "$", "this", "->", "getData", "(", ")", ")", ";", "}", "catch", "(", "Securit...
Renders a template by name. @param $templateName @return string @throws InvalidTemplateException @throws InvalidSyntaxException @throws RuntimeException @throws SecurityException
[ "Renders", "a", "template", "by", "name", "." ]
54128903e7775e67d63284d958b46862c8df71f9
https://github.com/newup/core/blob/54128903e7775e67d63284d958b46862c8df71f9/src/Templates/Renderers/TemplateRenderer.php#L232-L251
train
newup/core
src/Templates/Renderers/TemplateRenderer.php
TemplateRenderer.renderString
public function renderString($templateString) { try { return $this->twigStringEnvironment->render($templateString, $this->getData()); } catch (SecurityException $e) { throw new SecurityException($e->getMessage(), $e->getCode(), $e); } catch (\Twig_Error_Runtime $e) { ...
php
public function renderString($templateString) { try { return $this->twigStringEnvironment->render($templateString, $this->getData()); } catch (SecurityException $e) { throw new SecurityException($e->getMessage(), $e->getCode(), $e); } catch (\Twig_Error_Runtime $e) { ...
[ "public", "function", "renderString", "(", "$", "templateString", ")", "{", "try", "{", "return", "$", "this", "->", "twigStringEnvironment", "->", "render", "(", "$", "templateString", ",", "$", "this", "->", "getData", "(", ")", ")", ";", "}", "catch", ...
Renders a string as a template. @param $templateString @return string @throws InvalidTemplateException @throws InvalidSyntaxException @throws RuntimeException @throws SecurityException
[ "Renders", "a", "string", "as", "a", "template", "." ]
54128903e7775e67d63284d958b46862c8df71f9
https://github.com/newup/core/blob/54128903e7775e67d63284d958b46862c8df71f9/src/Templates/Renderers/TemplateRenderer.php#L263-L282
train
newup/core
src/Templates/Renderers/TemplateRenderer.php
TemplateRenderer.collectData
public function collectData() { $collectedData = []; foreach ($this->dataCollectors as $collector) { $collectedData = $collectedData + $collector->collect(); } return $collectedData; }
php
public function collectData() { $collectedData = []; foreach ($this->dataCollectors as $collector) { $collectedData = $collectedData + $collector->collect(); } return $collectedData; }
[ "public", "function", "collectData", "(", ")", "{", "$", "collectedData", "=", "[", "]", ";", "foreach", "(", "$", "this", "->", "dataCollectors", "as", "$", "collector", ")", "{", "$", "collectedData", "=", "$", "collectedData", "+", "$", "collector", "...
Collects all data from data collectors. @return array
[ "Collects", "all", "data", "from", "data", "collectors", "." ]
54128903e7775e67d63284d958b46862c8df71f9
https://github.com/newup/core/blob/54128903e7775e67d63284d958b46862c8df71f9/src/Templates/Renderers/TemplateRenderer.php#L309-L318
train
tarsana/syntax
src/NumberSyntax.php
NumberSyntax.instance
public static function instance() : NumberSyntax { if (self::$instance === null) self::$instance = new NumberSyntax; return self::$instance; }
php
public static function instance() : NumberSyntax { if (self::$instance === null) self::$instance = new NumberSyntax; return self::$instance; }
[ "public", "static", "function", "instance", "(", ")", ":", "NumberSyntax", "{", "if", "(", "self", "::", "$", "instance", "===", "null", ")", "self", "::", "$", "instance", "=", "new", "NumberSyntax", ";", "return", "self", "::", "$", "instance", ";", ...
Returns the NumberSyntax instance. @return Tarsana\Syntax\NumberSyntax
[ "Returns", "the", "NumberSyntax", "instance", "." ]
fd3f8a25e3be0e391c8fd486ccfcffe913ade534
https://github.com/tarsana/syntax/blob/fd3f8a25e3be0e391c8fd486ccfcffe913ade534/src/NumberSyntax.php#L20-L25
train
Etenil/assegai
src/assegai/modules/mail/services/ses/sdk.class.php
CFRuntime.set_hostname
public function set_hostname($hostname, $port_number = null) { if ($this->override_hostname) { $this->hostname = $hostname; if ($port_number) { $this->port_number = $port_number; $this->hostname .= ':' . (string) $this->port_number; } } return $this; }
php
public function set_hostname($hostname, $port_number = null) { if ($this->override_hostname) { $this->hostname = $hostname; if ($port_number) { $this->port_number = $port_number; $this->hostname .= ':' . (string) $this->port_number; } } return $this; }
[ "public", "function", "set_hostname", "(", "$", "hostname", ",", "$", "port_number", "=", "null", ")", "{", "if", "(", "$", "this", "->", "override_hostname", ")", "{", "$", "this", "->", "hostname", "=", "$", "hostname", ";", "if", "(", "$", "port_num...
Set the hostname to connect to. This is useful for alternate services that are API-compatible with AWS, but run from a different hostname. @param string $hostname (Required) The alternate hostname to use in place of the default one. Useful for mock or test applications living on different hostnames. @param integer $po...
[ "Set", "the", "hostname", "to", "connect", "to", ".", "This", "is", "useful", "for", "alternate", "services", "that", "are", "API", "-", "compatible", "with", "AWS", "but", "run", "from", "a", "different", "hostname", "." ]
d43cce1a88f1c332f60dd0a4374b17764852af9e
https://github.com/Etenil/assegai/blob/d43cce1a88f1c332f60dd0a4374b17764852af9e/src/assegai/modules/mail/services/ses/sdk.class.php#L478-L492
train
Etenil/assegai
src/assegai/modules/mail/services/ses/sdk.class.php
CFRuntime.set_cache_config
public function set_cache_config($location, $gzip = true) { // If we have an array, we're probably passing in Memcached servers and ports. if (is_array($location)) { $this->cache_class = 'CacheMC'; } else { // I would expect locations like `/tmp/cache`, `pdo.mysql://user:pass@hostname:port`, `pdo.sql...
php
public function set_cache_config($location, $gzip = true) { // If we have an array, we're probably passing in Memcached servers and ports. if (is_array($location)) { $this->cache_class = 'CacheMC'; } else { // I would expect locations like `/tmp/cache`, `pdo.mysql://user:pass@hostname:port`, `pdo.sql...
[ "public", "function", "set_cache_config", "(", "$", "location", ",", "$", "gzip", "=", "true", ")", "{", "// If we have an array, we're probably passing in Memcached servers and ports.", "if", "(", "is_array", "(", "$", "location", ")", ")", "{", "$", "this", "->", ...
Set the caching configuration to use for response caching. @param string $location (Required) <p>The location to store the cache object in. This may vary by cache method.</p><ul><li>File - The local file system paths such as <code>./cache</code> (relative) or <code>/tmp/cache/</code> (absolute). The location must be s...
[ "Set", "the", "caching", "configuration", "to", "use", "for", "response", "caching", "." ]
d43cce1a88f1c332f60dd0a4374b17764852af9e
https://github.com/Etenil/assegai/blob/d43cce1a88f1c332f60dd0a4374b17764852af9e/src/assegai/modules/mail/services/ses/sdk.class.php#L562-L599
train
Etenil/assegai
src/assegai/modules/mail/services/ses/sdk.class.php
CFRuntime.batch
public function batch(CFBatchRequest &$queue = null) { if ($queue) { $this->batch_object = $queue; } elseif ($this->internal_batch_object) { $this->batch_object = &$this->internal_batch_object; } else { $this->internal_batch_object = new $this->batch_class(); $this->batch_object = &$this->i...
php
public function batch(CFBatchRequest &$queue = null) { if ($queue) { $this->batch_object = $queue; } elseif ($this->internal_batch_object) { $this->batch_object = &$this->internal_batch_object; } else { $this->internal_batch_object = new $this->batch_class(); $this->batch_object = &$this->i...
[ "public", "function", "batch", "(", "CFBatchRequest", "&", "$", "queue", "=", "null", ")", "{", "if", "(", "$", "queue", ")", "{", "$", "this", "->", "batch_object", "=", "$", "queue", ";", "}", "elseif", "(", "$", "this", "->", "internal_batch_object"...
Specifies that the intended request should be queued for a later batch request. @param CFBatchRequest $queue (Optional) The <CFBatchRequest> instance to use for managing batch requests. If not available, it generates a new instance of <CFBatchRequest>. @return $this A reference to the current instance.
[ "Specifies", "that", "the", "intended", "request", "should", "be", "queued", "for", "a", "later", "batch", "request", "." ]
d43cce1a88f1c332f60dd0a4374b17764852af9e
https://github.com/Etenil/assegai/blob/d43cce1a88f1c332f60dd0a4374b17764852af9e/src/assegai/modules/mail/services/ses/sdk.class.php#L1083-L1102
train
Etenil/assegai
src/assegai/modules/mail/services/ses/sdk.class.php
CFRuntime.send
public function send($clear_after_send = true) { if ($this->use_batch_flow) { // When we send the request, disable batch flow. $this->use_batch_flow = false; // If we're not caching, simply send the request. if (!$this->use_cache_flow) { $response = $this->batch_object->send(); $parsed_data...
php
public function send($clear_after_send = true) { if ($this->use_batch_flow) { // When we send the request, disable batch flow. $this->use_batch_flow = false; // If we're not caching, simply send the request. if (!$this->use_cache_flow) { $response = $this->batch_object->send(); $parsed_data...
[ "public", "function", "send", "(", "$", "clear_after_send", "=", "true", ")", "{", "if", "(", "$", "this", "->", "use_batch_flow", ")", "{", "// When we send the request, disable batch flow.", "$", "this", "->", "use_batch_flow", "=", "false", ";", "// If we're no...
Executes the batch request queue by sending all queued requests. @param boolean $clear_after_send (Optional) Whether or not to clear the batch queue after sending a request. Defaults to `true`. Set this to `false` if you are caching batch responses and want to retrieve results later. @return array An array of <CFRespo...
[ "Executes", "the", "batch", "request", "queue", "by", "sending", "all", "queued", "requests", "." ]
d43cce1a88f1c332f60dd0a4374b17764852af9e
https://github.com/Etenil/assegai/blob/d43cce1a88f1c332f60dd0a4374b17764852af9e/src/assegai/modules/mail/services/ses/sdk.class.php#L1110-L1166
train
Etenil/assegai
src/assegai/modules/mail/services/ses/sdk.class.php
CFRuntime.parse_callback
public function parse_callback($response, $headers = null) { // Shorten this so we have a (mostly) single code path if (isset($response->body)) { if (is_string($response->body)) { $body = $response->body; } else { return $response; } } elseif (is_string($response)) { $body = $r...
php
public function parse_callback($response, $headers = null) { // Shorten this so we have a (mostly) single code path if (isset($response->body)) { if (is_string($response->body)) { $body = $response->body; } else { return $response; } } elseif (is_string($response)) { $body = $r...
[ "public", "function", "parse_callback", "(", "$", "response", ",", "$", "headers", "=", "null", ")", "{", "// Shorten this so we have a (mostly) single code path", "if", "(", "isset", "(", "$", "response", "->", "body", ")", ")", "{", "if", "(", "is_string", "...
Parses a response body into a PHP object if appropriate. @param CFResponse|string $response (Required) The <CFResponse> object to parse, or an XML string that would otherwise be a response body. @param string $content_type (Optional) The content-type to use when determining how to parse the content. @return CFResponse...
[ "Parses", "a", "response", "body", "into", "a", "PHP", "object", "if", "appropriate", "." ]
d43cce1a88f1c332f60dd0a4374b17764852af9e
https://github.com/Etenil/assegai/blob/d43cce1a88f1c332f60dd0a4374b17764852af9e/src/assegai/modules/mail/services/ses/sdk.class.php#L1175-L1284
train
Etenil/assegai
src/assegai/modules/mail/services/ses/sdk.class.php
CFLoader.autoloader
public static function autoloader($class) { $path = dirname(__FILE__) . DIRECTORY_SEPARATOR; // Amazon SDK classes if (strstr($class, 'Amazon')) { $path .= 'services' . DIRECTORY_SEPARATOR . str_ireplace('Amazon', '', strtolower($class)) . '.class.php'; } // Utility classes elseif (strstr($class, 'C...
php
public static function autoloader($class) { $path = dirname(__FILE__) . DIRECTORY_SEPARATOR; // Amazon SDK classes if (strstr($class, 'Amazon')) { $path .= 'services' . DIRECTORY_SEPARATOR . str_ireplace('Amazon', '', strtolower($class)) . '.class.php'; } // Utility classes elseif (strstr($class, 'C...
[ "public", "static", "function", "autoloader", "(", "$", "class", ")", "{", "$", "path", "=", "dirname", "(", "__FILE__", ")", ".", "DIRECTORY_SEPARATOR", ";", "// Amazon SDK classes", "if", "(", "strstr", "(", "$", "class", ",", "'Amazon'", ")", ")", "{", ...
Automatically load classes that aren't included. @param string $class (Required) The classname to load. @return void
[ "Automatically", "load", "classes", "that", "aren", "t", "included", "." ]
d43cce1a88f1c332f60dd0a4374b17764852af9e
https://github.com/Etenil/assegai/blob/d43cce1a88f1c332f60dd0a4374b17764852af9e/src/assegai/modules/mail/services/ses/sdk.class.php#L1391-L1440
train
IftekherSunny/Planet-Framework
src/Sun/Http/Response.php
Response.html
public function html($data) { if(is_array($data)) { echo $this->json($data); } else { echo $data; } if($this->app->config('session.enable')) { $this->session->create('previous_uri', $_SERVER['REQUEST_URI']); $this->session->c...
php
public function html($data) { if(is_array($data)) { echo $this->json($data); } else { echo $data; } if($this->app->config('session.enable')) { $this->session->create('previous_uri', $_SERVER['REQUEST_URI']); $this->session->c...
[ "public", "function", "html", "(", "$", "data", ")", "{", "if", "(", "is_array", "(", "$", "data", ")", ")", "{", "echo", "$", "this", "->", "json", "(", "$", "data", ")", ";", "}", "else", "{", "echo", "$", "data", ";", "}", "if", "(", "$", ...
To response with html @param string $data
[ "To", "response", "with", "html" ]
530e772fb97695c1c4e1af73f81675f189474d9f
https://github.com/IftekherSunny/Planet-Framework/blob/530e772fb97695c1c4e1af73f81675f189474d9f/src/Sun/Http/Response.php#L39-L51
train
IftekherSunny/Planet-Framework
src/Sun/Http/Response.php
Response.json
public function json($data, $status = 200) { $this->header('Content-Type: application/json'); $this->statusCode($status); return json_encode($data); }
php
public function json($data, $status = 200) { $this->header('Content-Type: application/json'); $this->statusCode($status); return json_encode($data); }
[ "public", "function", "json", "(", "$", "data", ",", "$", "status", "=", "200", ")", "{", "$", "this", "->", "header", "(", "'Content-Type: application/json'", ")", ";", "$", "this", "->", "statusCode", "(", "$", "status", ")", ";", "return", "json_encod...
To response with json @param string $data @param int $status @return string
[ "To", "response", "with", "json" ]
530e772fb97695c1c4e1af73f81675f189474d9f
https://github.com/IftekherSunny/Planet-Framework/blob/530e772fb97695c1c4e1af73f81675f189474d9f/src/Sun/Http/Response.php#L61-L68
train
IftekherSunny/Planet-Framework
src/Sun/Http/Response.php
Response.download
public function download($path, $removeDownloadedFile = false) { if(!file_exists($path)) { throw new Exception("File [ $path ] not found."); } $filename = pathinfo($path, PATHINFO_BASENAME ); header("Content-Description: File Transfer"); header("Content...
php
public function download($path, $removeDownloadedFile = false) { if(!file_exists($path)) { throw new Exception("File [ $path ] not found."); } $filename = pathinfo($path, PATHINFO_BASENAME ); header("Content-Description: File Transfer"); header("Content...
[ "public", "function", "download", "(", "$", "path", ",", "$", "removeDownloadedFile", "=", "false", ")", "{", "if", "(", "!", "file_exists", "(", "$", "path", ")", ")", "{", "throw", "new", "Exception", "(", "\"File [ $path ] not found.\"", ")", ";", "}", ...
Http Response to download file @param string $path @param bool $removeDownloadedFile @throws Exception
[ "Http", "Response", "to", "download", "file" ]
530e772fb97695c1c4e1af73f81675f189474d9f
https://github.com/IftekherSunny/Planet-Framework/blob/530e772fb97695c1c4e1af73f81675f189474d9f/src/Sun/Http/Response.php#L78-L95
train
acacha/forge-publish
src/Console/Commands/PublishDeploymentScript.php
PublishDeploymentScript.updateDeploymentScript
protected function updateDeploymentScript() { $this->info('Updating deployment script for site ' . $this->site . '...'); $this->url = $this->obtainAPIURLEndpoint('update_deployment_script_uri'); if (! File::exists($this->file)) { $this->error("File " . $this->file . " doesn't e...
php
protected function updateDeploymentScript() { $this->info('Updating deployment script for site ' . $this->site . '...'); $this->url = $this->obtainAPIURLEndpoint('update_deployment_script_uri'); if (! File::exists($this->file)) { $this->error("File " . $this->file . " doesn't e...
[ "protected", "function", "updateDeploymentScript", "(", ")", "{", "$", "this", "->", "info", "(", "'Updating deployment script for site '", ".", "$", "this", "->", "site", ".", "'...'", ")", ";", "$", "this", "->", "url", "=", "$", "this", "->", "obtainAPIUR...
Update deployment script.
[ "Update", "deployment", "script", "." ]
010779e3d2297c763b82dc3fbde992edffb3a6c6
https://github.com/acacha/forge-publish/blob/010779e3d2297c763b82dc3fbde992edffb3a6c6/src/Console/Commands/PublishDeploymentScript.php#L109-L130
train
acacha/forge-publish
src/Console/Commands/PublishDeploymentScript.php
PublishDeploymentScript.obtainAPIURLEndpoint
protected function obtainAPIURLEndpoint($type) { $uri = str_replace('{forgeserver}', $this->server, config('forge-publish.' . $type)); $uri = str_replace('{forgesite}', $this->site, $uri); return config('forge-publish.url') . $uri; }
php
protected function obtainAPIURLEndpoint($type) { $uri = str_replace('{forgeserver}', $this->server, config('forge-publish.' . $type)); $uri = str_replace('{forgesite}', $this->site, $uri); return config('forge-publish.url') . $uri; }
[ "protected", "function", "obtainAPIURLEndpoint", "(", "$", "type", ")", "{", "$", "uri", "=", "str_replace", "(", "'{forgeserver}'", ",", "$", "this", "->", "server", ",", "config", "(", "'forge-publish.'", ".", "$", "type", ")", ")", ";", "$", "uri", "=...
Obtain API URL endpoint. @return string
[ "Obtain", "API", "URL", "endpoint", "." ]
010779e3d2297c763b82dc3fbde992edffb3a6c6
https://github.com/acacha/forge-publish/blob/010779e3d2297c763b82dc3fbde992edffb3a6c6/src/Console/Commands/PublishDeploymentScript.php#L137-L142
train
makinacorpus/drupal-calista
src/EventDispatcher/ViewEventSubscriber.php
ViewEventSubscriber.onTwigView
public function onTwigView(ViewEvent $event) { $view = $event->getView(); if (function_exists('drupal_add_library') && $view instanceof TwigView) { drupal_add_library('calista', 'calista_page'); /* if ($event->getView()->visualSearchIsEnabled()) { ...
php
public function onTwigView(ViewEvent $event) { $view = $event->getView(); if (function_exists('drupal_add_library') && $view instanceof TwigView) { drupal_add_library('calista', 'calista_page'); /* if ($event->getView()->visualSearchIsEnabled()) { ...
[ "public", "function", "onTwigView", "(", "ViewEvent", "$", "event", ")", "{", "$", "view", "=", "$", "event", "->", "getView", "(", ")", ";", "if", "(", "function_exists", "(", "'drupal_add_library'", ")", "&&", "$", "view", "instanceof", "TwigView", ")", ...
Add JS libraries @param ViewEvent $event
[ "Add", "JS", "libraries" ]
cceb6b975fc3e80f0f83c803fc6f6a9ac5852b53
https://github.com/makinacorpus/drupal-calista/blob/cceb6b975fc3e80f0f83c803fc6f6a9ac5852b53/src/EventDispatcher/ViewEventSubscriber.php#L31-L43
train
infusephp/auth
src/Jobs/GarbageCollection.php
GarbageCollection.run
public function run() { $res1 = $this->gcPersistent(); $res2 = $this->gcUserLinks(); $res3 = $this->gcActive(); return $res1 && $res2 && $res3; }
php
public function run() { $res1 = $this->gcPersistent(); $res2 = $this->gcUserLinks(); $res3 = $this->gcActive(); return $res1 && $res2 && $res3; }
[ "public", "function", "run", "(", ")", "{", "$", "res1", "=", "$", "this", "->", "gcPersistent", "(", ")", ";", "$", "res2", "=", "$", "this", "->", "gcUserLinks", "(", ")", ";", "$", "res3", "=", "$", "this", "->", "gcActive", "(", ")", ";", "...
Runs the auth garbage collection. @return array
[ "Runs", "the", "auth", "garbage", "collection", "." ]
720280b4b2635572f331afe8d082e3e88cf54eb7
https://github.com/infusephp/auth/blob/720280b4b2635572f331afe8d082e3e88cf54eb7/src/Jobs/GarbageCollection.php#L33-L40
train
infusephp/auth
src/Jobs/GarbageCollection.php
GarbageCollection.gcPersistent
private function gcPersistent() { return (bool) $this->app['database']->getDefault() ->delete('PersistentSessions') ->where('created_at', U::unixToDb(time() - PersistentSession::$sessionLength), '<') ->execute(); }
php
private function gcPersistent() { return (bool) $this->app['database']->getDefault() ->delete('PersistentSessions') ->where('created_at', U::unixToDb(time() - PersistentSession::$sessionLength), '<') ->execute(); }
[ "private", "function", "gcPersistent", "(", ")", "{", "return", "(", "bool", ")", "$", "this", "->", "app", "[", "'database'", "]", "->", "getDefault", "(", ")", "->", "delete", "(", "'PersistentSessions'", ")", "->", "where", "(", "'created_at'", ",", "...
Clears out expired persistent sessions. @return bool
[ "Clears", "out", "expired", "persistent", "sessions", "." ]
720280b4b2635572f331afe8d082e3e88cf54eb7
https://github.com/infusephp/auth/blob/720280b4b2635572f331afe8d082e3e88cf54eb7/src/Jobs/GarbageCollection.php#L60-L66
train
infusephp/auth
src/Jobs/GarbageCollection.php
GarbageCollection.gcUserLinks
private function gcUserLinks() { return (bool) $this->app['database']->getDefault() ->delete('UserLinks') ->where('type', UserLink::FORGOT_PASSWORD) ->where('created_at', U::unixToDb(time() - UserLink::$forgotLinkTimeframe), '<') ->execute(); }
php
private function gcUserLinks() { return (bool) $this->app['database']->getDefault() ->delete('UserLinks') ->where('type', UserLink::FORGOT_PASSWORD) ->where('created_at', U::unixToDb(time() - UserLink::$forgotLinkTimeframe), '<') ->execute(); }
[ "private", "function", "gcUserLinks", "(", ")", "{", "return", "(", "bool", ")", "$", "this", "->", "app", "[", "'database'", "]", "->", "getDefault", "(", ")", "->", "delete", "(", "'UserLinks'", ")", "->", "where", "(", "'type'", ",", "UserLink", "::...
Clears out expired user links. @return bool
[ "Clears", "out", "expired", "user", "links", "." ]
720280b4b2635572f331afe8d082e3e88cf54eb7
https://github.com/infusephp/auth/blob/720280b4b2635572f331afe8d082e3e88cf54eb7/src/Jobs/GarbageCollection.php#L73-L80
train
andyburton/Sonic-Framework
src/Resource/Session.php
Session.singleton
public static function singleton ($sessionID = FALSE) { // If no instance is set if (self::$_instance === FALSE) { // Create an instance self::$_instance = new static ($sessionID); } // Return instance return self::$_instance; }
php
public static function singleton ($sessionID = FALSE) { // If no instance is set if (self::$_instance === FALSE) { // Create an instance self::$_instance = new static ($sessionID); } // Return instance return self::$_instance; }
[ "public", "static", "function", "singleton", "(", "$", "sessionID", "=", "FALSE", ")", "{", "// If no instance is set", "if", "(", "self", "::", "$", "_instance", "===", "FALSE", ")", "{", "// Create an instance", "self", "::", "$", "_instance", "=", "new", ...
Return a single object instance @param string $sessionID Session ID @return \Sonic\Resource\Session
[ "Return", "a", "single", "object", "instance" ]
a5999448a0abab4d542413002a780ede391e7374
https://github.com/andyburton/Sonic-Framework/blob/a5999448a0abab4d542413002a780ede391e7374/src/Resource/Session.php#L78-L96
train
x2ts/x2ts
src/db/SQLite.php
SQLite.query
public function query(string $sql, array $params = []) { X::logger()->trace("$sql with params " . $this->serializeArray($params)); try { $st = $this->pdo->prepare($sql); if ($st === false) { $e = $this->pdo->errorInfo(); throw new DataBaseException...
php
public function query(string $sql, array $params = []) { X::logger()->trace("$sql with params " . $this->serializeArray($params)); try { $st = $this->pdo->prepare($sql); if ($st === false) { $e = $this->pdo->errorInfo(); throw new DataBaseException...
[ "public", "function", "query", "(", "string", "$", "sql", ",", "array", "$", "params", "=", "[", "]", ")", "{", "X", "::", "logger", "(", ")", "->", "trace", "(", "\"$sql with params \"", ".", "$", "this", "->", "serializeArray", "(", "$", "params", ...
run sql and return the result @param string $sql @param array $params @throws DataBaseException @return array
[ "run", "sql", "and", "return", "the", "result" ]
65e43952ab940ab05696a34d31a1c3ab91545090
https://github.com/x2ts/x2ts/blob/65e43952ab940ab05696a34d31a1c3ab91545090/src/db/SQLite.php#L62-L82
train
3ev/wordpress-core
src/Tev/Author/Model/Author.php
Author.getAvatarTag
public function getAvatarTag($size = 96, $alt = null) { return get_avatar($this->getId(), $size, null, $alt ?: $this->getDisplayName()); }
php
public function getAvatarTag($size = 96, $alt = null) { return get_avatar($this->getId(), $size, null, $alt ?: $this->getDisplayName()); }
[ "public", "function", "getAvatarTag", "(", "$", "size", "=", "96", ",", "$", "alt", "=", "null", ")", "{", "return", "get_avatar", "(", "$", "this", "->", "getId", "(", ")", ",", "$", "size", ",", "null", ",", "$", "alt", "?", ":", "$", "this", ...
Get an image tag for this author's avatar. @param int $size Avatar size. Max 512, default 96 @param string $alt Alt text. Defaults to display name @return string
[ "Get", "an", "image", "tag", "for", "this", "author", "s", "avatar", "." ]
da674fbec5bf3d5bd2a2141680a4c141113eb6b0
https://github.com/3ev/wordpress-core/blob/da674fbec5bf3d5bd2a2141680a4c141113eb6b0/src/Tev/Author/Model/Author.php#L142-L145
train
tarsana/syntax
src/ArraySyntax.php
ArraySyntax.syntax
public function syntax(Syntax $value = null) : Syntax { if (null === $value) { return $this->syntax; } $this->syntax = $value; return $this; }
php
public function syntax(Syntax $value = null) : Syntax { if (null === $value) { return $this->syntax; } $this->syntax = $value; return $this; }
[ "public", "function", "syntax", "(", "Syntax", "$", "value", "=", "null", ")", ":", "Syntax", "{", "if", "(", "null", "===", "$", "value", ")", "{", "return", "$", "this", "->", "syntax", ";", "}", "$", "this", "->", "syntax", "=", "$", "value", ...
Item syntax getter and setter. @param Tarsana\Syntax\Syntax $value @return Tarsana\Syntax\Syntax
[ "Item", "syntax", "getter", "and", "setter", "." ]
fd3f8a25e3be0e391c8fd486ccfcffe913ade534
https://github.com/tarsana/syntax/blob/fd3f8a25e3be0e391c8fd486ccfcffe913ade534/src/ArraySyntax.php#L49-L56
train
tarsana/syntax
src/ArraySyntax.php
ArraySyntax.separator
public function separator(string $value = null) { if (null === $value) { return $this->separator; } $this->separator = $value; return $this; }
php
public function separator(string $value = null) { if (null === $value) { return $this->separator; } $this->separator = $value; return $this; }
[ "public", "function", "separator", "(", "string", "$", "value", "=", "null", ")", "{", "if", "(", "null", "===", "$", "value", ")", "{", "return", "$", "this", "->", "separator", ";", "}", "$", "this", "->", "separator", "=", "$", "value", ";", "re...
Separator getter and setter. @param string $value @return self|string
[ "Separator", "getter", "and", "setter", "." ]
fd3f8a25e3be0e391c8fd486ccfcffe913ade534
https://github.com/tarsana/syntax/blob/fd3f8a25e3be0e391c8fd486ccfcffe913ade534/src/ArraySyntax.php#L64-L71
train
tarsana/syntax
src/ArraySyntax.php
ArraySyntax.parse
public function parse(string $text) : array { $index = 0; $items = Text::split($text, $this->separator); $array = []; try { foreach ($items as $item) { $array[] = $this->syntax->parse($item); $index += strlen($item) + 1; } ...
php
public function parse(string $text) : array { $index = 0; $items = Text::split($text, $this->separator); $array = []; try { foreach ($items as $item) { $array[] = $this->syntax->parse($item); $index += strlen($item) + 1; } ...
[ "public", "function", "parse", "(", "string", "$", "text", ")", ":", "array", "{", "$", "index", "=", "0", ";", "$", "items", "=", "Text", "::", "split", "(", "$", "text", ",", "$", "this", "->", "separator", ")", ";", "$", "array", "=", "[", "...
Transforms a string to array based on the syntax or throws a ParseException. @param string $text the string to parse @return array @throws Tarsana\Syntax\Exceptions\ParseException
[ "Transforms", "a", "string", "to", "array", "based", "on", "the", "syntax", "or", "throws", "a", "ParseException", "." ]
fd3f8a25e3be0e391c8fd486ccfcffe913ade534
https://github.com/tarsana/syntax/blob/fd3f8a25e3be0e391c8fd486ccfcffe913ade534/src/ArraySyntax.php#L92-L114
train
tarsana/syntax
src/ArraySyntax.php
ArraySyntax.dump
public function dump($values) : string { if (! is_array($values)) throw new DumpException($this, $values, self::ERROR); $items = []; $index = 0; try { foreach ($values as $key => $value) { $index = $key; $items[] = $this->syntax...
php
public function dump($values) : string { if (! is_array($values)) throw new DumpException($this, $values, self::ERROR); $items = []; $index = 0; try { foreach ($values as $key => $value) { $index = $key; $items[] = $this->syntax...
[ "public", "function", "dump", "(", "$", "values", ")", ":", "string", "{", "if", "(", "!", "is_array", "(", "$", "values", ")", ")", "throw", "new", "DumpException", "(", "$", "this", ",", "$", "values", ",", "self", "::", "ERROR", ")", ";", "$", ...
Converts the given array to a string based on the syntax or throws a DumpException. @param array $values the data to encode @return string @throws Tarsana\Syntax\Exceptions\DumpException
[ "Converts", "the", "given", "array", "to", "a", "string", "based", "on", "the", "syntax", "or", "throws", "a", "DumpException", "." ]
fd3f8a25e3be0e391c8fd486ccfcffe913ade534
https://github.com/tarsana/syntax/blob/fd3f8a25e3be0e391c8fd486ccfcffe913ade534/src/ArraySyntax.php#L125-L141
train
payapi/payapi-sdk-php
src/payapi/core/core.controller.php
controller.settings
protected function settings($key = false) { if ($this->settings == false) { return false; } if ($key == false) { return $this->settings; } if (isset($this->settings[$key])) { return $this->settings[$key]; } return false; ...
php
protected function settings($key = false) { if ($this->settings == false) { return false; } if ($key == false) { return $this->settings; } if (isset($this->settings[$key])) { return $this->settings[$key]; } return false; ...
[ "protected", "function", "settings", "(", "$", "key", "=", "false", ")", "{", "if", "(", "$", "this", "->", "settings", "==", "false", ")", "{", "return", "false", ";", "}", "if", "(", "$", "key", "==", "false", ")", "{", "return", "$", "this", "...
-> merchantSettings
[ "-", ">", "merchantSettings" ]
6a675749c88742b261178d7977f2436d540132b4
https://github.com/payapi/payapi-sdk-php/blob/6a675749c88742b261178d7977f2436d540132b4/src/payapi/core/core.controller.php#L231-L243
train
as3io/modlr
src/Rest/RestKernel.php
RestKernel.handle
public function handle(Request $request) { try { $restRequest = new RestRequest($this->config, $request->getMethod(), $request->getUri(), $request->getContent()); $restResponse = $this->adapter->processRequest($restRequest); } catch (\Exception $e) { if (true === ...
php
public function handle(Request $request) { try { $restRequest = new RestRequest($this->config, $request->getMethod(), $request->getUri(), $request->getContent()); $restResponse = $this->adapter->processRequest($restRequest); } catch (\Exception $e) { if (true === ...
[ "public", "function", "handle", "(", "Request", "$", "request", ")", "{", "try", "{", "$", "restRequest", "=", "new", "RestRequest", "(", "$", "this", "->", "config", ",", "$", "request", "->", "getMethod", "(", ")", ",", "$", "request", "->", "getUri"...
Processes an incoming Request object, routes it to the adapter, and returns a response. @param Request $request @return Response $response
[ "Processes", "an", "incoming", "Request", "object", "routes", "it", "to", "the", "adapter", "and", "returns", "a", "response", "." ]
7e684b88bb22a2e18397df9402075c6533084b16
https://github.com/as3io/modlr/blob/7e684b88bb22a2e18397df9402075c6533084b16/src/Rest/RestKernel.php#L62-L74
train
weavephp/container-league
src/League.php
League.loadContainer
protected function loadContainer(array $config = [], $environment = null) { $this->container = new Container; $this->configureContainerInternal(); $this->configureContainer($this->container, $config, $environment); return $this->container->get('instantiator'); }
php
protected function loadContainer(array $config = [], $environment = null) { $this->container = new Container; $this->configureContainerInternal(); $this->configureContainer($this->container, $config, $environment); return $this->container->get('instantiator'); }
[ "protected", "function", "loadContainer", "(", "array", "$", "config", "=", "[", "]", ",", "$", "environment", "=", "null", ")", "{", "$", "this", "->", "container", "=", "new", "Container", ";", "$", "this", "->", "configureContainerInternal", "(", ")", ...
Setup the Dependency Injection Container @param array $config Optional config array as provided from loadConfig(). @param string $environment Optional indication of the runtime environment. @return callable A callable that can instantiate instances of classes from the DIC.
[ "Setup", "the", "Dependency", "Injection", "Container" ]
14227536569eccd8376b38429e7762a4caebe282
https://github.com/weavephp/container-league/blob/14227536569eccd8376b38429e7762a4caebe282/src/League.php#L31-L37
train
weavephp/container-league
src/League.php
League.configureContainerInternal
protected function configureContainerInternal() { $this->container->add( 'instantiator', function () { return function ($name) { return $this->container->get($name); }; } ); $this->container->add(\Weave\Middleware\Middleware::class) ->withArgument(\Weave\Middleware\MiddlewareAdaptorInter...
php
protected function configureContainerInternal() { $this->container->add( 'instantiator', function () { return function ($name) { return $this->container->get($name); }; } ); $this->container->add(\Weave\Middleware\Middleware::class) ->withArgument(\Weave\Middleware\MiddlewareAdaptorInter...
[ "protected", "function", "configureContainerInternal", "(", ")", "{", "$", "this", "->", "container", "->", "add", "(", "'instantiator'", ",", "function", "(", ")", "{", "return", "function", "(", "$", "name", ")", "{", "return", "$", "this", "->", "contai...
Configure's the internal Weave requirements. @return null
[ "Configure", "s", "the", "internal", "Weave", "requirements", "." ]
14227536569eccd8376b38429e7762a4caebe282
https://github.com/weavephp/container-league/blob/14227536569eccd8376b38429e7762a4caebe282/src/League.php#L55-L103
train
wandersonwhcr/illuminate-romans
src/Providers/RomansProvider.php
RomansProvider.register
public function register() { $this->app->singleton(Grammar::class); $this->app->singleton(Lexer::class); $this->app->singleton(Parser::class); $this->app->singleton(IntToRomanFilter::class); $this->app->singleton(RomanToIntFilter::class); $this->app->resolving(Rom...
php
public function register() { $this->app->singleton(Grammar::class); $this->app->singleton(Lexer::class); $this->app->singleton(Parser::class); $this->app->singleton(IntToRomanFilter::class); $this->app->singleton(RomanToIntFilter::class); $this->app->resolving(Rom...
[ "public", "function", "register", "(", ")", "{", "$", "this", "->", "app", "->", "singleton", "(", "Grammar", "::", "class", ")", ";", "$", "this", "->", "app", "->", "singleton", "(", "Lexer", "::", "class", ")", ";", "$", "this", "->", "app", "->...
Register Romans Services @return void
[ "Register", "Romans", "Services" ]
7025e39c633cb30a10eff27c7cfa756ce91026a6
https://github.com/wandersonwhcr/illuminate-romans/blob/7025e39c633cb30a10eff27c7cfa756ce91026a6/src/Providers/RomansProvider.php#L41-L60
train
mover-io/belt
lib/Text.php
Text.shellColor
static public function shellColor($color, $string, $conditional=true) { if(!$conditional) { return $string; } $color = self::shellColorCode($color); return $color.$string.self::shellColorCode('plain'); }
php
static public function shellColor($color, $string, $conditional=true) { if(!$conditional) { return $string; } $color = self::shellColorCode($color); return $color.$string.self::shellColorCode('plain'); }
[ "static", "public", "function", "shellColor", "(", "$", "color", ",", "$", "string", ",", "$", "conditional", "=", "true", ")", "{", "if", "(", "!", "$", "conditional", ")", "{", "return", "$", "string", ";", "}", "$", "color", "=", "self", "::", "...
Wraps string in bash shell color escape sequences for the provided color. @param $color string|integer If a string is provided, we lookup the colors using the $colors table in the function body below. For precise control, an integer will yield a precise color code. @param $string string The string to colorize. @param ...
[ "Wraps", "string", "in", "bash", "shell", "color", "escape", "sequences", "for", "the", "provided", "color", "." ]
c966a70aa0f4eb51be55bbb86c89b1e85b773d68
https://github.com/mover-io/belt/blob/c966a70aa0f4eb51be55bbb86c89b1e85b773d68/lib/Text.php#L136-L142
train
mover-io/belt
lib/Text.php
Text.fromCamel
static public function fromCamel($str) { $str[0] = strtolower($str[0]); return preg_replace_callback('/([A-Z])/', function($char) {return "_" . strtolower($char[1]);}, $str); }
php
static public function fromCamel($str) { $str[0] = strtolower($str[0]); return preg_replace_callback('/([A-Z])/', function($char) {return "_" . strtolower($char[1]);}, $str); }
[ "static", "public", "function", "fromCamel", "(", "$", "str", ")", "{", "$", "str", "[", "0", "]", "=", "strtolower", "(", "$", "str", "[", "0", "]", ")", ";", "return", "preg_replace_callback", "(", "'/([A-Z])/'", ",", "function", "(", "$", "char", ...
Converts camel-case to corresponding underscores. @param $str @example helloWorld -> hello_world @return string
[ "Converts", "camel", "-", "case", "to", "corresponding", "underscores", "." ]
c966a70aa0f4eb51be55bbb86c89b1e85b773d68
https://github.com/mover-io/belt/blob/c966a70aa0f4eb51be55bbb86c89b1e85b773d68/lib/Text.php#L213-L216
train
mover-io/belt
lib/Text.php
Text.toCamel
static public function toCamel($str, $capitalise_first_char = false) { if($capitalise_first_char) { $str[0] = strtoupper($str[0]); } return preg_replace_callback('/_([a-z])/',function($char) {return strtoupper($char[1]);}, $str); }
php
static public function toCamel($str, $capitalise_first_char = false) { if($capitalise_first_char) { $str[0] = strtoupper($str[0]); } return preg_replace_callback('/_([a-z])/',function($char) {return strtoupper($char[1]);}, $str); }
[ "static", "public", "function", "toCamel", "(", "$", "str", ",", "$", "capitalise_first_char", "=", "false", ")", "{", "if", "(", "$", "capitalise_first_char", ")", "{", "$", "str", "[", "0", "]", "=", "strtoupper", "(", "$", "str", "[", "0", "]", ")...
Converts underscores to a corresponding camel-case string. @param $str @param $capitalise_first_char @example this_is_a_test -> thisIsATest @return string
[ "Converts", "underscores", "to", "a", "corresponding", "camel", "-", "case", "string", "." ]
c966a70aa0f4eb51be55bbb86c89b1e85b773d68
https://github.com/mover-io/belt/blob/c966a70aa0f4eb51be55bbb86c89b1e85b773d68/lib/Text.php#L227-L232
train
feelinc/laravel-api
src/Sule/Api/OAuth2/Repositories/FluentSession.php
FluentSession.deleteSession
public function deleteSession($clientId, $ownerType, $ownerId) { DB::table('oauth_sessions') ->where('client_id', $clientId) ->where('owner_type', $ownerType) ->where('owner_id', $ownerId) ->delete(); }
php
public function deleteSession($clientId, $ownerType, $ownerId) { DB::table('oauth_sessions') ->where('client_id', $clientId) ->where('owner_type', $ownerType) ->where('owner_id', $ownerId) ->delete(); }
[ "public", "function", "deleteSession", "(", "$", "clientId", ",", "$", "ownerType", ",", "$", "ownerId", ")", "{", "DB", "::", "table", "(", "'oauth_sessions'", ")", "->", "where", "(", "'client_id'", ",", "$", "clientId", ")", "->", "where", "(", "'owne...
Delete a session Example SQL query: <code> DELETE FROM oauth_sessions WHERE client_id = :clientId AND owner_type = :type AND owner_id = :typeId </code> @param string $clientId The client ID @param string $ownerType The type of the session owner (e.g. "user") @param string $ownerId The ID of the session owner (...
[ "Delete", "a", "session" ]
8b4abc4f1be255b441e09f5014e863a130c666d8
https://github.com/feelinc/laravel-api/blob/8b4abc4f1be255b441e09f5014e863a130c666d8/src/Sule/Api/OAuth2/Repositories/FluentSession.php#L60-L67
train
feelinc/laravel-api
src/Sule/Api/OAuth2/Repositories/FluentSession.php
FluentSession.associateRedirectUri
public function associateRedirectUri($sessionId, $redirectUri) { DB::table('oauth_session_redirects')->insert(array( 'session_id' => $sessionId, 'redirect_uri' => $redirectUri, 'created_at' => Carbon::now(), 'updated_at' => Carbon::now() )); }
php
public function associateRedirectUri($sessionId, $redirectUri) { DB::table('oauth_session_redirects')->insert(array( 'session_id' => $sessionId, 'redirect_uri' => $redirectUri, 'created_at' => Carbon::now(), 'updated_at' => Carbon::now() )); }
[ "public", "function", "associateRedirectUri", "(", "$", "sessionId", ",", "$", "redirectUri", ")", "{", "DB", "::", "table", "(", "'oauth_session_redirects'", ")", "->", "insert", "(", "array", "(", "'session_id'", "=>", "$", "sessionId", ",", "'redirect_uri'", ...
Associate a redirect URI with a session Example SQL query: <code> INSERT INTO oauth_session_redirects (session_id, redirect_uri) VALUE (:sessionId, :redirectUri) </code> @param int $sessionId The session ID @param string $redirectUri The redirect URI @return void
[ "Associate", "a", "redirect", "URI", "with", "a", "session" ]
8b4abc4f1be255b441e09f5014e863a130c666d8
https://github.com/feelinc/laravel-api/blob/8b4abc4f1be255b441e09f5014e863a130c666d8/src/Sule/Api/OAuth2/Repositories/FluentSession.php#L82-L90
train
feelinc/laravel-api
src/Sule/Api/OAuth2/Repositories/FluentSession.php
FluentSession.associateAccessToken
public function associateAccessToken($sessionId, $accessToken, $expireTime) { return DB::table('oauth_session_access_tokens')->insertGetId(array( 'session_id' => $sessionId, 'access_token' => $accessToken, 'access_token_expires' => $expireTime, ...
php
public function associateAccessToken($sessionId, $accessToken, $expireTime) { return DB::table('oauth_session_access_tokens')->insertGetId(array( 'session_id' => $sessionId, 'access_token' => $accessToken, 'access_token_expires' => $expireTime, ...
[ "public", "function", "associateAccessToken", "(", "$", "sessionId", ",", "$", "accessToken", ",", "$", "expireTime", ")", "{", "return", "DB", "::", "table", "(", "'oauth_session_access_tokens'", ")", "->", "insertGetId", "(", "array", "(", "'session_id'", "=>"...
Associate an access token with a session Example SQL query: <code> INSERT INTO oauth_session_access_tokens (session_id, access_token, access_token_expires) VALUE (:sessionId, :accessToken, :accessTokenExpire) </code> @param int $sessionId The session ID @param string $accessToken The access token @param int ...
[ "Associate", "an", "access", "token", "with", "a", "session" ]
8b4abc4f1be255b441e09f5014e863a130c666d8
https://github.com/feelinc/laravel-api/blob/8b4abc4f1be255b441e09f5014e863a130c666d8/src/Sule/Api/OAuth2/Repositories/FluentSession.php#L107-L116
train
feelinc/laravel-api
src/Sule/Api/OAuth2/Repositories/FluentSession.php
FluentSession.associateRefreshToken
public function associateRefreshToken($accessTokenId, $refreshToken, $expireTime, $clientId) { DB::table('oauth_session_refresh_tokens')->insert(array( 'session_access_token_id' => $accessTokenId, 'refresh_token' => $refreshToken, 'refresh_token_expires' => $e...
php
public function associateRefreshToken($accessTokenId, $refreshToken, $expireTime, $clientId) { DB::table('oauth_session_refresh_tokens')->insert(array( 'session_access_token_id' => $accessTokenId, 'refresh_token' => $refreshToken, 'refresh_token_expires' => $e...
[ "public", "function", "associateRefreshToken", "(", "$", "accessTokenId", ",", "$", "refreshToken", ",", "$", "expireTime", ",", "$", "clientId", ")", "{", "DB", "::", "table", "(", "'oauth_session_refresh_tokens'", ")", "->", "insert", "(", "array", "(", "'se...
Associate a refresh token with a session Example SQL query: <code> INSERT INTO oauth_session_refresh_tokens (session_access_token_id, refresh_token, refresh_token_expires, client_id) VALUE (:accessTokenId, :refreshToken, :expireTime, :clientId) </code> @param int $accessTokenId The access token ID @param string...
[ "Associate", "a", "refresh", "token", "with", "a", "session" ]
8b4abc4f1be255b441e09f5014e863a130c666d8
https://github.com/feelinc/laravel-api/blob/8b4abc4f1be255b441e09f5014e863a130c666d8/src/Sule/Api/OAuth2/Repositories/FluentSession.php#L134-L144
train
feelinc/laravel-api
src/Sule/Api/OAuth2/Repositories/FluentSession.php
FluentSession.associateAuthCode
public function associateAuthCode($sessionId, $authCode, $expireTime) { $id = DB::table('oauth_session_authcodes')->insertGetId(array( 'session_id' => $sessionId, 'auth_code' => $authCode, 'auth_code_expires' => $expireTime, 'created_at' => Carb...
php
public function associateAuthCode($sessionId, $authCode, $expireTime) { $id = DB::table('oauth_session_authcodes')->insertGetId(array( 'session_id' => $sessionId, 'auth_code' => $authCode, 'auth_code_expires' => $expireTime, 'created_at' => Carb...
[ "public", "function", "associateAuthCode", "(", "$", "sessionId", ",", "$", "authCode", ",", "$", "expireTime", ")", "{", "$", "id", "=", "DB", "::", "table", "(", "'oauth_session_authcodes'", ")", "->", "insertGetId", "(", "array", "(", "'session_id'", "=>"...
Assocate an authorization code with a session Example SQL query: <code> INSERT INTO oauth_session_authcodes (session_id, auth_code, auth_code_expires) VALUE (:sessionId, :authCode, :authCodeExpires) </code> @param int $sessionId The session ID @param string $authCode The authorization code @param int $ex...
[ "Assocate", "an", "authorization", "code", "with", "a", "session" ]
8b4abc4f1be255b441e09f5014e863a130c666d8
https://github.com/feelinc/laravel-api/blob/8b4abc4f1be255b441e09f5014e863a130c666d8/src/Sule/Api/OAuth2/Repositories/FluentSession.php#L161-L172
train
feelinc/laravel-api
src/Sule/Api/OAuth2/Repositories/FluentSession.php
FluentSession.validateAuthCode
public function validateAuthCode($clientId, $redirectUri, $authCode) { $result = DB::table('oauth_sessions') ->select('oauth_sessions.id as session_id', 'oauth_session_authcodes.id as authcode_id') ->join('oauth_session_authcodes', 'oauth_sessions.id', '=', 'oauth_ses...
php
public function validateAuthCode($clientId, $redirectUri, $authCode) { $result = DB::table('oauth_sessions') ->select('oauth_sessions.id as session_id', 'oauth_session_authcodes.id as authcode_id') ->join('oauth_session_authcodes', 'oauth_sessions.id', '=', 'oauth_ses...
[ "public", "function", "validateAuthCode", "(", "$", "clientId", ",", "$", "redirectUri", ",", "$", "authCode", ")", "{", "$", "result", "=", "DB", "::", "table", "(", "'oauth_sessions'", ")", "->", "select", "(", "'oauth_sessions.id as session_id'", ",", "'oau...
Validate an authorization code Example SQL query: <code> SELECT oauth_sessions.id AS session_id, oauth_session_authcodes.id AS authcode_id FROM oauth_sessions JOIN oauth_session_authcodes ON oauth_session_authcodes.`session_id` = oauth_sessions.id JOIN oauth_session_redirects ON oauth_session_redirects.`session_id` =...
[ "Validate", "an", "authorization", "code" ]
8b4abc4f1be255b441e09f5014e863a130c666d8
https://github.com/feelinc/laravel-api/blob/8b4abc4f1be255b441e09f5014e863a130c666d8/src/Sule/Api/OAuth2/Repositories/FluentSession.php#L221-L234
train
feelinc/laravel-api
src/Sule/Api/OAuth2/Repositories/FluentSession.php
FluentSession.validateAccessToken
public function validateAccessToken($accessToken) { $result = DB::table('oauth_session_access_tokens') ->select('oauth_session_access_tokens.session_id as session_id', 'oauth_sessions.client_id as client_id', 'oauth_clients.secret a...
php
public function validateAccessToken($accessToken) { $result = DB::table('oauth_session_access_tokens') ->select('oauth_session_access_tokens.session_id as session_id', 'oauth_sessions.client_id as client_id', 'oauth_clients.secret a...
[ "public", "function", "validateAccessToken", "(", "$", "accessToken", ")", "{", "$", "result", "=", "DB", "::", "table", "(", "'oauth_session_access_tokens'", ")", "->", "select", "(", "'oauth_session_access_tokens.session_id as session_id'", ",", "'oauth_sessions.client_...
Validate an access token Example SQL query: <code> SELECT session_id, oauth_sessions.`client_id`, oauth_sessions.`owner_id`, oauth_sessions.`owner_type` FROM `oauth_session_access_tokens` JOIN oauth_sessions ON oauth_sessions.`id` = session_id WHERE access_token = :accessToken AND access_token_expires >= UNIX_TIMESTA...
[ "Validate", "an", "access", "token" ]
8b4abc4f1be255b441e09f5014e863a130c666d8
https://github.com/feelinc/laravel-api/blob/8b4abc4f1be255b441e09f5014e863a130c666d8/src/Sule/Api/OAuth2/Repositories/FluentSession.php#L261-L276
train
feelinc/laravel-api
src/Sule/Api/OAuth2/Repositories/FluentSession.php
FluentSession.validateRefreshToken
public function validateRefreshToken($refreshToken, $clientId) { $result = DB::table('oauth_session_refresh_tokens') ->where('refresh_token', $refreshToken) ->where('client_id', $clientId) ->where('refresh_token_expires', '>=', time()) ...
php
public function validateRefreshToken($refreshToken, $clientId) { $result = DB::table('oauth_session_refresh_tokens') ->where('refresh_token', $refreshToken) ->where('client_id', $clientId) ->where('refresh_token_expires', '>=', time()) ...
[ "public", "function", "validateRefreshToken", "(", "$", "refreshToken", ",", "$", "clientId", ")", "{", "$", "result", "=", "DB", "::", "table", "(", "'oauth_session_refresh_tokens'", ")", "->", "where", "(", "'refresh_token'", ",", "$", "refreshToken", ")", "...
Validate a refresh token Example SQL query: <code> SELECT session_access_token_id FROM `oauth_session_refresh_tokens` WHERE refresh_token = :refreshToken AND refresh_token_expires >= UNIX_TIMESTAMP(NOW()) AND client_id = :clientId </code> @param string $refreshToken The access token @param string $clientId ...
[ "Validate", "a", "refresh", "token" ]
8b4abc4f1be255b441e09f5014e863a130c666d8
https://github.com/feelinc/laravel-api/blob/8b4abc4f1be255b441e09f5014e863a130c666d8/src/Sule/Api/OAuth2/Repositories/FluentSession.php#L292-L301
train
feelinc/laravel-api
src/Sule/Api/OAuth2/Repositories/FluentSession.php
FluentSession.getAccessToken
public function getAccessToken($accessTokenId) { $result = DB::table('oauth_session_access_tokens') ->where('id', $accessTokenId) ->first(); return (is_null($result)) ? false : (array) $result; }
php
public function getAccessToken($accessTokenId) { $result = DB::table('oauth_session_access_tokens') ->where('id', $accessTokenId) ->first(); return (is_null($result)) ? false : (array) $result; }
[ "public", "function", "getAccessToken", "(", "$", "accessTokenId", ")", "{", "$", "result", "=", "DB", "::", "table", "(", "'oauth_session_access_tokens'", ")", "->", "where", "(", "'id'", ",", "$", "accessTokenId", ")", "->", "first", "(", ")", ";", "retu...
Get an access token by ID Example SQL query: <code> SELECT * FROM `oauth_session_access_tokens` WHERE `id` = :accessTokenId </code> Expected response: <code> array( 'id' => (int), 'session_id' => (int), 'access_token' => (string), 'access_token_expires' => (int) ) </code> @param int $accessTokenId The ...
[ "Get", "an", "access", "token", "by", "ID" ]
8b4abc4f1be255b441e09f5014e863a130c666d8
https://github.com/feelinc/laravel-api/blob/8b4abc4f1be255b441e09f5014e863a130c666d8/src/Sule/Api/OAuth2/Repositories/FluentSession.php#L326-L333
train
feelinc/laravel-api
src/Sule/Api/OAuth2/Repositories/FluentSession.php
FluentSession.associateScope
public function associateScope($accessTokenId, $scopeId) { DB::table('oauth_session_token_scopes')->insert(array( 'session_access_token_id' => $accessTokenId, 'scope_id' => $scopeId, 'created_at' => Carbon::now(), 'updated_at' => Carbon::now() ...
php
public function associateScope($accessTokenId, $scopeId) { DB::table('oauth_session_token_scopes')->insert(array( 'session_access_token_id' => $accessTokenId, 'scope_id' => $scopeId, 'created_at' => Carbon::now(), 'updated_at' => Carbon::now() ...
[ "public", "function", "associateScope", "(", "$", "accessTokenId", ",", "$", "scopeId", ")", "{", "DB", "::", "table", "(", "'oauth_session_token_scopes'", ")", "->", "insert", "(", "array", "(", "'session_access_token_id'", "=>", "$", "accessTokenId", ",", "'sc...
Associate a scope with an access token Example SQL query: <code> INSERT INTO `oauth_session_token_scopes` (`session_access_token_id`, `scope_id`) VALUE (:accessTokenId, :scopeId) </code> @param int $accessTokenId The ID of the access token @param int $scopeId The ID of the scope @return void
[ "Associate", "a", "scope", "with", "an", "access", "token" ]
8b4abc4f1be255b441e09f5014e863a130c666d8
https://github.com/feelinc/laravel-api/blob/8b4abc4f1be255b441e09f5014e863a130c666d8/src/Sule/Api/OAuth2/Repositories/FluentSession.php#L348-L356
train
feelinc/laravel-api
src/Sule/Api/OAuth2/Repositories/FluentSession.php
FluentSession.getScopes
public function getScopes($accessToken) { $scopeResults = DB::table('oauth_session_token_scopes') ->select('oauth_scopes.*') ->join('oauth_session_access_tokens', 'oauth_session_token_scopes.session_access_token_id', '=', 'oauth_session_access_tokens.id') ->join('oauth_scopes',...
php
public function getScopes($accessToken) { $scopeResults = DB::table('oauth_session_token_scopes') ->select('oauth_scopes.*') ->join('oauth_session_access_tokens', 'oauth_session_token_scopes.session_access_token_id', '=', 'oauth_session_access_tokens.id') ->join('oauth_scopes',...
[ "public", "function", "getScopes", "(", "$", "accessToken", ")", "{", "$", "scopeResults", "=", "DB", "::", "table", "(", "'oauth_session_token_scopes'", ")", "->", "select", "(", "'oauth_scopes.*'", ")", "->", "join", "(", "'oauth_session_access_tokens'", ",", ...
Get all associated access tokens for an access token Example SQL query: <code> SELECT oauth_scopes.* FROM oauth_session_token_scopes JOIN oauth_session_access_tokens ON oauth_session_access_tokens.`id` = `oauth_session_token_scopes`.`session_access_token_id` JOIN oauth_scopes ON oauth_scopes.id = `oauth_session_token...
[ "Get", "all", "associated", "access", "tokens", "for", "an", "access", "token" ]
8b4abc4f1be255b441e09f5014e863a130c666d8
https://github.com/feelinc/laravel-api/blob/8b4abc4f1be255b441e09f5014e863a130c666d8/src/Sule/Api/OAuth2/Repositories/FluentSession.php#L387-L405
train
feelinc/laravel-api
src/Sule/Api/OAuth2/Repositories/FluentSession.php
FluentSession.getAuthCodeScopes
public function getAuthCodeScopes($oauthSessionAuthCodeId) { $scopesResults = DB::table('oauth_session_authcode_scopes') ->where('oauth_session_authcode_id', '=', $oauthSessionAuthCodeId) ->get(); $scopes = array(); foreach($scopesResults as $key=>$scope) ...
php
public function getAuthCodeScopes($oauthSessionAuthCodeId) { $scopesResults = DB::table('oauth_session_authcode_scopes') ->where('oauth_session_authcode_id', '=', $oauthSessionAuthCodeId) ->get(); $scopes = array(); foreach($scopesResults as $key=>$scope) ...
[ "public", "function", "getAuthCodeScopes", "(", "$", "oauthSessionAuthCodeId", ")", "{", "$", "scopesResults", "=", "DB", "::", "table", "(", "'oauth_session_authcode_scopes'", ")", "->", "where", "(", "'oauth_session_authcode_id'", ",", "'='", ",", "$", "oauthSessi...
Get the scopes associated with an auth code Example SQL query: <code> SELECT scope_id FROM `oauth_session_authcode_scopes` WHERE oauth_session_authcode_id = :authCodeId </code> Expected response: <code> array( array( 'scope_id' => (int) ), array( 'scope_id' => (int) ), ... ) </code> @param int $oauthSessionAuth...
[ "Get", "the", "scopes", "associated", "with", "an", "auth", "code" ]
8b4abc4f1be255b441e09f5014e863a130c666d8
https://github.com/feelinc/laravel-api/blob/8b4abc4f1be255b441e09f5014e863a130c666d8/src/Sule/Api/OAuth2/Repositories/FluentSession.php#L457-L473
train
chilimatic/chilimatic-framework
lib/file/File.php
File.append
public function append($content, $create = false) { if ($this->writeable !== true || empty($content)) return false; if (strpos($this->_option, 'a') === false) { // close open filepoint if (!empty($this->fp)) fclose($this->fp); // opens fp for writing with file l...
php
public function append($content, $create = false) { if ($this->writeable !== true || empty($content)) return false; if (strpos($this->_option, 'a') === false) { // close open filepoint if (!empty($this->fp)) fclose($this->fp); // opens fp for writing with file l...
[ "public", "function", "append", "(", "$", "content", ",", "$", "create", "=", "false", ")", "{", "if", "(", "$", "this", "->", "writeable", "!==", "true", "||", "empty", "(", "$", "content", ")", ")", "return", "false", ";", "if", "(", "strpos", "(...
appends to a file based + create if wanted @param $content string @param $create bool @return bool
[ "appends", "to", "a", "file", "based", "+", "create", "if", "wanted" ]
8df7f12e75d75d3fd2197a58c80d39cbb4b9ff12
https://github.com/chilimatic/chilimatic-framework/blob/8df7f12e75d75d3fd2197a58c80d39cbb4b9ff12/lib/file/File.php#L220-L240
train
chilimatic/chilimatic-framework
lib/file/File.php
File.change_owner
public function change_owner($owner) { if (empty($owner) || !is_int($owner) || $this->owner != getmyuid()) return false; if (!empty($this->fp)) fclose($this->fp); if (chown($this->path . $this->filename, $owner)) { return $this->open($this->path . $this->filename); } ...
php
public function change_owner($owner) { if (empty($owner) || !is_int($owner) || $this->owner != getmyuid()) return false; if (!empty($this->fp)) fclose($this->fp); if (chown($this->path . $this->filename, $owner)) { return $this->open($this->path . $this->filename); } ...
[ "public", "function", "change_owner", "(", "$", "owner", ")", "{", "if", "(", "empty", "(", "$", "owner", ")", "||", "!", "is_int", "(", "$", "owner", ")", "||", "$", "this", "->", "owner", "!=", "getmyuid", "(", ")", ")", "return", "false", ";", ...
changes file owner @param $owner int @return bool
[ "changes", "file", "owner" ]
8df7f12e75d75d3fd2197a58c80d39cbb4b9ff12
https://github.com/chilimatic/chilimatic-framework/blob/8df7f12e75d75d3fd2197a58c80d39cbb4b9ff12/lib/file/File.php#L283-L295
train
chilimatic/chilimatic-framework
lib/file/File.php
File.change_group
public function change_group($group) { if (empty($group) || !is_int($group)) return false; if (chgrp($this->path . $this->filename, $group)) { return $this->open($this->path . $this->filename); } return false; }
php
public function change_group($group) { if (empty($group) || !is_int($group)) return false; if (chgrp($this->path . $this->filename, $group)) { return $this->open($this->path . $this->filename); } return false; }
[ "public", "function", "change_group", "(", "$", "group", ")", "{", "if", "(", "empty", "(", "$", "group", ")", "||", "!", "is_int", "(", "$", "group", ")", ")", "return", "false", ";", "if", "(", "chgrp", "(", "$", "this", "->", "path", ".", "$",...
changes the group @param $group int @return bool
[ "changes", "the", "group" ]
8df7f12e75d75d3fd2197a58c80d39cbb4b9ff12
https://github.com/chilimatic/chilimatic-framework/blob/8df7f12e75d75d3fd2197a58c80d39cbb4b9ff12/lib/file/File.php#L325-L335
train
chilimatic/chilimatic-framework
lib/file/File.php
File._extract_file_extension
private function _extract_file_extension() { if (empty($this->filename)) return false; if (!empty($this->mime_type)) { $array = explode('/', $this->mime_type); $this->file_extension = array_pop($array); } else { if (strpos($this->filename,...
php
private function _extract_file_extension() { if (empty($this->filename)) return false; if (!empty($this->mime_type)) { $array = explode('/', $this->mime_type); $this->file_extension = array_pop($array); } else { if (strpos($this->filename,...
[ "private", "function", "_extract_file_extension", "(", ")", "{", "if", "(", "empty", "(", "$", "this", "->", "filename", ")", ")", "return", "false", ";", "if", "(", "!", "empty", "(", "$", "this", "->", "mime_type", ")", ")", "{", "$", "array", "=",...
extracts the extension of the current file
[ "extracts", "the", "extension", "of", "the", "current", "file" ]
8df7f12e75d75d3fd2197a58c80d39cbb4b9ff12
https://github.com/chilimatic/chilimatic-framework/blob/8df7f12e75d75d3fd2197a58c80d39cbb4b9ff12/lib/file/File.php#L357-L375
train
chilimatic/chilimatic-framework
lib/file/File.php
File._extract_filename
private function _extract_filename() { if (empty($this->file)) return false; $tmp_array = explode('/', $this->file); $count = (int)count($tmp_array); for ($i = 0; $i < $count; $i++) { if ($i + 1 == $count) { $this->filename = (string)$tmp_array[0]; ...
php
private function _extract_filename() { if (empty($this->file)) return false; $tmp_array = explode('/', $this->file); $count = (int)count($tmp_array); for ($i = 0; $i < $count; $i++) { if ($i + 1 == $count) { $this->filename = (string)$tmp_array[0]; ...
[ "private", "function", "_extract_filename", "(", ")", "{", "if", "(", "empty", "(", "$", "this", "->", "file", ")", ")", "return", "false", ";", "$", "tmp_array", "=", "explode", "(", "'/'", ",", "$", "this", "->", "file", ")", ";", "$", "count", "...
gets the filename of the file
[ "gets", "the", "filename", "of", "the", "file" ]
8df7f12e75d75d3fd2197a58c80d39cbb4b9ff12
https://github.com/chilimatic/chilimatic-framework/blob/8df7f12e75d75d3fd2197a58c80d39cbb4b9ff12/lib/file/File.php#L381-L397
train