id int32 0 241k | repo stringlengths 6 63 | path stringlengths 5 140 | func_name stringlengths 3 151 | original_string stringlengths 84 13k | language stringclasses 1
value | code stringlengths 84 13k | code_tokens list | docstring stringlengths 3 47.2k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 91 247 |
|---|---|---|---|---|---|---|---|---|---|---|---|
22,600 | shipmile/shipmile-api-php | lib/Shipmile/HttpClient/AuthHandler.php | AuthHandler.httpPassword | public function httpPassword(Event $event)
{
$event['request']->setHeader('Authorization', sprintf('Basic %s', base64_encode($this->auth['username'] . ':' . $this->auth['password'])));
} | php | public function httpPassword(Event $event)
{
$event['request']->setHeader('Authorization', sprintf('Basic %s', base64_encode($this->auth['username'] . ':' . $this->auth['password'])));
} | [
"public",
"function",
"httpPassword",
"(",
"Event",
"$",
"event",
")",
"{",
"$",
"event",
"[",
"'request'",
"]",
"->",
"setHeader",
"(",
"'Authorization'",
",",
"sprintf",
"(",
"'Basic %s'",
",",
"base64_encode",
"(",
"$",
"this",
"->",
"auth",
"[",
"'user... | Basic Authorization with username and password | [
"Basic",
"Authorization",
"with",
"username",
"and",
"password"
] | b8272613b3a27f0f27e8722cbee277e41e9dfe59 | https://github.com/shipmile/shipmile-api-php/blob/b8272613b3a27f0f27e8722cbee277e41e9dfe59/lib/Shipmile/HttpClient/AuthHandler.php#L77-L80 |
22,601 | shipmile/shipmile-api-php | lib/Shipmile/HttpClient/AuthHandler.php | AuthHandler.urlSecret | public function urlSecret(Event $event)
{
$query = $event['request']->getQuery();
$query->set('client_id', $this->auth['client_id']);
$query->set('client_secret', $this->auth['client_secret']);
} | php | public function urlSecret(Event $event)
{
$query = $event['request']->getQuery();
$query->set('client_id', $this->auth['client_id']);
$query->set('client_secret', $this->auth['client_secret']);
} | [
"public",
"function",
"urlSecret",
"(",
"Event",
"$",
"event",
")",
"{",
"$",
"query",
"=",
"$",
"event",
"[",
"'request'",
"]",
"->",
"getQuery",
"(",
")",
";",
"$",
"query",
"->",
"set",
"(",
"'client_id'",
",",
"$",
"this",
"->",
"auth",
"[",
"'... | OAUTH2 Authorization with client secret | [
"OAUTH2",
"Authorization",
"with",
"client",
"secret"
] | b8272613b3a27f0f27e8722cbee277e41e9dfe59 | https://github.com/shipmile/shipmile-api-php/blob/b8272613b3a27f0f27e8722cbee277e41e9dfe59/lib/Shipmile/HttpClient/AuthHandler.php#L85-L91 |
22,602 | nathan-fiscaletti/extended-arrays | src/ExtendedArrays/AssociativeArray.php | AssociativeArray.offsetSet | public function offsetSet($offset, $value)
{
if (is_null($offset)) {
throw new \Exception('Must supply key to modify arguments in an AssociativeArray.');
} else {
$this->_args[$offset] = $value;
}
} | php | public function offsetSet($offset, $value)
{
if (is_null($offset)) {
throw new \Exception('Must supply key to modify arguments in an AssociativeArray.');
} else {
$this->_args[$offset] = $value;
}
} | [
"public",
"function",
"offsetSet",
"(",
"$",
"offset",
",",
"$",
"value",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"offset",
")",
")",
"{",
"throw",
"new",
"\\",
"Exception",
"(",
"'Must supply key to modify arguments in an AssociativeArray.'",
")",
";",
"}",... | Override the offsetSet function to modify
values of the wrapped array. Key is enforced.
@param mixed $offset
@param mixed $value
@return mixed
@throws \Exception | [
"Override",
"the",
"offsetSet",
"function",
"to",
"modify",
"values",
"of",
"the",
"wrapped",
"array",
".",
"Key",
"is",
"enforced",
"."
] | a641856115131f76417521d3e4aa2d951158050a | https://github.com/nathan-fiscaletti/extended-arrays/blob/a641856115131f76417521d3e4aa2d951158050a/src/ExtendedArrays/AssociativeArray.php#L34-L41 |
22,603 | nblum/silverstripe-flexible-content | code/ContentPage.php | ContentPage_Controller.Elements | public function Elements()
{
$fcvdo = new \Nblum\FlexibleContent\FlexibleContentVersionedDataObject();
$defaultStage = $fcvdo->getDefaultStage();
if (isset($_GET['stage']) && $defaultStage == $_GET['stage'] && \Permission::check('CMS_ACCESS')) {
$stage = $defaultStage;
} ... | php | public function Elements()
{
$fcvdo = new \Nblum\FlexibleContent\FlexibleContentVersionedDataObject();
$defaultStage = $fcvdo->getDefaultStage();
if (isset($_GET['stage']) && $defaultStage == $_GET['stage'] && \Permission::check('CMS_ACCESS')) {
$stage = $defaultStage;
} ... | [
"public",
"function",
"Elements",
"(",
")",
"{",
"$",
"fcvdo",
"=",
"new",
"\\",
"Nblum",
"\\",
"FlexibleContent",
"\\",
"FlexibleContentVersionedDataObject",
"(",
")",
";",
"$",
"defaultStage",
"=",
"$",
"fcvdo",
"->",
"getDefaultStage",
"(",
")",
";",
"if"... | creates List of all rows with content
@return DataList | [
"creates",
"List",
"of",
"all",
"rows",
"with",
"content"
] | e20a06ee98b7f884965a951653d98af11eb6bc67 | https://github.com/nblum/silverstripe-flexible-content/blob/e20a06ee98b7f884965a951653d98af11eb6bc67/code/ContentPage.php#L197-L218 |
22,604 | DevGroup-ru/yii2-measure | src/helpers/MeasureHelper.php | MeasureHelper.convert | public static function convert($value, $to, $from)
{
if ($from instanceof Measure === false || $to instanceof Measure === false) {
throw new Exception('`from` or `to` parameter is not a Measure');
}
if ($from->type !== $to->type) {
throw new Exception('Measures have d... | php | public static function convert($value, $to, $from)
{
if ($from instanceof Measure === false || $to instanceof Measure === false) {
throw new Exception('`from` or `to` parameter is not a Measure');
}
if ($from->type !== $to->type) {
throw new Exception('Measures have d... | [
"public",
"static",
"function",
"convert",
"(",
"$",
"value",
",",
"$",
"to",
",",
"$",
"from",
")",
"{",
"if",
"(",
"$",
"from",
"instanceof",
"Measure",
"===",
"false",
"||",
"$",
"to",
"instanceof",
"Measure",
"===",
"false",
")",
"{",
"throw",
"n... | Convert a value from one measure to another
@param float $value
@param Measure $from
@param Measure $to
@return float
@throws Exception | [
"Convert",
"a",
"value",
"from",
"one",
"measure",
"to",
"another"
] | 1d41a4af6ad3f2e34cabc32fa1c97bfd3643269c | https://github.com/DevGroup-ru/yii2-measure/blob/1d41a4af6ad3f2e34cabc32fa1c97bfd3643269c/src/helpers/MeasureHelper.php#L30-L45 |
22,605 | DevGroup-ru/yii2-measure | src/helpers/MeasureHelper.php | MeasureHelper.format | public static function format($value, $to, $from = null)
{
if ($to instanceof Measure === false) {
throw new Exception('Unknown object');
}
if ($from instanceof Measure) {
$value = static::convert($value, $to, $from);
}
$formatter = $to->use_custom_for... | php | public static function format($value, $to, $from = null)
{
if ($to instanceof Measure === false) {
throw new Exception('Unknown object');
}
if ($from instanceof Measure) {
$value = static::convert($value, $to, $from);
}
$formatter = $to->use_custom_for... | [
"public",
"static",
"function",
"format",
"(",
"$",
"value",
",",
"$",
"to",
",",
"$",
"from",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"to",
"instanceof",
"Measure",
"===",
"false",
")",
"{",
"throw",
"new",
"Exception",
"(",
"'Unknown object'",
")",
... | Format a value by rule as a string
@param double $value
@param Measure $to
@param Measure|null $from
@return string
@throws Exception | [
"Format",
"a",
"value",
"by",
"rule",
"as",
"a",
"string"
] | 1d41a4af6ad3f2e34cabc32fa1c97bfd3643269c | https://github.com/DevGroup-ru/yii2-measure/blob/1d41a4af6ad3f2e34cabc32fa1c97bfd3643269c/src/helpers/MeasureHelper.php#L55-L71 |
22,606 | DevGroup-ru/yii2-measure | src/helpers/MeasureHelper.php | MeasureHelper.parseString | public static function parseString($source, $matchRules)
{
foreach ((array) $matchRules as $matchRule) {
if (is_callable($matchRule) === true) {
return call_user_func($matchRule, $source);
} else {
if (preg_match($matchRule, $source, $matches) === 1) {... | php | public static function parseString($source, $matchRules)
{
foreach ((array) $matchRules as $matchRule) {
if (is_callable($matchRule) === true) {
return call_user_func($matchRule, $source);
} else {
if (preg_match($matchRule, $source, $matches) === 1) {... | [
"public",
"static",
"function",
"parseString",
"(",
"$",
"source",
",",
"$",
"matchRules",
")",
"{",
"foreach",
"(",
"(",
"array",
")",
"$",
"matchRules",
"as",
"$",
"matchRule",
")",
"{",
"if",
"(",
"is_callable",
"(",
"$",
"matchRule",
")",
"===",
"t... | Parse string by regexp or closure.
@param string $source
@param \Closure[]|string[]|\Closure|string $matchRules
@return false|float | [
"Parse",
"string",
"by",
"regexp",
"or",
"closure",
"."
] | 1d41a4af6ad3f2e34cabc32fa1c97bfd3643269c | https://github.com/DevGroup-ru/yii2-measure/blob/1d41a4af6ad3f2e34cabc32fa1c97bfd3643269c/src/helpers/MeasureHelper.php#L79-L95 |
22,607 | Eresus/EresusCMS | src/core/framework/core/3rdparty/ezcomponents/Mail/src/parts/delivery_status.php | ezcMailDeliveryStatus.addHeadersSection | private function addHeadersSection( ezcMailHeadersHolder $headers )
{
$result = "";
foreach ( $headers->getCaseSensitiveArray() as $header => $value )
{
$result .= $header . ": " . $value . ezcMailTools::lineBreak();
}
return $result;
} | php | private function addHeadersSection( ezcMailHeadersHolder $headers )
{
$result = "";
foreach ( $headers->getCaseSensitiveArray() as $header => $value )
{
$result .= $header . ": " . $value . ezcMailTools::lineBreak();
}
return $result;
} | [
"private",
"function",
"addHeadersSection",
"(",
"ezcMailHeadersHolder",
"$",
"headers",
")",
"{",
"$",
"result",
"=",
"\"\"",
";",
"foreach",
"(",
"$",
"headers",
"->",
"getCaseSensitiveArray",
"(",
")",
"as",
"$",
"header",
"=>",
"$",
"value",
")",
"{",
... | Returns the generated text for a section of the delivery-status part.
@param ezcMailHeadersHolder $headers
@return string | [
"Returns",
"the",
"generated",
"text",
"for",
"a",
"section",
"of",
"the",
"delivery",
"-",
"status",
"part",
"."
] | b0afc661105f0a2f65d49abac13956cc93c5188d | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/Mail/src/parts/delivery_status.php#L155-L163 |
22,608 | Eresus/EresusCMS | src/core/framework/core/3rdparty/ezcomponents/Mail/src/parts/delivery_status.php | ezcMailDeliveryStatus.createRecipient | public function createRecipient()
{
$result = count( $this->recipients );
$this->recipients[$result] = new ezcMailHeadersHolder();
return $result;
} | php | public function createRecipient()
{
$result = count( $this->recipients );
$this->recipients[$result] = new ezcMailHeadersHolder();
return $result;
} | [
"public",
"function",
"createRecipient",
"(",
")",
"{",
"$",
"result",
"=",
"count",
"(",
"$",
"this",
"->",
"recipients",
")",
";",
"$",
"this",
"->",
"recipients",
"[",
"$",
"result",
"]",
"=",
"new",
"ezcMailHeadersHolder",
"(",
")",
";",
"return",
... | Adds a new recipient to this delivery-status message and returns the index
of the last added recipient.
@return int | [
"Adds",
"a",
"new",
"recipient",
"to",
"this",
"delivery",
"-",
"status",
"message",
"and",
"returns",
"the",
"index",
"of",
"the",
"last",
"added",
"recipient",
"."
] | b0afc661105f0a2f65d49abac13956cc93c5188d | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/Mail/src/parts/delivery_status.php#L171-L176 |
22,609 | phapi/cache-nullcache | src/Phapi/Di/Validator/Cache.php | Cache.validate | public function validate($cache)
{
$original = $cache;
// Make sure the cache is configured using a closure
if (is_callable($cache)) {
$failed = false;
try {
$cache = $cache($this->container);
} catch (\Exception $e) {
$fai... | php | public function validate($cache)
{
$original = $cache;
// Make sure the cache is configured using a closure
if (is_callable($cache)) {
$failed = false;
try {
$cache = $cache($this->container);
} catch (\Exception $e) {
$fai... | [
"public",
"function",
"validate",
"(",
"$",
"cache",
")",
"{",
"$",
"original",
"=",
"$",
"cache",
";",
"// Make sure the cache is configured using a closure",
"if",
"(",
"is_callable",
"(",
"$",
"cache",
")",
")",
"{",
"$",
"failed",
"=",
"false",
";",
"try... | Validate a cache to ensure it implements the Cache Contract and that
we are able to connect to the cache backend.
If we are unable to connect to the cache backend an Exception should be
thrown. That Exception will be handled by the validator.
A working cache is NOT a requirement for the application to run so it's
imp... | [
"Validate",
"a",
"cache",
"to",
"ensure",
"it",
"implements",
"the",
"Cache",
"Contract",
"and",
"that",
"we",
"are",
"able",
"to",
"connect",
"to",
"the",
"cache",
"backend",
"."
] | 89e1c16f2d50b77cd112c27627d6733de32fb5c3 | https://github.com/phapi/cache-nullcache/blob/89e1c16f2d50b77cd112c27627d6733de32fb5c3/src/Phapi/Di/Validator/Cache.php#L49-L82 |
22,610 | old-town/workflow-designer-server | src/View/WorkflowDescriptorApiStrategy.php | WorkflowDescriptorApiStrategy.injectResponse | public function injectResponse(ViewEvent $e)
{
$renderer = $e->getRenderer();
if ($renderer !== $this->renderer) {
return;
}
$result = $e->getResult();
/** @var HttpResponse $response */
$response = $e->getResponse();
$response->setContent($re... | php | public function injectResponse(ViewEvent $e)
{
$renderer = $e->getRenderer();
if ($renderer !== $this->renderer) {
return;
}
$result = $e->getResult();
/** @var HttpResponse $response */
$response = $e->getResponse();
$response->setContent($re... | [
"public",
"function",
"injectResponse",
"(",
"ViewEvent",
"$",
"e",
")",
"{",
"$",
"renderer",
"=",
"$",
"e",
"->",
"getRenderer",
"(",
")",
";",
"if",
"(",
"$",
"renderer",
"!==",
"$",
"this",
"->",
"renderer",
")",
"{",
"return",
";",
"}",
"$",
"... | Inject the response with the feed payload and appropriate Content-Type header
@param ViewEvent $e
@return void
@throws \Zend\Http\Exception\InvalidArgumentException | [
"Inject",
"the",
"response",
"with",
"the",
"feed",
"payload",
"and",
"appropriate",
"Content",
"-",
"Type",
"header"
] | 6389c5a515861cc8e0b769f1ca7be12c6b78c611 | https://github.com/old-town/workflow-designer-server/blob/6389c5a515861cc8e0b769f1ca7be12c6b78c611/src/View/WorkflowDescriptorApiStrategy.php#L73-L89 |
22,611 | Daursu/xero | src/Daursu/Xero/models/Invoice.php | Invoice.getPdf | public function getPdf($id = '')
{
$id = $id ? : $this->attributes[$this->primary_column];
return $this->request('GET', sprintf('%s/%s', $this->getUrl(), $id), array(), "", "pdf");
} | php | public function getPdf($id = '')
{
$id = $id ? : $this->attributes[$this->primary_column];
return $this->request('GET', sprintf('%s/%s', $this->getUrl(), $id), array(), "", "pdf");
} | [
"public",
"function",
"getPdf",
"(",
"$",
"id",
"=",
"''",
")",
"{",
"$",
"id",
"=",
"$",
"id",
"?",
":",
"$",
"this",
"->",
"attributes",
"[",
"$",
"this",
"->",
"primary_column",
"]",
";",
"return",
"$",
"this",
"->",
"request",
"(",
"'GET'",
"... | Retrieves a PDF file of an invoice
@return mixed | [
"Retrieves",
"a",
"PDF",
"file",
"of",
"an",
"invoice"
] | f6ac2b0cd3123f9667fd07927bee6725d34df4a6 | https://github.com/Daursu/xero/blob/f6ac2b0cd3123f9667fd07927bee6725d34df4a6/src/Daursu/Xero/models/Invoice.php#L17-L21 |
22,612 | ekuiter/feature-php | FeaturePhp/Aspect/AspectKernel.php | AspectKernel.generateFiles | public function generateFiles($class, $target) {
$files = array();
$includes = "";
$registers = "";
foreach ($this->aspects as $aspect) {
$files[] = $aspect->getStoredFile();
$includes .= "require_once __DIR__ . '/" . str_replace("'", "\'", $aspect->getRe... | php | public function generateFiles($class, $target) {
$files = array();
$includes = "";
$registers = "";
foreach ($this->aspects as $aspect) {
$files[] = $aspect->getStoredFile();
$includes .= "require_once __DIR__ . '/" . str_replace("'", "\'", $aspect->getRe... | [
"public",
"function",
"generateFiles",
"(",
"$",
"class",
",",
"$",
"target",
")",
"{",
"$",
"files",
"=",
"array",
"(",
")",
";",
"$",
"includes",
"=",
"\"\"",
";",
"$",
"registers",
"=",
"\"\"",
";",
"foreach",
"(",
"$",
"this",
"->",
"aspects",
... | Generates the aspect kernel's files.
This includes all aspect files and the aspect kernel itself.
@param string $class
@param string $target | [
"Generates",
"the",
"aspect",
"kernel",
"s",
"files",
".",
"This",
"includes",
"all",
"aspect",
"files",
"and",
"the",
"aspect",
"kernel",
"itself",
"."
] | daf4a59098802fedcfd1f1a1d07847fcf2fea7bf | https://github.com/ekuiter/feature-php/blob/daf4a59098802fedcfd1f1a1d07847fcf2fea7bf/FeaturePhp/Aspect/AspectKernel.php#L44-L69 |
22,613 | NuclearCMS/Hierarchy | src/Builders/ModelBuilder.php | ModelBuilder.build | public function build($name, Collection $fields = null)
{
$path = $this->getClassFilePath($name);
$tableName = source_table_name($name);
$contents = view('_hierarchy::entities.model', [
'tableName' => $tableName,
'name' => $this->getClassName($name... | php | public function build($name, Collection $fields = null)
{
$path = $this->getClassFilePath($name);
$tableName = source_table_name($name);
$contents = view('_hierarchy::entities.model', [
'tableName' => $tableName,
'name' => $this->getClassName($name... | [
"public",
"function",
"build",
"(",
"$",
"name",
",",
"Collection",
"$",
"fields",
"=",
"null",
")",
"{",
"$",
"path",
"=",
"$",
"this",
"->",
"getClassFilePath",
"(",
"$",
"name",
")",
";",
"$",
"tableName",
"=",
"source_table_name",
"(",
"$",
"name",... | Builds a source model
@param string $name
@param Collection $fields | [
"Builds",
"a",
"source",
"model"
] | 535171c5e2db72265313fd2110aec8456e46f459 | https://github.com/NuclearCMS/Hierarchy/blob/535171c5e2db72265313fd2110aec8456e46f459/src/Builders/ModelBuilder.php#L20-L34 |
22,614 | NuclearCMS/Hierarchy | src/Builders/ModelBuilder.php | ModelBuilder.makeSearchableFields | protected function makeSearchableFields(Collection $fields = null, $tableName)
{
if (is_null($fields))
{
return '';
}
$searchables = [];
foreach ($fields as $field)
{
if (intval($field->search_priority) > 0)
{
$sea... | php | protected function makeSearchableFields(Collection $fields = null, $tableName)
{
if (is_null($fields))
{
return '';
}
$searchables = [];
foreach ($fields as $field)
{
if (intval($field->search_priority) > 0)
{
$sea... | [
"protected",
"function",
"makeSearchableFields",
"(",
"Collection",
"$",
"fields",
"=",
"null",
",",
"$",
"tableName",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"fields",
")",
")",
"{",
"return",
"''",
";",
"}",
"$",
"searchables",
"=",
"[",
"]",
";",
... | Makes searchable fields
@param Collection $fields
@param string $tableName
@return string | [
"Makes",
"searchable",
"fields"
] | 535171c5e2db72265313fd2110aec8456e46f459 | https://github.com/NuclearCMS/Hierarchy/blob/535171c5e2db72265313fd2110aec8456e46f459/src/Builders/ModelBuilder.php#L61-L79 |
22,615 | NuclearCMS/Hierarchy | src/Builders/ModelBuilder.php | ModelBuilder.makeMutatableFields | protected function makeMutatableFields(Collection $fields = null)
{
if (is_null($fields))
{
return '';
}
$mutatables = [];
foreach ($fields as $field)
{
if (in_array($field->type, ['document', 'gallery', 'markdown', 'node', 'node_collection']... | php | protected function makeMutatableFields(Collection $fields = null)
{
if (is_null($fields))
{
return '';
}
$mutatables = [];
foreach ($fields as $field)
{
if (in_array($field->type, ['document', 'gallery', 'markdown', 'node', 'node_collection']... | [
"protected",
"function",
"makeMutatableFields",
"(",
"Collection",
"$",
"fields",
"=",
"null",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"fields",
")",
")",
"{",
"return",
"''",
";",
"}",
"$",
"mutatables",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"f... | Makes mutatable fields
@param Collection $fields
@return string | [
"Makes",
"mutatable",
"fields"
] | 535171c5e2db72265313fd2110aec8456e46f459 | https://github.com/NuclearCMS/Hierarchy/blob/535171c5e2db72265313fd2110aec8456e46f459/src/Builders/ModelBuilder.php#L87-L105 |
22,616 | kusanagi/katana-sdk-php7 | src/Component/Component.php | Component.run | public function run(): bool
{
if ($this->startup) {
$this->logger->debug('Calling startup callback');
call_user_func($this->startup, $this);
}
$actions = implode(', ', array_keys($this->callbacks));
$this->logger->info("Component running with callbacks for $a... | php | public function run(): bool
{
if ($this->startup) {
$this->logger->debug('Calling startup callback');
call_user_func($this->startup, $this);
}
$actions = implode(', ', array_keys($this->callbacks));
$this->logger->info("Component running with callbacks for $a... | [
"public",
"function",
"run",
"(",
")",
":",
"bool",
"{",
"if",
"(",
"$",
"this",
"->",
"startup",
")",
"{",
"$",
"this",
"->",
"logger",
"->",
"debug",
"(",
"'Calling startup callback'",
")",
";",
"call_user_func",
"(",
"$",
"this",
"->",
"startup",
",... | Run the SDK.
@return bool | [
"Run",
"the",
"SDK",
"."
] | 91e7860a1852c3ce79a7034f8c36f41840e69e1f | https://github.com/kusanagi/katana-sdk-php7/blob/91e7860a1852c3ce79a7034f8c36f41840e69e1f/src/Component/Component.php#L131-L153 |
22,617 | frdl/webfan | .ApplicationComposer/lib/frdl/xGlobal/fexe.php | fexe.getFileData | public function getFileData($file = null, $offset = null){
if(null === $file)$file = &$this->file;
if(null === $offset)$offset = $this->file_offset;
$this->IO = fopen($file, 'r');
fseek($this->IO, $offset);
try{
$this->raw = stream_get_contents($this->IO);
}catch(\Exception $e){
$th... | php | public function getFileData($file = null, $offset = null){
if(null === $file)$file = &$this->file;
if(null === $offset)$offset = $this->file_offset;
$this->IO = fopen($file, 'r');
fseek($this->IO, $offset);
try{
$this->raw = stream_get_contents($this->IO);
}catch(\Exception $e){
$th... | [
"public",
"function",
"getFileData",
"(",
"$",
"file",
"=",
"null",
",",
"$",
"offset",
"=",
"null",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"file",
")",
"$",
"file",
"=",
"&",
"$",
"this",
"->",
"file",
";",
"if",
"(",
"null",
"===",
"$",
"of... | read file from offset
@param undefined $file __FILE__
@param undefined $offset __COMPILER_HALT_OFFSET__
@return string | [
"read",
"file",
"from",
"offset"
] | 84d270377685224e891cd9d571b103b36f05b845 | https://github.com/frdl/webfan/blob/84d270377685224e891cd9d571b103b36f05b845/.ApplicationComposer/lib/frdl/xGlobal/fexe.php#L651-L664 |
22,618 | gn36/phpbb-oo-posting-api | functions_post_oo.php | post.get | static function get($post_id)
{
global $db;
//$sql = "SELECT p.*, t.topic_first_post_id, t.topic_last_post_id
// FROM " . POSTS_TABLE . " p, " . TOPICS_TABLE . " t
// WHERE p.post_id=" . intval($this->post_id) . " AND t.topic_id = p.topic_id";
$sql = "SELECT * FROM " . POSTS_TABLE . " WHERE post_id=" . int... | php | static function get($post_id)
{
global $db;
//$sql = "SELECT p.*, t.topic_first_post_id, t.topic_last_post_id
// FROM " . POSTS_TABLE . " p, " . TOPICS_TABLE . " t
// WHERE p.post_id=" . intval($this->post_id) . " AND t.topic_id = p.topic_id";
$sql = "SELECT * FROM " . POSTS_TABLE . " WHERE post_id=" . int... | [
"static",
"function",
"get",
"(",
"$",
"post_id",
")",
"{",
"global",
"$",
"db",
";",
"//$sql = \"SELECT p.*, t.topic_first_post_id, t.topic_last_post_id",
"//\t\tFROM \" . POSTS_TABLE . \" p, \" . TOPICS_TABLE . \" t",
"//\t\tWHERE p.post_id=\" . intval($this->post_id) . \" AND t.topic_... | static method, loads the post with a given post_id from database.
returns false if the post does not exist | [
"static",
"method",
"loads",
"the",
"post",
"with",
"a",
"given",
"post_id",
"from",
"database",
".",
"returns",
"false",
"if",
"the",
"post",
"does",
"not",
"exist"
] | d0e19482a9e1e93a435c1758a66df9324145381a | https://github.com/gn36/phpbb-oo-posting-api/blob/d0e19482a9e1e93a435c1758a66df9324145381a/functions_post_oo.php#L776-L795 |
22,619 | gn36/phpbb-oo-posting-api | functions_post_oo.php | post.get_topic | function get_topic($all_posts = false)
{
if(!$this->_topic)
{
if($this->post_id)
{
//existing post, load existing topic
$this->_topic = topic::get($this->topic_id, $all_posts);
//insert $this into topic->posts array
if($all_posts)
{
//this post was also loaded from database, replace... | php | function get_topic($all_posts = false)
{
if(!$this->_topic)
{
if($this->post_id)
{
//existing post, load existing topic
$this->_topic = topic::get($this->topic_id, $all_posts);
//insert $this into topic->posts array
if($all_posts)
{
//this post was also loaded from database, replace... | [
"function",
"get_topic",
"(",
"$",
"all_posts",
"=",
"false",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"_topic",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"post_id",
")",
"{",
"//existing post, load existing topic",
"$",
"this",
"->",
"_topic",
"=",
... | loads and returns the topic for this post
@param all_posts whether to load all other posts of the topic into topic->posts | [
"loads",
"and",
"returns",
"the",
"topic",
"for",
"this",
"post"
] | d0e19482a9e1e93a435c1758a66df9324145381a | https://github.com/gn36/phpbb-oo-posting-api/blob/d0e19482a9e1e93a435c1758a66df9324145381a/functions_post_oo.php#L865-L901 |
22,620 | gn36/phpbb-oo-posting-api | functions_post_oo.php | syncer.add | function add($type, $id, $field, $amount = 1)
{
$this->init($type, $id);
if(!isset($this->data[$type][$id]['add'][$field]))
{
$this->data[$type][$id]['add'][$field] = 0;
}
$this->data[$type][$id]['add'][$field] += $amount;
} | php | function add($type, $id, $field, $amount = 1)
{
$this->init($type, $id);
if(!isset($this->data[$type][$id]['add'][$field]))
{
$this->data[$type][$id]['add'][$field] = 0;
}
$this->data[$type][$id]['add'][$field] += $amount;
} | [
"function",
"add",
"(",
"$",
"type",
",",
"$",
"id",
",",
"$",
"field",
",",
"$",
"amount",
"=",
"1",
")",
"{",
"$",
"this",
"->",
"init",
"(",
"$",
"type",
",",
"$",
"id",
")",
";",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"data",
... | increments or decrements a field.
@param $type which table (topic, user, forum or post)
@param $id topic_id, user_id etc.
@param $field field name (e.g. topic_replies)
@param $amount how much to add/subtract (default 1)
example: $sync->add('topic', 123, 'topic_replies', 1)
-> UPDATE phpbb_topics SET topic_replies = top... | [
"increments",
"or",
"decrements",
"a",
"field",
"."
] | d0e19482a9e1e93a435c1758a66df9324145381a | https://github.com/gn36/phpbb-oo-posting-api/blob/d0e19482a9e1e93a435c1758a66df9324145381a/functions_post_oo.php#L1866-L1874 |
22,621 | bfitech/zapstore | src/SQL.php | SQL.open_pdo_connection | private function open_pdo_connection() {
try {
$this->connection = in_array(
$this->dbtype, ['sqlite3', 'pgsql'])
? new \PDO($this->connection_string)
: new \PDO(
$this->connection_string,
$this->dbuser, $this->dbpass);
self::$logger->debug(sprintf(
"SQL: connection opened: '%s'.",
... | php | private function open_pdo_connection() {
try {
$this->connection = in_array(
$this->dbtype, ['sqlite3', 'pgsql'])
? new \PDO($this->connection_string)
: new \PDO(
$this->connection_string,
$this->dbuser, $this->dbpass);
self::$logger->debug(sprintf(
"SQL: connection opened: '%s'.",
... | [
"private",
"function",
"open_pdo_connection",
"(",
")",
"{",
"try",
"{",
"$",
"this",
"->",
"connection",
"=",
"in_array",
"(",
"$",
"this",
"->",
"dbtype",
",",
"[",
"'sqlite3'",
",",
"'pgsql'",
"]",
")",
"?",
"new",
"\\",
"PDO",
"(",
"$",
"this",
"... | Open PDO connection. | [
"Open",
"PDO",
"connection",
"."
] | 0353a7a3f81cbc4e25fc1646fa2f98cb490b85d0 | https://github.com/bfitech/zapstore/blob/0353a7a3f81cbc4e25fc1646fa2f98cb490b85d0/src/SQL.php#L126-L151 |
22,622 | bfitech/zapstore | src/SQL.php | SQL.format_connection_string | private function format_connection_string() {
if (!in_array($this->dbtype, ['sqlite3', 'mysql', 'pgsql'])) {
$this->verified_params = null;
self::$logger->error(sprintf(
"SQL: database not supported: '%s'.",
$this->dbtype));
throw new SQLError(SQLError::DBTYPE_ERROR,
$this->dbtype . " not support... | php | private function format_connection_string() {
if (!in_array($this->dbtype, ['sqlite3', 'mysql', 'pgsql'])) {
$this->verified_params = null;
self::$logger->error(sprintf(
"SQL: database not supported: '%s'.",
$this->dbtype));
throw new SQLError(SQLError::DBTYPE_ERROR,
$this->dbtype . " not support... | [
"private",
"function",
"format_connection_string",
"(",
")",
"{",
"if",
"(",
"!",
"in_array",
"(",
"$",
"this",
"->",
"dbtype",
",",
"[",
"'sqlite3'",
",",
"'mysql'",
",",
"'pgsql'",
"]",
")",
")",
"{",
"$",
"this",
"->",
"verified_params",
"=",
"null",
... | Verify and format connection string. | [
"Verify",
"and",
"format",
"connection",
"string",
"."
] | 0353a7a3f81cbc4e25fc1646fa2f98cb490b85d0 | https://github.com/bfitech/zapstore/blob/0353a7a3f81cbc4e25fc1646fa2f98cb490b85d0/src/SQL.php#L156-L193 |
22,623 | bfitech/zapstore | src/SQL.php | SQL.time | final public function time() {
if ($this->dbtype == 'pgsql')
return $this->query(
"SELECT EXTRACT('epoch' from CURRENT_TIMESTAMP) AS now"
)['now'];
if ($this->dbtype == 'mysql')
return $this->query(
"SELECT UNIX_TIMESTAMP() AS now")['now'];
return $this->query(
"SELECT strftime('%s', CURRENT_T... | php | final public function time() {
if ($this->dbtype == 'pgsql')
return $this->query(
"SELECT EXTRACT('epoch' from CURRENT_TIMESTAMP) AS now"
)['now'];
if ($this->dbtype == 'mysql')
return $this->query(
"SELECT UNIX_TIMESTAMP() AS now")['now'];
return $this->query(
"SELECT strftime('%s', CURRENT_T... | [
"final",
"public",
"function",
"time",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"dbtype",
"==",
"'pgsql'",
")",
"return",
"$",
"this",
"->",
"query",
"(",
"\"SELECT EXTRACT('epoch' from CURRENT_TIMESTAMP) AS now\"",
")",
"[",
"'now'",
"]",
";",
"if",
"("... | Get Unix timestamp from database server.
@return int Unix epoch. | [
"Get",
"Unix",
"timestamp",
"from",
"database",
"server",
"."
] | 0353a7a3f81cbc4e25fc1646fa2f98cb490b85d0 | https://github.com/bfitech/zapstore/blob/0353a7a3f81cbc4e25fc1646fa2f98cb490b85d0/src/SQL.php#L209-L220 |
22,624 | bfitech/zapstore | src/SQL.php | SQL.stmt_fragment_datetime | private function stmt_fragment_datetime($delta) {
$sign = $delta >= 0 ? '+' : '-';
$delta = abs($delta);
$date = '';
switch ($this->dbtype) {
case 'sqlite3':
$date = "(datetime('now', '%s%s second'))";
break;
case 'pgsql':
$date = (
"(" .
"now() at time zone 'utc' %s " .
"inte... | php | private function stmt_fragment_datetime($delta) {
$sign = $delta >= 0 ? '+' : '-';
$delta = abs($delta);
$date = '';
switch ($this->dbtype) {
case 'sqlite3':
$date = "(datetime('now', '%s%s second'))";
break;
case 'pgsql':
$date = (
"(" .
"now() at time zone 'utc' %s " .
"inte... | [
"private",
"function",
"stmt_fragment_datetime",
"(",
"$",
"delta",
")",
"{",
"$",
"sign",
"=",
"$",
"delta",
">=",
"0",
"?",
"'+'",
":",
"'-'",
";",
"$",
"delta",
"=",
"abs",
"(",
"$",
"delta",
")",
";",
"$",
"date",
"=",
"''",
";",
"switch",
"(... | SQL datetime fragment. | [
"SQL",
"datetime",
"fragment",
"."
] | 0353a7a3f81cbc4e25fc1646fa2f98cb490b85d0 | https://github.com/bfitech/zapstore/blob/0353a7a3f81cbc4e25fc1646fa2f98cb490b85d0/src/SQL.php#L225-L250 |
22,625 | bfitech/zapstore | src/SQL.php | SQL.stmt_fragment | public function stmt_fragment($part, $args=[]) {
$type = $this->dbtype;
if ($part == 'engine') {
if ($type == 'mysql')
# we only intent to support FOREIGN KEY-capable engines
return "ENGINE=InnoDB";
return '';
}
if ($part == "index") {
if ($type == 'pgsql')
return 'SERIAL PRIMARY KEY';
i... | php | public function stmt_fragment($part, $args=[]) {
$type = $this->dbtype;
if ($part == 'engine') {
if ($type == 'mysql')
# we only intent to support FOREIGN KEY-capable engines
return "ENGINE=InnoDB";
return '';
}
if ($part == "index") {
if ($type == 'pgsql')
return 'SERIAL PRIMARY KEY';
i... | [
"public",
"function",
"stmt_fragment",
"(",
"$",
"part",
",",
"$",
"args",
"=",
"[",
"]",
")",
"{",
"$",
"type",
"=",
"$",
"this",
"->",
"dbtype",
";",
"if",
"(",
"$",
"part",
"==",
"'engine'",
")",
"{",
"if",
"(",
"$",
"type",
"==",
"'mysql'",
... | SQL statement fragment.
@param string $part A part sensitive to the database being used,
one of these: 'engine', 'index', 'datetime'.
@param array $args Dict of parameters for $part, for 'datetime'
only. | [
"SQL",
"statement",
"fragment",
"."
] | 0353a7a3f81cbc4e25fc1646fa2f98cb490b85d0 | https://github.com/bfitech/zapstore/blob/0353a7a3f81cbc4e25fc1646fa2f98cb490b85d0/src/SQL.php#L260-L282 |
22,626 | bfitech/zapstore | src/SQL.php | SQL.table_exists | public function table_exists($table) {
# we can't use placeholder for table name
if (!preg_match('!^[0-9a-z_]+$!i', $table))
return false;
self::$logger->deactivate();
try {
$this->query(sprintf("SELECT 1 FROM %s LIMIT 1", $table));
self::$logger->activate();
return true;
} catch(SQLError $e) {
... | php | public function table_exists($table) {
# we can't use placeholder for table name
if (!preg_match('!^[0-9a-z_]+$!i', $table))
return false;
self::$logger->deactivate();
try {
$this->query(sprintf("SELECT 1 FROM %s LIMIT 1", $table));
self::$logger->activate();
return true;
} catch(SQLError $e) {
... | [
"public",
"function",
"table_exists",
"(",
"$",
"table",
")",
"{",
"# we can't use placeholder for table name",
"if",
"(",
"!",
"preg_match",
"(",
"'!^[0-9a-z_]+$!i'",
",",
"$",
"table",
")",
")",
"return",
"false",
";",
"self",
"::",
"$",
"logger",
"->",
"dea... | Check if a table or view exists.
@param string $table Table or view name.
@return bool True if table or view does exist.
@fixme This will always re-activate logging at the end,
regardless the logging state. The fix must be in Logger
class itself where logging state must be exposed. | [
"Check",
"if",
"a",
"table",
"or",
"view",
"exists",
"."
] | 0353a7a3f81cbc4e25fc1646fa2f98cb490b85d0 | https://github.com/bfitech/zapstore/blob/0353a7a3f81cbc4e25fc1646fa2f98cb490b85d0/src/SQL.php#L293-L306 |
22,627 | bfitech/zapstore | src/SQL.php | SQL.prepare_statement | private function prepare_statement($stmt, $args=[]) {
if (!$this->connection) {
self::$logger->error(sprintf(
"SQL: connection failed: '%s'.",
json_encode($this->verified_params)));
throw new SQLError(SQLError::CONNECTION_ERROR,
$this->dbtype . " connection error.");
}
$conn = $this->connection... | php | private function prepare_statement($stmt, $args=[]) {
if (!$this->connection) {
self::$logger->error(sprintf(
"SQL: connection failed: '%s'.",
json_encode($this->verified_params)));
throw new SQLError(SQLError::CONNECTION_ERROR,
$this->dbtype . " connection error.");
}
$conn = $this->connection... | [
"private",
"function",
"prepare_statement",
"(",
"$",
"stmt",
",",
"$",
"args",
"=",
"[",
"]",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"connection",
")",
"{",
"self",
"::",
"$",
"logger",
"->",
"error",
"(",
"sprintf",
"(",
"\"SQL: connection fail... | Prepare and execute statement. | [
"Prepare",
"and",
"execute",
"statement",
"."
] | 0353a7a3f81cbc4e25fc1646fa2f98cb490b85d0 | https://github.com/bfitech/zapstore/blob/0353a7a3f81cbc4e25fc1646fa2f98cb490b85d0/src/SQL.php#L311-L350 |
22,628 | bfitech/zapstore | src/SQL.php | SQL.query_raw | final public function query_raw($stmt, $args=[]) {
$pstmt = $this->prepare_statement($stmt, $args);
self::$logger->info(sprintf(
"SQL: query raw ok: %s.", $stmt));
return $pstmt;
} | php | final public function query_raw($stmt, $args=[]) {
$pstmt = $this->prepare_statement($stmt, $args);
self::$logger->info(sprintf(
"SQL: query raw ok: %s.", $stmt));
return $pstmt;
} | [
"final",
"public",
"function",
"query_raw",
"(",
"$",
"stmt",
",",
"$",
"args",
"=",
"[",
"]",
")",
"{",
"$",
"pstmt",
"=",
"$",
"this",
"->",
"prepare_statement",
"(",
"$",
"stmt",
",",
"$",
"args",
")",
";",
"self",
"::",
"$",
"logger",
"->",
"... | Execute raw query.
This will execute arbitray single SQL queries. Do not execute
multiple queries at once to avoid undocumented side effects.
To execute successive raw queries safely, disable autocommit as
follows:
@code
$connection = new SQL(...);
try {
$connection = $this->get_connection();
$connection->beginTransa... | [
"Execute",
"raw",
"query",
"."
] | 0353a7a3f81cbc4e25fc1646fa2f98cb490b85d0 | https://github.com/bfitech/zapstore/blob/0353a7a3f81cbc4e25fc1646fa2f98cb490b85d0/src/SQL.php#L402-L407 |
22,629 | bfitech/zapstore | src/SQL.php | SQL.insert | final public function insert($table, $args=[], $pk=null) {
$keys = $vals = [];
$keys = array_keys($args);
$vals = array_fill(0, count($args), '?');
$columns = implode(',', $keys);
$placeholders = implode(',', $vals);
$stmt = "INSERT INTO $table ($columns) VALUES ($placeholders)";
if ($this->dbtype == '... | php | final public function insert($table, $args=[], $pk=null) {
$keys = $vals = [];
$keys = array_keys($args);
$vals = array_fill(0, count($args), '?');
$columns = implode(',', $keys);
$placeholders = implode(',', $vals);
$stmt = "INSERT INTO $table ($columns) VALUES ($placeholders)";
if ($this->dbtype == '... | [
"final",
"public",
"function",
"insert",
"(",
"$",
"table",
",",
"$",
"args",
"=",
"[",
"]",
",",
"$",
"pk",
"=",
"null",
")",
"{",
"$",
"keys",
"=",
"$",
"vals",
"=",
"[",
"]",
";",
"$",
"keys",
"=",
"array_keys",
"(",
"$",
"args",
")",
";",... | Insert statement.
@param string $table Table name.
@param array $args Dict of what to INSERT.
@param string $pk Primary key from which last insert ID should
be retrieved. This won't take any effect on databases other
than Postgres. This can take any column name, not necessarily
column with PRIMARY KEY attributes. If l... | [
"Insert",
"statement",
"."
] | 0353a7a3f81cbc4e25fc1646fa2f98cb490b85d0 | https://github.com/bfitech/zapstore/blob/0353a7a3f81cbc4e25fc1646fa2f98cb490b85d0/src/SQL.php#L423-L449 |
22,630 | Danzabar/config-builder | src/Collections/Collection.php | Collection.registerStandardObjects | public function registerStandardObjects()
{
$this->extensionMap = new ExtensionMap();
$this->extensions = $this->extensionMap->getRegisteredExtensionNames();
$this->finder->files();
} | php | public function registerStandardObjects()
{
$this->extensionMap = new ExtensionMap();
$this->extensions = $this->extensionMap->getRegisteredExtensionNames();
$this->finder->files();
} | [
"public",
"function",
"registerStandardObjects",
"(",
")",
"{",
"$",
"this",
"->",
"extensionMap",
"=",
"new",
"ExtensionMap",
"(",
")",
";",
"$",
"this",
"->",
"extensions",
"=",
"$",
"this",
"->",
"extensionMap",
"->",
"getRegisteredExtensionNames",
"(",
")"... | Registers the extension map and sets the finder to look for files
@return void
@author Dan Cox | [
"Registers",
"the",
"extension",
"map",
"and",
"sets",
"the",
"finder",
"to",
"look",
"for",
"files"
] | 3b237be578172c32498bbcdfb360e69a6243739d | https://github.com/Danzabar/config-builder/blob/3b237be578172c32498bbcdfb360e69a6243739d/src/Collections/Collection.php#L95-L100 |
22,631 | Danzabar/config-builder | src/Collections/Collection.php | Collection.filterByExtension | public function filterByExtension()
{
// The call back that filters files through the finder
$filter = function (\SplFileInfo $file) {
return in_array($file->getExtension(), $this->extensions);
};
$this->filter($filter);
} | php | public function filterByExtension()
{
// The call back that filters files through the finder
$filter = function (\SplFileInfo $file) {
return in_array($file->getExtension(), $this->extensions);
};
$this->filter($filter);
} | [
"public",
"function",
"filterByExtension",
"(",
")",
"{",
"// The call back that filters files through the finder",
"$",
"filter",
"=",
"function",
"(",
"\\",
"SplFileInfo",
"$",
"file",
")",
"{",
"return",
"in_array",
"(",
"$",
"file",
"->",
"getExtension",
"(",
... | Filters file results by their extension
@return void
@author Dan Cox | [
"Filters",
"file",
"results",
"by",
"their",
"extension"
] | 3b237be578172c32498bbcdfb360e69a6243739d | https://github.com/Danzabar/config-builder/blob/3b237be578172c32498bbcdfb360e69a6243739d/src/Collections/Collection.php#L108-L117 |
22,632 | Danzabar/config-builder | src/Collections/Collection.php | Collection.fetch | public function fetch()
{
$this->filterByExtension();
$results = Array();
foreach ($this->finder as $file)
{
$config = new ConfigFile($this->fs, $this->fileInfo, $this->extracter);
$config->load($file->getRealPath());
$results[] = $config;
}
$this->finder = new Finder();
return new Collectio... | php | public function fetch()
{
$this->filterByExtension();
$results = Array();
foreach ($this->finder as $file)
{
$config = new ConfigFile($this->fs, $this->fileInfo, $this->extracter);
$config->load($file->getRealPath());
$results[] = $config;
}
$this->finder = new Finder();
return new Collectio... | [
"public",
"function",
"fetch",
"(",
")",
"{",
"$",
"this",
"->",
"filterByExtension",
"(",
")",
";",
"$",
"results",
"=",
"Array",
"(",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"finder",
"as",
"$",
"file",
")",
"{",
"$",
"config",
"=",
"new",
... | Fetches results of current instance of the finder
@return CollectionResults
@author Dan Cox | [
"Fetches",
"results",
"of",
"current",
"instance",
"of",
"the",
"finder"
] | 3b237be578172c32498bbcdfb360e69a6243739d | https://github.com/Danzabar/config-builder/blob/3b237be578172c32498bbcdfb360e69a6243739d/src/Collections/Collection.php#L192-L208 |
22,633 | Danzabar/config-builder | src/Collections/Collection.php | Collection.setDirectory | public function setDirectory($directory)
{
$this->directory = $directory;
// Set the finder to use this directory as well
$this->finder->in($directory);
return $this;
} | php | public function setDirectory($directory)
{
$this->directory = $directory;
// Set the finder to use this directory as well
$this->finder->in($directory);
return $this;
} | [
"public",
"function",
"setDirectory",
"(",
"$",
"directory",
")",
"{",
"$",
"this",
"->",
"directory",
"=",
"$",
"directory",
";",
"// Set the finder to use this directory as well",
"$",
"this",
"->",
"finder",
"->",
"in",
"(",
"$",
"directory",
")",
";",
"ret... | Sets the directory value
@param String $directory
@return Collection
@author Dan Cox | [
"Sets",
"the",
"directory",
"value"
] | 3b237be578172c32498bbcdfb360e69a6243739d | https://github.com/Danzabar/config-builder/blob/3b237be578172c32498bbcdfb360e69a6243739d/src/Collections/Collection.php#L217-L225 |
22,634 | alevilar/ristorantino-vendor | Risto/Console/Command/RistoSchemaShell.php | RistoSchemaShell._update | protected function _update(&$Schema, $table = null) {
$db = ConnectionManager::getDataSource($this->Schema->connection);
$this->out(__d('cake_console', 'Comparing Database to Schema...'));
$options = array();
$this->params['force'] = false;
if (isset($this->params['force'])) {
$options['models'] = false;
... | php | protected function _update(&$Schema, $table = null) {
$db = ConnectionManager::getDataSource($this->Schema->connection);
$this->out(__d('cake_console', 'Comparing Database to Schema...'));
$options = array();
$this->params['force'] = false;
if (isset($this->params['force'])) {
$options['models'] = false;
... | [
"protected",
"function",
"_update",
"(",
"&",
"$",
"Schema",
",",
"$",
"table",
"=",
"null",
")",
"{",
"$",
"db",
"=",
"ConnectionManager",
"::",
"getDataSource",
"(",
"$",
"this",
"->",
"Schema",
"->",
"connection",
")",
";",
"$",
"this",
"->",
"out",... | Update database with Schema object
Should be called via the run method
@param CakeSchema &$Schema The schema instance
@param string $table The table name.
@return void | [
"Update",
"database",
"with",
"Schema",
"object",
"Should",
"be",
"called",
"via",
"the",
"run",
"method"
] | 6b91a1e20cc0ba09a1968d77e3de6512cfa2d966 | https://github.com/alevilar/ristorantino-vendor/blob/6b91a1e20cc0ba09a1968d77e3de6512cfa2d966/Risto/Console/Command/RistoSchemaShell.php#L26-L74 |
22,635 | mithun12000/yii2-process | src/components/ProcessControlTrait.php | ProcessControlTrait.createPidfile | public function createPidfile($appName, $path='/var/run'){
if(!$this->control){
$this->createControl();
}
return new Pidfile($this->control, strtolower($appName), $path);
} | php | public function createPidfile($appName, $path='/var/run'){
if(!$this->control){
$this->createControl();
}
return new Pidfile($this->control, strtolower($appName), $path);
} | [
"public",
"function",
"createPidfile",
"(",
"$",
"appName",
",",
"$",
"path",
"=",
"'/var/run'",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"control",
")",
"{",
"$",
"this",
"->",
"createControl",
"(",
")",
";",
"}",
"return",
"new",
"Pidfile",
"("... | Create Pid file for process
@param string $appName
@param string $path | [
"Create",
"Pid",
"file",
"for",
"process"
] | d4c660010381fee76159eb4c92d4b75e38442d3c | https://github.com/mithun12000/yii2-process/blob/d4c660010381fee76159eb4c92d4b75e38442d3c/src/components/ProcessControlTrait.php#L47-L52 |
22,636 | mothership-ec/composer | src/Composer/DependencyResolver/DefaultPolicy.php | DefaultPolicy.replaces | protected function replaces(PackageInterface $source, PackageInterface $target)
{
foreach ($source->getReplaces() as $link) {
if ($link->getTarget() === $target->getName()
// && (null === $link->getConstraint() ||
// $link->getConstraint()->matches(new VersionConstr... | php | protected function replaces(PackageInterface $source, PackageInterface $target)
{
foreach ($source->getReplaces() as $link) {
if ($link->getTarget() === $target->getName()
// && (null === $link->getConstraint() ||
// $link->getConstraint()->matches(new VersionConstr... | [
"protected",
"function",
"replaces",
"(",
"PackageInterface",
"$",
"source",
",",
"PackageInterface",
"$",
"target",
")",
"{",
"foreach",
"(",
"$",
"source",
"->",
"getReplaces",
"(",
")",
"as",
"$",
"link",
")",
"{",
"if",
"(",
"$",
"link",
"->",
"getTa... | Checks if source replaces a package with the same name as target.
Replace constraints are ignored. This method should only be used for
prioritisation, not for actual constraint verification.
@param PackageInterface $source
@param PackageInterface $target
@return bool | [
"Checks",
"if",
"source",
"replaces",
"a",
"package",
"with",
"the",
"same",
"name",
"as",
"target",
"."
] | fa6ad031a939d8d33b211e428fdbdd28cfce238c | https://github.com/mothership-ec/composer/blob/fa6ad031a939d8d33b211e428fdbdd28cfce238c/src/Composer/DependencyResolver/DefaultPolicy.php#L192-L204 |
22,637 | inhere/php-librarys | src/Traits/StdObjectTrait.php | StdObjectTrait.className | final public static function className(string $fullName = null): string
{
$fullName = $fullName ?: self::fullName();
$fullName = str_replace('\\', '/', $fullName);
return basename($fullName);
} | php | final public static function className(string $fullName = null): string
{
$fullName = $fullName ?: self::fullName();
$fullName = str_replace('\\', '/', $fullName);
return basename($fullName);
} | [
"final",
"public",
"static",
"function",
"className",
"(",
"string",
"$",
"fullName",
"=",
"null",
")",
":",
"string",
"{",
"$",
"fullName",
"=",
"$",
"fullName",
"?",
":",
"self",
"::",
"fullName",
"(",
")",
";",
"$",
"fullName",
"=",
"str_replace",
"... | get called class name
@param null|string $fullName
@return string | [
"get",
"called",
"class",
"name"
] | e6ca598685469794f310e3ab0e2bc19519cd0ae6 | https://github.com/inhere/php-librarys/blob/e6ca598685469794f310e3ab0e2bc19519cd0ae6/src/Traits/StdObjectTrait.php#L47-L53 |
22,638 | colorium/web | src/Colorium/Web/Logic.php | Logic.resolve | public static function resolve($name, $callable)
{
$invokable = Resolver::of($callable);
$annotations = $invokable->annotations();
$annotations['method'] = $invokable;
return new Logic($name, $annotations);
} | php | public static function resolve($name, $callable)
{
$invokable = Resolver::of($callable);
$annotations = $invokable->annotations();
$annotations['method'] = $invokable;
return new Logic($name, $annotations);
} | [
"public",
"static",
"function",
"resolve",
"(",
"$",
"name",
",",
"$",
"callable",
")",
"{",
"$",
"invokable",
"=",
"Resolver",
"::",
"of",
"(",
"$",
"callable",
")",
";",
"$",
"annotations",
"=",
"$",
"invokable",
"->",
"annotations",
"(",
")",
";",
... | Resolve logic from callable
@param string $name
@param $callable
@return Logic | [
"Resolve",
"logic",
"from",
"callable"
] | 2a767658b8737022939b0cc4505b5f652c1683d2 | https://github.com/colorium/web/blob/2a767658b8737022939b0cc4505b5f652c1683d2/src/Colorium/Web/Logic.php#L66-L73 |
22,639 | Eresus/EresusCMS | src/core/framework/core/3rdparty/ezcomponents/Database/src/sqlabstraction/implementations/expression_oracle.php | ezcQueryExpressionOracle.bitXor | public function bitXor( $value1, $value2 )
{
$value1 = $this->getIdentifier( $value1 );
$value2 = $this->getIdentifier( $value2 );
return "( {$value1} + {$value2} - bitand( {$value1}, {$value2} ) * 2 )";
} | php | public function bitXor( $value1, $value2 )
{
$value1 = $this->getIdentifier( $value1 );
$value2 = $this->getIdentifier( $value2 );
return "( {$value1} + {$value2} - bitand( {$value1}, {$value2} ) * 2 )";
} | [
"public",
"function",
"bitXor",
"(",
"$",
"value1",
",",
"$",
"value2",
")",
"{",
"$",
"value1",
"=",
"$",
"this",
"->",
"getIdentifier",
"(",
"$",
"value1",
")",
";",
"$",
"value2",
"=",
"$",
"this",
"->",
"getIdentifier",
"(",
"$",
"value2",
")",
... | Returns the SQL that performs the bitwise XOR on two values.
@param string $value1
@param string $value2
@return string | [
"Returns",
"the",
"SQL",
"that",
"performs",
"the",
"bitwise",
"XOR",
"on",
"two",
"values",
"."
] | b0afc661105f0a2f65d49abac13956cc93c5188d | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/Database/src/sqlabstraction/implementations/expression_oracle.php#L141-L146 |
22,640 | Eresus/EresusCMS | src/core/framework/core/3rdparty/ezcomponents/Database/src/sqlabstraction/implementations/expression_oracle.php | ezcQueryExpressionOracle.unixTimestamp | public function unixTimestamp( $column )
{
$column = $this->getIdentifier( $column );
if ( $column != 'NOW()' )
{
$column = "CAST( {$column} AS TIMESTAMP )";
// // alternative
// if ( preg_match( '/[0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2}:[0-9]{2}/', $c... | php | public function unixTimestamp( $column )
{
$column = $this->getIdentifier( $column );
if ( $column != 'NOW()' )
{
$column = "CAST( {$column} AS TIMESTAMP )";
// // alternative
// if ( preg_match( '/[0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2}:[0-9]{2}/', $c... | [
"public",
"function",
"unixTimestamp",
"(",
"$",
"column",
")",
"{",
"$",
"column",
"=",
"$",
"this",
"->",
"getIdentifier",
"(",
"$",
"column",
")",
";",
"if",
"(",
"$",
"column",
"!=",
"'NOW()'",
")",
"{",
"$",
"column",
"=",
"\"CAST( {$column} AS TIME... | Returns the SQL that converts a timestamp value to a unix timestamp.
@param string $column
@return string | [
"Returns",
"the",
"SQL",
"that",
"converts",
"a",
"timestamp",
"value",
"to",
"a",
"unix",
"timestamp",
"."
] | b0afc661105f0a2f65d49abac13956cc93c5188d | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/Database/src/sqlabstraction/implementations/expression_oracle.php#L154-L170 |
22,641 | Eresus/EresusCMS | src/core/framework/core/3rdparty/ezcomponents/Database/src/sqlabstraction/implementations/expression_oracle.php | ezcQueryExpressionOracle.dateSub | public function dateSub( $column, $expr, $type )
{
$type = $this->intervalMap[$type];
$column = $this->getIdentifier( $column );
if ( $column != 'NOW()' )
{
$column = "CAST( {$column} AS TIMESTAMP )";
}
return " {$column} - INTERVAL '{$expr}' {$type} ";
... | php | public function dateSub( $column, $expr, $type )
{
$type = $this->intervalMap[$type];
$column = $this->getIdentifier( $column );
if ( $column != 'NOW()' )
{
$column = "CAST( {$column} AS TIMESTAMP )";
}
return " {$column} - INTERVAL '{$expr}' {$type} ";
... | [
"public",
"function",
"dateSub",
"(",
"$",
"column",
",",
"$",
"expr",
",",
"$",
"type",
")",
"{",
"$",
"type",
"=",
"$",
"this",
"->",
"intervalMap",
"[",
"$",
"type",
"]",
";",
"$",
"column",
"=",
"$",
"this",
"->",
"getIdentifier",
"(",
"$",
"... | Returns the SQL that subtracts an interval from a timestamp value.
@param string $column
@param numeric $expr
@param string $type one of SECOND, MINUTE, HOUR, DAY, MONTH, or YEAR
@return string | [
"Returns",
"the",
"SQL",
"that",
"subtracts",
"an",
"interval",
"from",
"a",
"timestamp",
"value",
"."
] | b0afc661105f0a2f65d49abac13956cc93c5188d | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/Database/src/sqlabstraction/implementations/expression_oracle.php#L180-L191 |
22,642 | Eresus/EresusCMS | src/core/framework/core/3rdparty/ezcomponents/Database/src/sqlabstraction/implementations/expression_oracle.php | ezcQueryExpressionOracle.dateAdd | public function dateAdd( $column, $expr, $type )
{
$type = $this->intervalMap[$type];
$column = $this->getIdentifier( $column );
if ( $column != 'NOW()' )
{
$column = "CAST( {$column} AS TIMESTAMP )";
}
return " {$column} + INTERVAL '{$expr}' {$type} ";
... | php | public function dateAdd( $column, $expr, $type )
{
$type = $this->intervalMap[$type];
$column = $this->getIdentifier( $column );
if ( $column != 'NOW()' )
{
$column = "CAST( {$column} AS TIMESTAMP )";
}
return " {$column} + INTERVAL '{$expr}' {$type} ";
... | [
"public",
"function",
"dateAdd",
"(",
"$",
"column",
",",
"$",
"expr",
",",
"$",
"type",
")",
"{",
"$",
"type",
"=",
"$",
"this",
"->",
"intervalMap",
"[",
"$",
"type",
"]",
";",
"$",
"column",
"=",
"$",
"this",
"->",
"getIdentifier",
"(",
"$",
"... | Returns the SQL that adds an interval to a timestamp value.
@param string $column
@param numeric $expr
@param string $type one of SECOND, MINUTE, HOUR, DAY, MONTH, or YEAR
@return string | [
"Returns",
"the",
"SQL",
"that",
"adds",
"an",
"interval",
"to",
"a",
"timestamp",
"value",
"."
] | b0afc661105f0a2f65d49abac13956cc93c5188d | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/Database/src/sqlabstraction/implementations/expression_oracle.php#L201-L212 |
22,643 | Eresus/EresusCMS | src/core/framework/core/3rdparty/ezcomponents/Database/src/sqlabstraction/implementations/expression_oracle.php | ezcQueryExpressionOracle.in | public function in( $column )
{
$args = func_get_args();
if ( count( $args ) < 2 )
{
throw new ezcQueryVariableParameterException( 'in', count( $args ), 2 );
}
if ( is_array( $args[1] ) && count( $args[1] ) == 0 )
{
throw new ezcQueryInvalidPa... | php | public function in( $column )
{
$args = func_get_args();
if ( count( $args ) < 2 )
{
throw new ezcQueryVariableParameterException( 'in', count( $args ), 2 );
}
if ( is_array( $args[1] ) && count( $args[1] ) == 0 )
{
throw new ezcQueryInvalidPa... | [
"public",
"function",
"in",
"(",
"$",
"column",
")",
"{",
"$",
"args",
"=",
"func_get_args",
"(",
")",
";",
"if",
"(",
"count",
"(",
"$",
"args",
")",
"<",
"2",
")",
"{",
"throw",
"new",
"ezcQueryVariableParameterException",
"(",
"'in'",
",",
"count",
... | Returns the SQL to check if a value is one in a set of
given values.
in() accepts an arbitrary number of parameters. The first parameter
must always specify the value that should be matched against. Successive
parameters must contain a logical expression or an array with logical
expressions. These expressions will be... | [
"Returns",
"the",
"SQL",
"to",
"check",
"if",
"a",
"value",
"is",
"one",
"in",
"a",
"set",
"of",
"given",
"values",
"."
] | b0afc661105f0a2f65d49abac13956cc93c5188d | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/Database/src/sqlabstraction/implementations/expression_oracle.php#L268-L326 |
22,644 | HedronDev/hedron | src/Tools/ComposerHelperTrait.php | ComposerHelperTrait.mergeComposerJsonFiles | protected function mergeComposerJsonFiles(string $composer_file, \stdClass $original_composer, \stdClass $new_composer, callable $callback = NULL) {
$new_composer = $this->mergeComposerObjects($original_composer, $new_composer, $callback);
$composer_content = file_get_contents($composer_file);
$replace_comp... | php | protected function mergeComposerJsonFiles(string $composer_file, \stdClass $original_composer, \stdClass $new_composer, callable $callback = NULL) {
$new_composer = $this->mergeComposerObjects($original_composer, $new_composer, $callback);
$composer_content = file_get_contents($composer_file);
$replace_comp... | [
"protected",
"function",
"mergeComposerJsonFiles",
"(",
"string",
"$",
"composer_file",
",",
"\\",
"stdClass",
"$",
"original_composer",
",",
"\\",
"stdClass",
"$",
"new_composer",
",",
"callable",
"$",
"callback",
"=",
"NULL",
")",
"{",
"$",
"new_composer",
"="... | Merges the original composer file with a new composer file.
This ensures that the composer.json file that is going to be installed
will have all the appropriate requirements documented by the git
repository that is kept up to date by the client.
@param string $composer_file
The absolute path to the composer file to w... | [
"Merges",
"the",
"original",
"composer",
"file",
"with",
"a",
"new",
"composer",
"file",
"."
] | 3b4adec4912f2d7c0b7e7262dc36515fbc2e8e00 | https://github.com/HedronDev/hedron/blob/3b4adec4912f2d7c0b7e7262dc36515fbc2e8e00/src/Tools/ComposerHelperTrait.php#L27-L35 |
22,645 | HedronDev/hedron | src/Tools/ComposerHelperTrait.php | ComposerHelperTrait.mergeComposerObjects | protected function mergeComposerObjects(\stdClass $original_composer, \stdClass $new_composer, callable $callback = NULL) {
foreach ($original_composer as $key => $values) {
$is_array = is_array($values);
$values = (array) $values;
if (isset($new_composer->{$key})) {
$value = (array) $new... | php | protected function mergeComposerObjects(\stdClass $original_composer, \stdClass $new_composer, callable $callback = NULL) {
foreach ($original_composer as $key => $values) {
$is_array = is_array($values);
$values = (array) $values;
if (isset($new_composer->{$key})) {
$value = (array) $new... | [
"protected",
"function",
"mergeComposerObjects",
"(",
"\\",
"stdClass",
"$",
"original_composer",
",",
"\\",
"stdClass",
"$",
"new_composer",
",",
"callable",
"$",
"callback",
"=",
"NULL",
")",
"{",
"foreach",
"(",
"$",
"original_composer",
"as",
"$",
"key",
"... | Merges two composer objects into one.
@param \stdClass $original_composer
The original composer.json file before it was removed as a php object.
@param \stdClass $new_composer
The new composer file to generate.
@param callable $callback
A callback if necessary to customize the composer object further.
@return \stdCla... | [
"Merges",
"two",
"composer",
"objects",
"into",
"one",
"."
] | 3b4adec4912f2d7c0b7e7262dc36515fbc2e8e00 | https://github.com/HedronDev/hedron/blob/3b4adec4912f2d7c0b7e7262dc36515fbc2e8e00/src/Tools/ComposerHelperTrait.php#L50-L64 |
22,646 | HedronDev/hedron | src/Tools/ComposerHelperTrait.php | ComposerHelperTrait.calculateRequirementChanges | protected function calculateRequirementChanges($replace_composer, $new_composer) {
$changes = [
'install' => [],
'update' => [],
'remove' => [],
];
foreach (['require', 'require-dev'] as $key) {
$old_requirements = !empty($replace_composer->{$key}) ? $replace_composer->{$key} : [];
... | php | protected function calculateRequirementChanges($replace_composer, $new_composer) {
$changes = [
'install' => [],
'update' => [],
'remove' => [],
];
foreach (['require', 'require-dev'] as $key) {
$old_requirements = !empty($replace_composer->{$key}) ? $replace_composer->{$key} : [];
... | [
"protected",
"function",
"calculateRequirementChanges",
"(",
"$",
"replace_composer",
",",
"$",
"new_composer",
")",
"{",
"$",
"changes",
"=",
"[",
"'install'",
"=>",
"[",
"]",
",",
"'update'",
"=>",
"[",
"]",
",",
"'remove'",
"=>",
"[",
"]",
",",
"]",
"... | Calculated requirements that need to be removed from the system.
@param $replace_composer
Composer object about to be replaced.
@param $new_composer
Composer object doing the replacing.
@return array
An array of requirements to install, update or remove. | [
"Calculated",
"requirements",
"that",
"need",
"to",
"be",
"removed",
"from",
"the",
"system",
"."
] | 3b4adec4912f2d7c0b7e7262dc36515fbc2e8e00 | https://github.com/HedronDev/hedron/blob/3b4adec4912f2d7c0b7e7262dc36515fbc2e8e00/src/Tools/ComposerHelperTrait.php#L77-L101 |
22,647 | heidelpay/PhpDoc | src/phpDocumentor/Plugin/Scrybe/Converter/RestructuredText/Roles/Doc.php | Doc.toXhtml | public function toXhtml(\DOMDocument $document, \DOMElement $root)
{
$content = '';
$caption = '';
foreach ($this->node->nodes as $node) {
$content .= $node->token->content;
}
$matches = array();
if (preg_match('/([^<]*)<?([^>]*)>?/', $content, $matches)... | php | public function toXhtml(\DOMDocument $document, \DOMElement $root)
{
$content = '';
$caption = '';
foreach ($this->node->nodes as $node) {
$content .= $node->token->content;
}
$matches = array();
if (preg_match('/([^<]*)<?([^>]*)>?/', $content, $matches)... | [
"public",
"function",
"toXhtml",
"(",
"\\",
"DOMDocument",
"$",
"document",
",",
"\\",
"DOMElement",
"$",
"root",
")",
"{",
"$",
"content",
"=",
"''",
";",
"$",
"caption",
"=",
"''",
";",
"foreach",
"(",
"$",
"this",
"->",
"node",
"->",
"nodes",
"as"... | Transform text role to HTML.
Create a XHTML structure at the text roles position in the document.
@param \DOMDocument $document
@param \DOMElement $root
@return void | [
"Transform",
"text",
"role",
"to",
"HTML",
"."
] | 5ac9e842cbd4cbb70900533b240c131f3515ee02 | https://github.com/heidelpay/PhpDoc/blob/5ac9e842cbd4cbb70900533b240c131f3515ee02/src/phpDocumentor/Plugin/Scrybe/Converter/RestructuredText/Roles/Doc.php#L47-L83 |
22,648 | kecik-framework/kecik | Kecik/Route.php | Route._getParams | public function _getParams( $key = - 1 ) {
if ( $key >= 0 ) {
if ( isset( self::$params[ $key ] ) ) {
return self::$params[ $key ];
} else {
return NULL;
}
} else {
return self::$params;
}
} | php | public function _getParams( $key = - 1 ) {
if ( $key >= 0 ) {
if ( isset( self::$params[ $key ] ) ) {
return self::$params[ $key ];
} else {
return NULL;
}
} else {
return self::$params;
}
} | [
"public",
"function",
"_getParams",
"(",
"$",
"key",
"=",
"-",
"1",
")",
"{",
"if",
"(",
"$",
"key",
">=",
"0",
")",
"{",
"if",
"(",
"isset",
"(",
"self",
"::",
"$",
"params",
"[",
"$",
"key",
"]",
")",
")",
"{",
"return",
"self",
"::",
"$",
... | get Route Paramenters
@param int $key
@return array|null | [
"get",
"Route",
"Paramenters"
] | fa87e593affe1c9c51a2acd264b85ec06df31d7c | https://github.com/kecik-framework/kecik/blob/fa87e593affe1c9c51a2acd264b85ec06df31d7c/Kecik/Route.php#L196-L209 |
22,649 | kecik-framework/kecik | Kecik/Route.php | Route.setParams | public function setParams( $key, $value = '' ) {
//if (!isset($this->params)) $this->params = array();
if ( is_array( $key ) ) {
self::$RealParams = $key;
} else {
self::$RealParams[ $key ] = $value;
}
} | php | public function setParams( $key, $value = '' ) {
//if (!isset($this->params)) $this->params = array();
if ( is_array( $key ) ) {
self::$RealParams = $key;
} else {
self::$RealParams[ $key ] = $value;
}
} | [
"public",
"function",
"setParams",
"(",
"$",
"key",
",",
"$",
"value",
"=",
"''",
")",
"{",
"//if (!isset($this->params)) $this->params = array();",
"if",
"(",
"is_array",
"(",
"$",
"key",
")",
")",
"{",
"self",
"::",
"$",
"RealParams",
"=",
"$",
"key",
";... | Set route paramters
@param $key
@param string $value | [
"Set",
"route",
"paramters"
] | fa87e593affe1c9c51a2acd264b85ec06df31d7c | https://github.com/kecik-framework/kecik/blob/fa87e593affe1c9c51a2acd264b85ec06df31d7c/Kecik/Route.php#L238-L247 |
22,650 | kecik-framework/kecik | Kecik/Route.php | Route.isPut | public function isPut() {
if ( isset( $_SERVER['REQUEST_METHOD'] ) ) {
if ( $_SERVER['REQUEST_METHOD'] == 'PUT' || ( isset( $_POST['_METHOD'] ) && $_POST['_METHOD'] == 'PUT' ) ) {
parse_str( file_get_contents( "php://input" ), $vars );
if ( isset( $vars['_METHOD'] ) ) {
unset( $vars['_METHOD'] );
... | php | public function isPut() {
if ( isset( $_SERVER['REQUEST_METHOD'] ) ) {
if ( $_SERVER['REQUEST_METHOD'] == 'PUT' || ( isset( $_POST['_METHOD'] ) && $_POST['_METHOD'] == 'PUT' ) ) {
parse_str( file_get_contents( "php://input" ), $vars );
if ( isset( $vars['_METHOD'] ) ) {
unset( $vars['_METHOD'] );
... | [
"public",
"function",
"isPut",
"(",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"_SERVER",
"[",
"'REQUEST_METHOD'",
"]",
")",
")",
"{",
"if",
"(",
"$",
"_SERVER",
"[",
"'REQUEST_METHOD'",
"]",
"==",
"'PUT'",
"||",
"(",
"isset",
"(",
"$",
"_POST",
"[",
... | Check request of Put method
@return bool | [
"Check",
"request",
"of",
"Put",
"method"
] | fa87e593affe1c9c51a2acd264b85ec06df31d7c | https://github.com/kecik-framework/kecik/blob/fa87e593affe1c9c51a2acd264b85ec06df31d7c/Kecik/Route.php#L335-L357 |
22,651 | kecik-framework/kecik | Kecik/Route.php | Route.isDelete | public function isDelete() {
if ( isset( $_SERVER['REQUEST_METHOD'] ) ) {
if ( $_SERVER['REQUEST_METHOD'] == 'DELETE' || ( isset( $_POST['_METHOD'] ) && $_POST['_METHOD'] == 'DELETE' ) ) {
parse_str( file_get_contents( "php://input" ), $vars );
if ( isset( $vars['_METHOD'] ) ) {
unset( $vars['_METHO... | php | public function isDelete() {
if ( isset( $_SERVER['REQUEST_METHOD'] ) ) {
if ( $_SERVER['REQUEST_METHOD'] == 'DELETE' || ( isset( $_POST['_METHOD'] ) && $_POST['_METHOD'] == 'DELETE' ) ) {
parse_str( file_get_contents( "php://input" ), $vars );
if ( isset( $vars['_METHOD'] ) ) {
unset( $vars['_METHO... | [
"public",
"function",
"isDelete",
"(",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"_SERVER",
"[",
"'REQUEST_METHOD'",
"]",
")",
")",
"{",
"if",
"(",
"$",
"_SERVER",
"[",
"'REQUEST_METHOD'",
"]",
"==",
"'DELETE'",
"||",
"(",
"isset",
"(",
"$",
"_POST",
"... | Check request of delete method
@return bool | [
"Check",
"request",
"of",
"delete",
"method"
] | fa87e593affe1c9c51a2acd264b85ec06df31d7c | https://github.com/kecik-framework/kecik/blob/fa87e593affe1c9c51a2acd264b85ec06df31d7c/Kecik/Route.php#L364-L385 |
22,652 | kecik-framework/kecik | Kecik/Route.php | Route.isPatch | public function isPatch() {
if ( isset( $_SERVER['REQUEST_METHOD'] ) ) {
if ( $_SERVER['REQUEST_METHOD'] == 'PATCH' || ( isset( $_POST['_METHOD'] ) && $_POST['_METHOD'] == 'PATCH' ) ) {
parse_str( file_get_contents( "php://input" ), $vars );
if ( isset( $vars['_METHOD'] ) ) {
unset( $vars['_METHOD']... | php | public function isPatch() {
if ( isset( $_SERVER['REQUEST_METHOD'] ) ) {
if ( $_SERVER['REQUEST_METHOD'] == 'PATCH' || ( isset( $_POST['_METHOD'] ) && $_POST['_METHOD'] == 'PATCH' ) ) {
parse_str( file_get_contents( "php://input" ), $vars );
if ( isset( $vars['_METHOD'] ) ) {
unset( $vars['_METHOD']... | [
"public",
"function",
"isPatch",
"(",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"_SERVER",
"[",
"'REQUEST_METHOD'",
"]",
")",
")",
"{",
"if",
"(",
"$",
"_SERVER",
"[",
"'REQUEST_METHOD'",
"]",
"==",
"'PATCH'",
"||",
"(",
"isset",
"(",
"$",
"_POST",
"["... | Check request of Patch method
@return bool | [
"Check",
"request",
"of",
"Patch",
"method"
] | fa87e593affe1c9c51a2acd264b85ec06df31d7c | https://github.com/kecik-framework/kecik/blob/fa87e593affe1c9c51a2acd264b85ec06df31d7c/Kecik/Route.php#L392-L413 |
22,653 | kecik-framework/kecik | Kecik/Route.php | Route.isOptions | public function isOptions() {
if ( isset( $_SERVER['REQUEST_METHOD'] ) ) {
if ( $_SERVER['REQUEST_METHOD'] == 'OPTIONS' || ( isset( $_POST['_METHOD'] ) && $_POST['_METHOD'] == 'OPTIONS' ) ) {
parse_str( file_get_contents( "php://input" ), $vars );
if ( isset( $vars['_METHOD'] ) ) {
unset( $vars['_ME... | php | public function isOptions() {
if ( isset( $_SERVER['REQUEST_METHOD'] ) ) {
if ( $_SERVER['REQUEST_METHOD'] == 'OPTIONS' || ( isset( $_POST['_METHOD'] ) && $_POST['_METHOD'] == 'OPTIONS' ) ) {
parse_str( file_get_contents( "php://input" ), $vars );
if ( isset( $vars['_METHOD'] ) ) {
unset( $vars['_ME... | [
"public",
"function",
"isOptions",
"(",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"_SERVER",
"[",
"'REQUEST_METHOD'",
"]",
")",
")",
"{",
"if",
"(",
"$",
"_SERVER",
"[",
"'REQUEST_METHOD'",
"]",
"==",
"'OPTIONS'",
"||",
"(",
"isset",
"(",
"$",
"_POST",
... | Check request of Options method
@return bool | [
"Check",
"request",
"of",
"Options",
"method"
] | fa87e593affe1c9c51a2acd264b85ec06df31d7c | https://github.com/kecik-framework/kecik/blob/fa87e593affe1c9c51a2acd264b85ec06df31d7c/Kecik/Route.php#L420-L441 |
22,654 | GrupaZero/api | src/Gzero/Api/Transformer/BlockTransformer.php | BlockTransformer.transform | public function transform($block)
{
$block = $this->entityToArray(Block::class, $block);
return [
'id' => $this->setNullableValue($block['id']),
'type' => $block['type'],
'region' => $block['region'],
'filter' => $block['filte... | php | public function transform($block)
{
$block = $this->entityToArray(Block::class, $block);
return [
'id' => $this->setNullableValue($block['id']),
'type' => $block['type'],
'region' => $block['region'],
'filter' => $block['filte... | [
"public",
"function",
"transform",
"(",
"$",
"block",
")",
"{",
"$",
"block",
"=",
"$",
"this",
"->",
"entityToArray",
"(",
"Block",
"::",
"class",
",",
"$",
"block",
")",
";",
"return",
"[",
"'id'",
"=>",
"$",
"this",
"->",
"setNullableValue",
"(",
... | Transforms block entity
@param Block|array $block Block entity
@return array | [
"Transforms",
"block",
"entity"
] | fc544bb6057274e9d5e7b617346c3f854ea5effd | https://github.com/GrupaZero/api/blob/fc544bb6057274e9d5e7b617346c3f854ea5effd/src/Gzero/Api/Transformer/BlockTransformer.php#L45-L61 |
22,655 | Eresus/EresusCMS | src/core/framework/core/3rdparty/dwoo/Dwoo/Adapters/CodeIgniter/libraries/Dwootemplate.php | Dwootemplate.add_js | public function add_js($js) {
$current = $this->dwoo_data->js_files;
$current[] = $js;
$this->dwoo_data->js_files = $current;
} | php | public function add_js($js) {
$current = $this->dwoo_data->js_files;
$current[] = $js;
$this->dwoo_data->js_files = $current;
} | [
"public",
"function",
"add_js",
"(",
"$",
"js",
")",
"{",
"$",
"current",
"=",
"$",
"this",
"->",
"dwoo_data",
"->",
"js_files",
";",
"$",
"current",
"[",
"]",
"=",
"$",
"js",
";",
"$",
"this",
"->",
"dwoo_data",
"->",
"js_files",
"=",
"$",
"curren... | Add Javascript files to template
@param string $js | [
"Add",
"Javascript",
"files",
"to",
"template"
] | b0afc661105f0a2f65d49abac13956cc93c5188d | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/dwoo/Dwoo/Adapters/CodeIgniter/libraries/Dwootemplate.php#L66-L70 |
22,656 | Eresus/EresusCMS | src/core/framework/core/3rdparty/dwoo/Dwoo/Adapters/CodeIgniter/libraries/Dwootemplate.php | Dwootemplate.add_css | public function add_css($css) {
$current = $this->dwoo_data->css_files;
$current[] = $css;
$this->dwoo_data->css_files = $current;
} | php | public function add_css($css) {
$current = $this->dwoo_data->css_files;
$current[] = $css;
$this->dwoo_data->css_files = $current;
} | [
"public",
"function",
"add_css",
"(",
"$",
"css",
")",
"{",
"$",
"current",
"=",
"$",
"this",
"->",
"dwoo_data",
"->",
"css_files",
";",
"$",
"current",
"[",
"]",
"=",
"$",
"css",
";",
"$",
"this",
"->",
"dwoo_data",
"->",
"css_files",
"=",
"$",
"c... | Add Css stylesheets to template
@param string $css | [
"Add",
"Css",
"stylesheets",
"to",
"template"
] | b0afc661105f0a2f65d49abac13956cc93c5188d | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/dwoo/Dwoo/Adapters/CodeIgniter/libraries/Dwootemplate.php#L78-L82 |
22,657 | Eresus/EresusCMS | src/core/framework/core/3rdparty/dwoo/Dwoo/Adapters/CodeIgniter/libraries/Dwootemplate.php | Dwootemplate.display | public function display($sTemplate, $return = FALSE) {
// Start benchmark
$CI = get_instance();
$CI->benchmark->mark('dwoo_parse_start');
// Check if file exists
if ( !file_exists($this->template_dir . $sTemplate ) ) {
$message = sprintf('Template file \'%s\' not fou... | php | public function display($sTemplate, $return = FALSE) {
// Start benchmark
$CI = get_instance();
$CI->benchmark->mark('dwoo_parse_start');
// Check if file exists
if ( !file_exists($this->template_dir . $sTemplate ) ) {
$message = sprintf('Template file \'%s\' not fou... | [
"public",
"function",
"display",
"(",
"$",
"sTemplate",
",",
"$",
"return",
"=",
"FALSE",
")",
"{",
"// Start benchmark",
"$",
"CI",
"=",
"get_instance",
"(",
")",
";",
"$",
"CI",
"->",
"benchmark",
"->",
"mark",
"(",
"'dwoo_parse_start'",
")",
";",
"// ... | Display or return the compiled template
Since we assign the results to the standard CI output module
you can also use the helper from CI in your templates!!
@param string $sTemplate
@param boolean $return
@return mixed | [
"Display",
"or",
"return",
"the",
"compiled",
"template",
"Since",
"we",
"assign",
"the",
"results",
"to",
"the",
"standard",
"CI",
"output",
"module",
"you",
"can",
"also",
"use",
"the",
"helper",
"from",
"CI",
"in",
"your",
"templates!!"
] | b0afc661105f0a2f65d49abac13956cc93c5188d | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/dwoo/Dwoo/Adapters/CodeIgniter/libraries/Dwootemplate.php#L94-L121 |
22,658 | Eresus/EresusCMS | src/core/framework/core/3rdparty/dwoo/Dwoo/Adapters/CodeIgniter/libraries/Dwootemplate.php | Dwootemplate.initialize | private function initialize() {
$CI = get_instance();
$CI->config->load('dwootemplate', TRUE);
$config = $CI->config->item('dwootemplate');
foreach ($config as $key => $val) {
$this->$key = $val;
}
} | php | private function initialize() {
$CI = get_instance();
$CI->config->load('dwootemplate', TRUE);
$config = $CI->config->item('dwootemplate');
foreach ($config as $key => $val) {
$this->$key = $val;
}
} | [
"private",
"function",
"initialize",
"(",
")",
"{",
"$",
"CI",
"=",
"get_instance",
"(",
")",
";",
"$",
"CI",
"->",
"config",
"->",
"load",
"(",
"'dwootemplate'",
",",
"TRUE",
")",
";",
"$",
"config",
"=",
"$",
"CI",
"->",
"config",
"->",
"item",
"... | Assign the dwootemplate config items to the instance | [
"Assign",
"the",
"dwootemplate",
"config",
"items",
"to",
"the",
"instance"
] | b0afc661105f0a2f65d49abac13956cc93c5188d | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/dwoo/Dwoo/Adapters/CodeIgniter/libraries/Dwootemplate.php#L164-L171 |
22,659 | i-lateral/silverstripe-modeladminplus | src/DataObjectExtension.php | DataObjectExtension.getModelAdminSearchContext | public function getModelAdminSearchContext()
{
return SearchContext::create(
get_class($this->getOwner()),
$this->getOwner()->scaffoldSearchFields(),
$this->getOwner()->defaultSearchFilters()
);
} | php | public function getModelAdminSearchContext()
{
return SearchContext::create(
get_class($this->getOwner()),
$this->getOwner()->scaffoldSearchFields(),
$this->getOwner()->defaultSearchFilters()
);
} | [
"public",
"function",
"getModelAdminSearchContext",
"(",
")",
"{",
"return",
"SearchContext",
"::",
"create",
"(",
"get_class",
"(",
"$",
"this",
"->",
"getOwner",
"(",
")",
")",
",",
"$",
"this",
"->",
"getOwner",
"(",
")",
"->",
"scaffoldSearchFields",
"("... | Get a custom search context for model admin plus | [
"Get",
"a",
"custom",
"search",
"context",
"for",
"model",
"admin",
"plus"
] | c5209d9610cdb36ddc7b9231fad342df7e75ffc0 | https://github.com/i-lateral/silverstripe-modeladminplus/blob/c5209d9610cdb36ddc7b9231fad342df7e75ffc0/src/DataObjectExtension.php#L12-L19 |
22,660 | fccn/oai-pmh-core | src/schemas/ands_dces.php | DC_DataHolder.combine | public function combine($another)
{
if (is_a($another, DC_DataHolder::getKlass())) {
// debug_message("entering combine...");
// debug_var_dump("another", $another);
//identifier
if (empty($this->identifier)) {
debug_message("DC_DataHolder::ide... | php | public function combine($another)
{
if (is_a($another, DC_DataHolder::getKlass())) {
// debug_message("entering combine...");
// debug_var_dump("another", $another);
//identifier
if (empty($this->identifier)) {
debug_message("DC_DataHolder::ide... | [
"public",
"function",
"combine",
"(",
"$",
"another",
")",
"{",
"if",
"(",
"is_a",
"(",
"$",
"another",
",",
"DC_DataHolder",
"::",
"getKlass",
"(",
")",
")",
")",
"{",
"// debug_message(\"entering combine...\");",
"// debug_var_dump(\"another\", $another);",
"//ide... | Combines this object with another DC_DataHolder object | [
"Combines",
"this",
"object",
"with",
"another",
"DC_DataHolder",
"object"
] | a9c6852482c7bd7c48911a2165120325ecc27ea2 | https://github.com/fccn/oai-pmh-core/blob/a9c6852482c7bd7c48911a2165120325ecc27ea2/src/schemas/ands_dces.php#L184-L214 |
22,661 | OKTOTV/OktolabMediaBundle | Model/GenerateThumbnailSpriteJob.php | GenerateThumbnailSpriteJob.generateThumbs | private function generateThumbs($episode, $cache_asset)
{
$uri = $this->asset_helper->getAbsoluteUrl($episode->getVideo());
$path = $this->asset_helper->getPath($cache_asset, true);
$cmd = sprintf(
"ffmpeg -i %s -s %sx%s -vf fps=1/%s %s 2>&1",
$uri,
$this-... | php | private function generateThumbs($episode, $cache_asset)
{
$uri = $this->asset_helper->getAbsoluteUrl($episode->getVideo());
$path = $this->asset_helper->getPath($cache_asset, true);
$cmd = sprintf(
"ffmpeg -i %s -s %sx%s -vf fps=1/%s %s 2>&1",
$uri,
$this-... | [
"private",
"function",
"generateThumbs",
"(",
"$",
"episode",
",",
"$",
"cache_asset",
")",
"{",
"$",
"uri",
"=",
"$",
"this",
"->",
"asset_helper",
"->",
"getAbsoluteUrl",
"(",
"$",
"episode",
"->",
"getVideo",
"(",
")",
")",
";",
"$",
"path",
"=",
"$... | takes episode and creates thumbnails in given width and height | [
"takes",
"episode",
"and",
"creates",
"thumbnails",
"in",
"given",
"width",
"and",
"height"
] | f9c1eac4f6b19d2ab25288b301dd0d9350478bb3 | https://github.com/OKTOTV/OktolabMediaBundle/blob/f9c1eac4f6b19d2ab25288b301dd0d9350478bb3/Model/GenerateThumbnailSpriteJob.php#L59-L90 |
22,662 | heidelpay/PhpDoc | src/phpDocumentor/Transformer/Behaviour/Collection.php | Collection.removeBehaviour | public function removeBehaviour(BehaviourAbstract $behaviour)
{
foreach ($this->behaviours as $key => $thisBehaviour) {
if ($behaviour == $thisBehaviour) {
unset($this->behaviours[$key]);
}
}
} | php | public function removeBehaviour(BehaviourAbstract $behaviour)
{
foreach ($this->behaviours as $key => $thisBehaviour) {
if ($behaviour == $thisBehaviour) {
unset($this->behaviours[$key]);
}
}
} | [
"public",
"function",
"removeBehaviour",
"(",
"BehaviourAbstract",
"$",
"behaviour",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"behaviours",
"as",
"$",
"key",
"=>",
"$",
"thisBehaviour",
")",
"{",
"if",
"(",
"$",
"behaviour",
"==",
"$",
"thisBehaviour",
... | Removes a behaviour from the collection
@param BehaviourAbstract $behaviour Behaviour to remove from the collection.
@return void | [
"Removes",
"a",
"behaviour",
"from",
"the",
"collection"
] | 5ac9e842cbd4cbb70900533b240c131f3515ee02 | https://github.com/heidelpay/PhpDoc/blob/5ac9e842cbd4cbb70900533b240c131f3515ee02/src/phpDocumentor/Transformer/Behaviour/Collection.php#L53-L60 |
22,663 | heidelpay/PhpDoc | src/phpDocumentor/Transformer/Behaviour/Collection.php | Collection.process | public function process(ProjectDescriptor $project)
{
foreach ($this->behaviours as $behaviour) {
$project = $behaviour->process($project);
}
return $project;
} | php | public function process(ProjectDescriptor $project)
{
foreach ($this->behaviours as $behaviour) {
$project = $behaviour->process($project);
}
return $project;
} | [
"public",
"function",
"process",
"(",
"ProjectDescriptor",
"$",
"project",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"behaviours",
"as",
"$",
"behaviour",
")",
"{",
"$",
"project",
"=",
"$",
"behaviour",
"->",
"process",
"(",
"$",
"project",
")",
";",... | Executes the behaviour on the given object model,
@param ProjectDescriptor $project
@return ProjectDescriptor | [
"Executes",
"the",
"behaviour",
"on",
"the",
"given",
"object",
"model"
] | 5ac9e842cbd4cbb70900533b240c131f3515ee02 | https://github.com/heidelpay/PhpDoc/blob/5ac9e842cbd4cbb70900533b240c131f3515ee02/src/phpDocumentor/Transformer/Behaviour/Collection.php#L69-L76 |
22,664 | gruzilla/hydra | src/Hydra/Commands/ConfigCommandTrait.php | ConfigCommandTrait.getConfigHelper | protected function getConfigHelper($serviceName)
{
$storage = new HydraTokenStorage();
$provider = new DefaultServiceProvider($storage);
$className = $this->getConfigHelperClassName($serviceName);
return new $className(
$storage,
$provider,
$serv... | php | protected function getConfigHelper($serviceName)
{
$storage = new HydraTokenStorage();
$provider = new DefaultServiceProvider($storage);
$className = $this->getConfigHelperClassName($serviceName);
return new $className(
$storage,
$provider,
$serv... | [
"protected",
"function",
"getConfigHelper",
"(",
"$",
"serviceName",
")",
"{",
"$",
"storage",
"=",
"new",
"HydraTokenStorage",
"(",
")",
";",
"$",
"provider",
"=",
"new",
"DefaultServiceProvider",
"(",
"$",
"storage",
")",
";",
"$",
"className",
"=",
"$",
... | overwrite for dependency injection | [
"overwrite",
"for",
"dependency",
"injection"
] | 47f381cc48e1a26bfe2e211d8dcb54c787ea0478 | https://github.com/gruzilla/hydra/blob/47f381cc48e1a26bfe2e211d8dcb54c787ea0478/src/Hydra/Commands/ConfigCommandTrait.php#L156-L168 |
22,665 | rhosocial/yii2-user | security/UserPasswordHistoryTrait.php | UserPasswordHistoryTrait.getPasswordHistories | public function getPasswordHistories()
{
if (empty($this->passwordHistoryClass) || !class_exists($this->passwordHistoryClass)) {
return false;
}
$class = $this->passwordHistoryClass;
return $class::find()->createdBy($this)->orderByCreatedAt(SORT_DESC)->all();
} | php | public function getPasswordHistories()
{
if (empty($this->passwordHistoryClass) || !class_exists($this->passwordHistoryClass)) {
return false;
}
$class = $this->passwordHistoryClass;
return $class::find()->createdBy($this)->orderByCreatedAt(SORT_DESC)->all();
} | [
"public",
"function",
"getPasswordHistories",
"(",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"this",
"->",
"passwordHistoryClass",
")",
"||",
"!",
"class_exists",
"(",
"$",
"this",
"->",
"passwordHistoryClass",
")",
")",
"{",
"return",
"false",
";",
"}",
"$"... | Get all password histories sorted by creation time in descending order.
@return boolean|PasswordHistory[] False if password history class is invalid. | [
"Get",
"all",
"password",
"histories",
"sorted",
"by",
"creation",
"time",
"in",
"descending",
"order",
"."
] | 96737a9d8ca7e9c42cd2b7736d6c0a90ede6e5bc | https://github.com/rhosocial/yii2-user/blob/96737a9d8ca7e9c42cd2b7736d6c0a90ede6e5bc/security/UserPasswordHistoryTrait.php#L43-L50 |
22,666 | rhosocial/yii2-user | security/UserPasswordHistoryTrait.php | UserPasswordHistoryTrait.onAddPasswordToHistory | public function onAddPasswordToHistory($event)
{
$password = $event->data;
$sender = $event->sender;
/* @var $sender static */
if (empty($sender->passwordHistoryClass) ||
!class_exists($sender->passwordHistoryClass) ||
empty($sender->passwordHashAttrib... | php | public function onAddPasswordToHistory($event)
{
$password = $event->data;
$sender = $event->sender;
/* @var $sender static */
if (empty($sender->passwordHistoryClass) ||
!class_exists($sender->passwordHistoryClass) ||
empty($sender->passwordHashAttrib... | [
"public",
"function",
"onAddPasswordToHistory",
"(",
"$",
"event",
")",
"{",
"$",
"password",
"=",
"$",
"event",
"->",
"data",
";",
"$",
"sender",
"=",
"$",
"event",
"->",
"sender",
";",
"/* @var $sender static */",
"if",
"(",
"empty",
"(",
"$",
"sender",
... | This event is ONLY used for adding password to history.
You SHOULD NOT call this method directly, or you know the consequences of doing so
@param ModelEvent $event
@return boolean False if no password was added to history. | [
"This",
"event",
"is",
"ONLY",
"used",
"for",
"adding",
"password",
"to",
"history",
".",
"You",
"SHOULD",
"NOT",
"call",
"this",
"method",
"directly",
"or",
"you",
"know",
"the",
"consequences",
"of",
"doing",
"so"
] | 96737a9d8ca7e9c42cd2b7736d6c0a90ede6e5bc | https://github.com/rhosocial/yii2-user/blob/96737a9d8ca7e9c42cd2b7736d6c0a90ede6e5bc/security/UserPasswordHistoryTrait.php#L58-L80 |
22,667 | rhosocial/yii2-user | security/UserPasswordHistoryTrait.php | UserPasswordHistoryTrait.checkPasswordNotUsed | public function checkPasswordNotUsed($attribute, $params, $validator)
{
$class = $this->passwordHistoryClass;
$result = $class::isUsed($this->_password, $this);
if ($result != false) {
$this->trigger(static::$eventPasswordUsed);
$this->addError($attribute, $this->pass... | php | public function checkPasswordNotUsed($attribute, $params, $validator)
{
$class = $this->passwordHistoryClass;
$result = $class::isUsed($this->_password, $this);
if ($result != false) {
$this->trigger(static::$eventPasswordUsed);
$this->addError($attribute, $this->pass... | [
"public",
"function",
"checkPasswordNotUsed",
"(",
"$",
"attribute",
",",
"$",
"params",
",",
"$",
"validator",
")",
"{",
"$",
"class",
"=",
"$",
"this",
"->",
"passwordHistoryClass",
";",
"$",
"result",
"=",
"$",
"class",
"::",
"isUsed",
"(",
"$",
"this... | This method is only used for password hash attribute validation.
If password is used, the `eventPasswordUsed` event will be triggered.
@param string $attribute
@param mixed $params
@param type $validator | [
"This",
"method",
"is",
"only",
"used",
"for",
"password",
"hash",
"attribute",
"validation",
".",
"If",
"password",
"is",
"used",
"the",
"eventPasswordUsed",
"event",
"will",
"be",
"triggered",
"."
] | 96737a9d8ca7e9c42cd2b7736d6c0a90ede6e5bc | https://github.com/rhosocial/yii2-user/blob/96737a9d8ca7e9c42cd2b7736d6c0a90ede6e5bc/security/UserPasswordHistoryTrait.php#L149-L157 |
22,668 | surebert/surebert-framework | src/sb/Web/Visitor.php | Visitor.log | public function log($db=null)
{
if($db instanceof \PDO){
\sb\Web\Visitors::$db=$db;
}
return \sb\Web\Visitors::log($this);
} | php | public function log($db=null)
{
if($db instanceof \PDO){
\sb\Web\Visitors::$db=$db;
}
return \sb\Web\Visitors::log($this);
} | [
"public",
"function",
"log",
"(",
"$",
"db",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"db",
"instanceof",
"\\",
"PDO",
")",
"{",
"\\",
"sb",
"\\",
"Web",
"\\",
"Visitors",
"::",
"$",
"db",
"=",
"$",
"db",
";",
"}",
"return",
"\\",
"sb",
"\\",
"... | Logs a \sb\Web_Visitor in the database
@param PDO $db Optional database connection to use for \sb\Web_Vistors | [
"Logs",
"a",
"\\",
"sb",
"\\",
"Web_Visitor",
"in",
"the",
"database"
] | f2f32eb693bd39385ceb93355efb5b2a429f27ce | https://github.com/surebert/surebert-framework/blob/f2f32eb693bd39385ceb93355efb5b2a429f27ce/src/sb/Web/Visitor.php#L75-L84 |
22,669 | antaresproject/notifications | src/Http/Breadcrumb/Breadcrumb.php | Breadcrumb.onList | protected function onList()
{
Breadcrumbs::register('notifications', function($breadcrumbs) {
$breadcrumbs->push(trans('antares/notifications::messages.notification_templates'), handles('antares::notifications/index'));
});
view()->share('breadcrumbs', Breadcrumbs::render('notifi... | php | protected function onList()
{
Breadcrumbs::register('notifications', function($breadcrumbs) {
$breadcrumbs->push(trans('antares/notifications::messages.notification_templates'), handles('antares::notifications/index'));
});
view()->share('breadcrumbs', Breadcrumbs::render('notifi... | [
"protected",
"function",
"onList",
"(",
")",
"{",
"Breadcrumbs",
"::",
"register",
"(",
"'notifications'",
",",
"function",
"(",
"$",
"breadcrumbs",
")",
"{",
"$",
"breadcrumbs",
"->",
"push",
"(",
"trans",
"(",
"'antares/notifications::messages.notification_templat... | on list notifications | [
"on",
"list",
"notifications"
] | 60de743477b7e9cbb51de66da5fd9461adc9dd8a | https://github.com/antaresproject/notifications/blob/60de743477b7e9cbb51de66da5fd9461adc9dd8a/src/Http/Breadcrumb/Breadcrumb.php#L32-L38 |
22,670 | antaresproject/notifications | src/Http/Breadcrumb/Breadcrumb.php | Breadcrumb.onTable | public function onTable($type = null)
{
if (!is_null($type)) {
Breadcrumbs::register('notifications-' . $type, function($breadcrumbs) use($type) {
$breadcrumbs->push('Notifications ' . ucfirst($type), handles('antares::notifications/index'));
});
view()->s... | php | public function onTable($type = null)
{
if (!is_null($type)) {
Breadcrumbs::register('notifications-' . $type, function($breadcrumbs) use($type) {
$breadcrumbs->push('Notifications ' . ucfirst($type), handles('antares::notifications/index'));
});
view()->s... | [
"public",
"function",
"onTable",
"(",
"$",
"type",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"is_null",
"(",
"$",
"type",
")",
")",
"{",
"Breadcrumbs",
"::",
"register",
"(",
"'notifications-'",
".",
"$",
"type",
",",
"function",
"(",
"$",
"breadcrumbs",
... | when shows notifications list
@param type $type | [
"when",
"shows",
"notifications",
"list"
] | 60de743477b7e9cbb51de66da5fd9461adc9dd8a | https://github.com/antaresproject/notifications/blob/60de743477b7e9cbb51de66da5fd9461adc9dd8a/src/Http/Breadcrumb/Breadcrumb.php#L45-L53 |
22,671 | antaresproject/notifications | src/Http/Breadcrumb/Breadcrumb.php | Breadcrumb.onCreate | public function onCreate($type = null)
{
$this->onList();
Breadcrumbs::register('notification-create', function($breadcrumbs) {
$breadcrumbs->parent('notifications');
$breadcrumbs->push(trans('antares/notifications::messages.notification_templates_create'));
});
... | php | public function onCreate($type = null)
{
$this->onList();
Breadcrumbs::register('notification-create', function($breadcrumbs) {
$breadcrumbs->parent('notifications');
$breadcrumbs->push(trans('antares/notifications::messages.notification_templates_create'));
});
... | [
"public",
"function",
"onCreate",
"(",
"$",
"type",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"onList",
"(",
")",
";",
"Breadcrumbs",
"::",
"register",
"(",
"'notification-create'",
",",
"function",
"(",
"$",
"breadcrumbs",
")",
"{",
"$",
"breadcrumbs",
... | when shows create new notification form
@param String $type | [
"when",
"shows",
"create",
"new",
"notification",
"form"
] | 60de743477b7e9cbb51de66da5fd9461adc9dd8a | https://github.com/antaresproject/notifications/blob/60de743477b7e9cbb51de66da5fd9461adc9dd8a/src/Http/Breadcrumb/Breadcrumb.php#L83-L91 |
22,672 | ouropencode/dachi | src/Request.php | Request.getUri | public static function getUri($index, $regex = ".*") {
if(self::$uri === array())
self::$uri = explode("/", trim($_GET['dachi_uri'], " \t\n\r\0\x0B/"));
if(isset(self::$uri_variables[$index]))
if($regex == ".*" || preg_match("/^" . $regex . "$/i", self::$uri_variables[$index]))
return self::$uri_variable... | php | public static function getUri($index, $regex = ".*") {
if(self::$uri === array())
self::$uri = explode("/", trim($_GET['dachi_uri'], " \t\n\r\0\x0B/"));
if(isset(self::$uri_variables[$index]))
if($regex == ".*" || preg_match("/^" . $regex . "$/i", self::$uri_variables[$index]))
return self::$uri_variable... | [
"public",
"static",
"function",
"getUri",
"(",
"$",
"index",
",",
"$",
"regex",
"=",
"\".*\"",
")",
"{",
"if",
"(",
"self",
"::",
"$",
"uri",
"===",
"array",
"(",
")",
")",
"self",
"::",
"$",
"uri",
"=",
"explode",
"(",
"\"/\"",
",",
"trim",
"(",... | Get a section of the URI
The URI is split by the '/' character.
@param string $index The index to retrieve
@param string $regex The regular expression pattern the index must conform too
@throws InvalidRequestURIException The specified index was not found or did not conform to the regex.
@return string | [
"Get",
"a",
"section",
"of",
"the",
"URI"
] | a0e1daf269d0345afbb859ce20ef9da6decd7efe | https://github.com/ouropencode/dachi/blob/a0e1daf269d0345afbb859ce20ef9da6decd7efe/src/Request.php#L37-L51 |
22,673 | ouropencode/dachi | src/Request.php | Request.getFullUri | public static function getFullUri() {
if(!isset($_GET['dachi_uri']))
$_GET['dachi_uri'] = "";
if(self::$uri === array() && isset($_GET['dachi_uri']))
self::$uri = explode("/", trim($_GET['dachi_uri'], " \t\n\r\0\x0B/"));
return self::$uri;
} | php | public static function getFullUri() {
if(!isset($_GET['dachi_uri']))
$_GET['dachi_uri'] = "";
if(self::$uri === array() && isset($_GET['dachi_uri']))
self::$uri = explode("/", trim($_GET['dachi_uri'], " \t\n\r\0\x0B/"));
return self::$uri;
} | [
"public",
"static",
"function",
"getFullUri",
"(",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"_GET",
"[",
"'dachi_uri'",
"]",
")",
")",
"$",
"_GET",
"[",
"'dachi_uri'",
"]",
"=",
"\"\"",
";",
"if",
"(",
"self",
"::",
"$",
"uri",
"===",
"array",
... | Get the whole URI
The URI is split by the '/' character.
@return array | [
"Get",
"the",
"whole",
"URI"
] | a0e1daf269d0345afbb859ce20ef9da6decd7efe | https://github.com/ouropencode/dachi/blob/a0e1daf269d0345afbb859ce20ef9da6decd7efe/src/Request.php#L60-L68 |
22,674 | ouropencode/dachi | src/Request.php | Request.setRequestVariables | public static function setRequestVariables($uri_variables, $api_mode = false) {
if(self::$uri === array() && isset($_GET['dachi_uri']))
self::$uri = explode("/", trim($_GET['dachi_uri'], " \t\n\r\0\x0B/"));
foreach($uri_variables as $var)
self::$uri_variables[$var[1]] = self::$uri[$var[0]];
self::$api_mod... | php | public static function setRequestVariables($uri_variables, $api_mode = false) {
if(self::$uri === array() && isset($_GET['dachi_uri']))
self::$uri = explode("/", trim($_GET['dachi_uri'], " \t\n\r\0\x0B/"));
foreach($uri_variables as $var)
self::$uri_variables[$var[1]] = self::$uri[$var[0]];
self::$api_mod... | [
"public",
"static",
"function",
"setRequestVariables",
"(",
"$",
"uri_variables",
",",
"$",
"api_mode",
"=",
"false",
")",
"{",
"if",
"(",
"self",
"::",
"$",
"uri",
"===",
"array",
"(",
")",
"&&",
"isset",
"(",
"$",
"_GET",
"[",
"'dachi_uri'",
"]",
")"... | Set the variable mapping for URI componants.
This is an internal function that allows the Router to assign the URI variables.
@internal
@see Router
@param array $uri_variables Format: array(array(uri index, variable name))
@param bool $api_mode Is this request serving an API method. | [
"Set",
"the",
"variable",
"mapping",
"for",
"URI",
"componants",
"."
] | a0e1daf269d0345afbb859ce20ef9da6decd7efe | https://github.com/ouropencode/dachi/blob/a0e1daf269d0345afbb859ce20ef9da6decd7efe/src/Request.php#L80-L88 |
22,675 | ouropencode/dachi | src/Request.php | Request.getArgument | public static function getArgument($key, $default = "default", $regex = ".*") {
if(self::$arguments === array())
self::$arguments = array_merge($_GET, $_POST, $_FILES);
if(isset(self::$arguments[$key])) {
if($regex == ".*" || preg_match("/^" . $regex . "$/i", self::$arguments[$key]))
return self::$argume... | php | public static function getArgument($key, $default = "default", $regex = ".*") {
if(self::$arguments === array())
self::$arguments = array_merge($_GET, $_POST, $_FILES);
if(isset(self::$arguments[$key])) {
if($regex == ".*" || preg_match("/^" . $regex . "$/i", self::$arguments[$key]))
return self::$argume... | [
"public",
"static",
"function",
"getArgument",
"(",
"$",
"key",
",",
"$",
"default",
"=",
"\"default\"",
",",
"$",
"regex",
"=",
"\".*\"",
")",
"{",
"if",
"(",
"self",
"::",
"$",
"arguments",
"===",
"array",
"(",
")",
")",
"self",
"::",
"$",
"argumen... | Get an argument passed to the page
This is used for _GET, _POST and _FILES.
@param string $key The key to retrieve
@param string $default The default value to return if the key was not found
@param string $regex The regular expression pattern the key must conform too
@throws InvalidRequestArgumentException T... | [
"Get",
"an",
"argument",
"passed",
"to",
"the",
"page"
] | a0e1daf269d0345afbb859ce20ef9da6decd7efe | https://github.com/ouropencode/dachi/blob/a0e1daf269d0345afbb859ce20ef9da6decd7efe/src/Request.php#L127-L139 |
22,676 | ouropencode/dachi | src/Request.php | Request.getAllArguments | public static function getAllArguments() {
if(self::$arguments === array())
self::$arguments = array_merge($_GET, $_POST, $_FILES);
return self::$arguments;
} | php | public static function getAllArguments() {
if(self::$arguments === array())
self::$arguments = array_merge($_GET, $_POST, $_FILES);
return self::$arguments;
} | [
"public",
"static",
"function",
"getAllArguments",
"(",
")",
"{",
"if",
"(",
"self",
"::",
"$",
"arguments",
"===",
"array",
"(",
")",
")",
"self",
"::",
"$",
"arguments",
"=",
"array_merge",
"(",
"$",
"_GET",
",",
"$",
"_POST",
",",
"$",
"_FILES",
"... | Get all arguments passed to the page
This is used for _GET, _POST and _FILES.
@return string | [
"Get",
"all",
"arguments",
"passed",
"to",
"the",
"page"
] | a0e1daf269d0345afbb859ce20ef9da6decd7efe | https://github.com/ouropencode/dachi/blob/a0e1daf269d0345afbb859ce20ef9da6decd7efe/src/Request.php#L148-L153 |
22,677 | ouropencode/dachi | src/Request.php | Request.setCookie | public static function setCookie($key, $value, $expire = -1, $path = "/", $domain = null) {
if($expire == -1)
$expire = time() + 2592000; // 30 days
return setcookie($key, $value, $expire, $path, $domain);
} | php | public static function setCookie($key, $value, $expire = -1, $path = "/", $domain = null) {
if($expire == -1)
$expire = time() + 2592000; // 30 days
return setcookie($key, $value, $expire, $path, $domain);
} | [
"public",
"static",
"function",
"setCookie",
"(",
"$",
"key",
",",
"$",
"value",
",",
"$",
"expire",
"=",
"-",
"1",
",",
"$",
"path",
"=",
"\"/\"",
",",
"$",
"domain",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"expire",
"==",
"-",
"1",
")",
"$",
... | Set a value in the user's cookie
@param string $key The key to set
@param string $value The value to set
@param integer $expire The time to expire (defaults to -1, -1 is 'now + 30 days')
@param string $path The cookie path inside the domain (defaults to '/')
@param string $domain The domain this cookie i... | [
"Set",
"a",
"value",
"in",
"the",
"user",
"s",
"cookie"
] | a0e1daf269d0345afbb859ce20ef9da6decd7efe | https://github.com/ouropencode/dachi/blob/a0e1daf269d0345afbb859ce20ef9da6decd7efe/src/Request.php#L203-L208 |
22,678 | ouropencode/dachi | src/Request.php | Request.getData | public static function getData($key) {
if(!isset(self::$output_data[$key]))
return false;
return self::$output_data[$key];
} | php | public static function getData($key) {
if(!isset(self::$output_data[$key]))
return false;
return self::$output_data[$key];
} | [
"public",
"static",
"function",
"getData",
"(",
"$",
"key",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"self",
"::",
"$",
"output_data",
"[",
"$",
"key",
"]",
")",
")",
"return",
"false",
";",
"return",
"self",
"::",
"$",
"output_data",
"[",
"$",
"key... | Get an outgoing request data variable
@param string $key The key to get
@return mixed | [
"Get",
"an",
"outgoing",
"request",
"data",
"variable"
] | a0e1daf269d0345afbb859ce20ef9da6decd7efe | https://github.com/ouropencode/dachi/blob/a0e1daf269d0345afbb859ce20ef9da6decd7efe/src/Request.php#L215-L220 |
22,679 | ouropencode/dachi | src/Request.php | Request.isAjax | public static function isAjax() {
if(Configuration::get("dachi.api-mode", false) == true)
return true;
return (self::getArgument("dachi-ui", "false") == "true" || self::getArgument("radon-ui-ajax", "false") == "true");
} | php | public static function isAjax() {
if(Configuration::get("dachi.api-mode", false) == true)
return true;
return (self::getArgument("dachi-ui", "false") == "true" || self::getArgument("radon-ui-ajax", "false") == "true");
} | [
"public",
"static",
"function",
"isAjax",
"(",
")",
"{",
"if",
"(",
"Configuration",
"::",
"get",
"(",
"\"dachi.api-mode\"",
",",
"false",
")",
"==",
"true",
")",
"return",
"true",
";",
"return",
"(",
"self",
"::",
"getArgument",
"(",
"\"dachi-ui\"",
",",
... | Check if this request is being served via ajax
@return bool | [
"Check",
"if",
"this",
"request",
"is",
"being",
"served",
"via",
"ajax"
] | a0e1daf269d0345afbb859ce20ef9da6decd7efe | https://github.com/ouropencode/dachi/blob/a0e1daf269d0345afbb859ce20ef9da6decd7efe/src/Request.php#L274-L279 |
22,680 | openclerk/db | src/Migration.php | Migration.install | function install(Connection $db, Logger $log) {
// bail if we've already applied
if ($this->isApplied($db)) {
$log->info("Skipping " . $this->getName() . ": already applied");
return;
}
// simply make sure all parent migrations are applied
foreach ($this->getParents() as $migration) {
... | php | function install(Connection $db, Logger $log) {
// bail if we've already applied
if ($this->isApplied($db)) {
$log->info("Skipping " . $this->getName() . ": already applied");
return;
}
// simply make sure all parent migrations are applied
foreach ($this->getParents() as $migration) {
... | [
"function",
"install",
"(",
"Connection",
"$",
"db",
",",
"Logger",
"$",
"log",
")",
"{",
"// bail if we've already applied",
"if",
"(",
"$",
"this",
"->",
"isApplied",
"(",
"$",
"db",
")",
")",
"{",
"$",
"log",
"->",
"info",
"(",
"\"Skipping \"",
".",
... | Install the current migration and any parent migrations that this migration depends on. | [
"Install",
"the",
"current",
"migration",
"and",
"any",
"parent",
"migrations",
"that",
"this",
"migration",
"depends",
"on",
"."
] | 923275ed6e9414d8952585b77331c28dbd032bac | https://github.com/openclerk/db/blob/923275ed6e9414d8952585b77331c28dbd032bac/src/Migration.php#L69-L103 |
22,681 | accompli/chrono | src/Adapter/SubversionAdapter.php | SubversionAdapter.getRepositoryUrlWithVersionPath | private function getRepositoryUrlWithVersionPath($version)
{
$repositoryUrl = $this->repositoryUrl;
if (in_array($version, array('master', $this->trunkPath))) {
$repositoryUrl .= '/'.$this->trunkPath;
} elseif (in_array($version, $this->getBranches())) {
$repositoryUr... | php | private function getRepositoryUrlWithVersionPath($version)
{
$repositoryUrl = $this->repositoryUrl;
if (in_array($version, array('master', $this->trunkPath))) {
$repositoryUrl .= '/'.$this->trunkPath;
} elseif (in_array($version, $this->getBranches())) {
$repositoryUr... | [
"private",
"function",
"getRepositoryUrlWithVersionPath",
"(",
"$",
"version",
")",
"{",
"$",
"repositoryUrl",
"=",
"$",
"this",
"->",
"repositoryUrl",
";",
"if",
"(",
"in_array",
"(",
"$",
"version",
",",
"array",
"(",
"'master'",
",",
"$",
"this",
"->",
... | Returns the escaped repository URL with version path.
Returns false when the repository URL for a version cannot be found.
@param string $version
@return string|bool | [
"Returns",
"the",
"escaped",
"repository",
"URL",
"with",
"version",
"path",
".",
"Returns",
"false",
"when",
"the",
"repository",
"URL",
"for",
"a",
"version",
"cannot",
"be",
"found",
"."
] | 5f3201ee1e3fdc519fabac92bc9bfb7d9bebdebc | https://github.com/accompli/chrono/blob/5f3201ee1e3fdc519fabac92bc9bfb7d9bebdebc/src/Adapter/SubversionAdapter.php#L145-L159 |
22,682 | web2all/framework | src/Web2All/Email/MimeMail.class.php | Web2All_Email_MimeMail.build_message | private function build_message($part) {
$message = $part[ "message"];
// #### only base64 encoding supported
// #### other encodings you have to encode yourself
if ($part[ "encode"] == "base64"){
$message = chunk_split(base64_encode($message));
}else if ($part[ "encode"] == "quoted-printable")... | php | private function build_message($part) {
$message = $part[ "message"];
// #### only base64 encoding supported
// #### other encodings you have to encode yourself
if ($part[ "encode"] == "base64"){
$message = chunk_split(base64_encode($message));
}else if ($part[ "encode"] == "quoted-printable")... | [
"private",
"function",
"build_message",
"(",
"$",
"part",
")",
"{",
"$",
"message",
"=",
"$",
"part",
"[",
"\"message\"",
"]",
";",
"// #### only base64 encoding supported",
"// #### other encodings you have to encode yourself",
"if",
"(",
"$",
"part",
"[",
"\"encode\... | void build_message(array part=
Build message parts of an multipart mail
NOTE: base64 encoding messages will be encoded
automaticly my the class. all others will not. | [
"void",
"build_message",
"(",
"array",
"part",
"=",
"Build",
"message",
"parts",
"of",
"an",
"multipart",
"mail"
] | 6990dc3700efad3207ec6e710124f7ba18891b31 | https://github.com/web2all/framework/blob/6990dc3700efad3207ec6e710124f7ba18891b31/src/Web2All/Email/MimeMail.class.php#L149-L165 |
22,683 | web2all/framework | src/Web2All/Email/MimeMail.class.php | Web2All_Email_MimeMail.encodeSubject | function encodeSubject($input, $charset = 'ISO-8859-1')
{
// set the internal encoding to the encoding of the given input
// this way no conversion is done, because we only need the 'Q' encoding
$old_enc=mb_internal_encoding();
mb_internal_encoding($charset);
$output=mb_encode_mimeheader($input,$c... | php | function encodeSubject($input, $charset = 'ISO-8859-1')
{
// set the internal encoding to the encoding of the given input
// this way no conversion is done, because we only need the 'Q' encoding
$old_enc=mb_internal_encoding();
mb_internal_encoding($charset);
$output=mb_encode_mimeheader($input,$c... | [
"function",
"encodeSubject",
"(",
"$",
"input",
",",
"$",
"charset",
"=",
"'ISO-8859-1'",
")",
"{",
"// set the internal encoding to the encoding of the given input",
"// this way no conversion is done, because we only need the 'Q' encoding",
"$",
"old_enc",
"=",
"mb_internal_encod... | The method can be used to encode the subject which is
in a non ascii encoding.
encoding style: =?charset?Q?the encoded text?=
@param string $input
@param string $charset eg. UTF-8 or ISO-8859-1
@return string the encoded subject | [
"The",
"method",
"can",
"be",
"used",
"to",
"encode",
"the",
"subject",
"which",
"is",
"in",
"a",
"non",
"ascii",
"encoding",
"."
] | 6990dc3700efad3207ec6e710124f7ba18891b31 | https://github.com/web2all/framework/blob/6990dc3700efad3207ec6e710124f7ba18891b31/src/Web2All/Email/MimeMail.class.php#L455-L474 |
22,684 | 42mate/towel | src/Towel/Cache/TowelMemcached.php | TowelMemcached.setOptions | public function setOptions($options)
{
// Adding hosts.
if (!empty($options['hosts'])) {
foreach ($options['hosts'] as $host => $port) {
$this->addserver($host, $port, false);
}
} else {
$this->addserver('127.0.0.1', '11211', false);
... | php | public function setOptions($options)
{
// Adding hosts.
if (!empty($options['hosts'])) {
foreach ($options['hosts'] as $host => $port) {
$this->addserver($host, $port, false);
}
} else {
$this->addserver('127.0.0.1', '11211', false);
... | [
"public",
"function",
"setOptions",
"(",
"$",
"options",
")",
"{",
"// Adding hosts.",
"if",
"(",
"!",
"empty",
"(",
"$",
"options",
"[",
"'hosts'",
"]",
")",
")",
"{",
"foreach",
"(",
"$",
"options",
"[",
"'hosts'",
"]",
"as",
"$",
"host",
"=>",
"$"... | Stablish Memcached options defined in config.php
@param $options | [
"Stablish",
"Memcached",
"options",
"defined",
"in",
"config",
".",
"php"
] | 5316c3075fc844e8a5cbae113712b26556227dff | https://github.com/42mate/towel/blob/5316c3075fc844e8a5cbae113712b26556227dff/src/Towel/Cache/TowelMemcached.php#L11-L21 |
22,685 | Innmind/neo4j-dbal | src/Query/Query.php | Query.match | public function match(string $variable = null, array $labels = []): self
{
$query = new self;
$query->clauses = $this->clauses->add(
new Clause\MatchClause(
Clause\Expression\Path::startWithNode($variable, $labels)
)
);
return $query;
} | php | public function match(string $variable = null, array $labels = []): self
{
$query = new self;
$query->clauses = $this->clauses->add(
new Clause\MatchClause(
Clause\Expression\Path::startWithNode($variable, $labels)
)
);
return $query;
} | [
"public",
"function",
"match",
"(",
"string",
"$",
"variable",
"=",
"null",
",",
"array",
"$",
"labels",
"=",
"[",
"]",
")",
":",
"self",
"{",
"$",
"query",
"=",
"new",
"self",
";",
"$",
"query",
"->",
"clauses",
"=",
"$",
"this",
"->",
"clauses",
... | Match the given node
@param string $variable
@param array $labels
@return self | [
"Match",
"the",
"given",
"node"
] | 12cb71e698cc0f4d55b7f2eb40f7b353c778a20b | https://github.com/Innmind/neo4j-dbal/blob/12cb71e698cc0f4d55b7f2eb40f7b353c778a20b/src/Query/Query.php#L105-L115 |
22,686 | Innmind/neo4j-dbal | src/Query/Query.php | Query.maybeMatch | public function maybeMatch(string $variable = null, array $labels = []): self
{
$query = new self;
$query->clauses = $this->clauses->add(
new Clause\OptionalMatchClause(
Clause\Expression\Path::startWithNode($variable, $labels)
)
);
return $qu... | php | public function maybeMatch(string $variable = null, array $labels = []): self
{
$query = new self;
$query->clauses = $this->clauses->add(
new Clause\OptionalMatchClause(
Clause\Expression\Path::startWithNode($variable, $labels)
)
);
return $qu... | [
"public",
"function",
"maybeMatch",
"(",
"string",
"$",
"variable",
"=",
"null",
",",
"array",
"$",
"labels",
"=",
"[",
"]",
")",
":",
"self",
"{",
"$",
"query",
"=",
"new",
"self",
";",
"$",
"query",
"->",
"clauses",
"=",
"$",
"this",
"->",
"claus... | Add a OPTIONAL MATCh clause
@param string $variable
@param array $labels
@return self | [
"Add",
"a",
"OPTIONAL",
"MATCh",
"clause"
] | 12cb71e698cc0f4d55b7f2eb40f7b353c778a20b | https://github.com/Innmind/neo4j-dbal/blob/12cb71e698cc0f4d55b7f2eb40f7b353c778a20b/src/Query/Query.php#L125-L135 |
22,687 | Innmind/neo4j-dbal | src/Query/Query.php | Query.withParameter | public function withParameter(string $key, $parameter): self
{
$clause = $this->clauses->last();
if (!$clause instanceof Clause\Parametrable) {
throw new NonParametrableClause;
}
$clause = $clause->withParameter($key, $parameter);
$query = new self;
$que... | php | public function withParameter(string $key, $parameter): self
{
$clause = $this->clauses->last();
if (!$clause instanceof Clause\Parametrable) {
throw new NonParametrableClause;
}
$clause = $clause->withParameter($key, $parameter);
$query = new self;
$que... | [
"public",
"function",
"withParameter",
"(",
"string",
"$",
"key",
",",
"$",
"parameter",
")",
":",
"self",
"{",
"$",
"clause",
"=",
"$",
"this",
"->",
"clauses",
"->",
"last",
"(",
")",
";",
"if",
"(",
"!",
"$",
"clause",
"instanceof",
"Clause",
"\\"... | Attach the given parameter to the last clause
@param string $key
@param mixed $parameter
@throws NonParametrableClause
@return self | [
"Attach",
"the",
"given",
"parameter",
"to",
"the",
"last",
"clause"
] | 12cb71e698cc0f4d55b7f2eb40f7b353c778a20b | https://github.com/Innmind/neo4j-dbal/blob/12cb71e698cc0f4d55b7f2eb40f7b353c778a20b/src/Query/Query.php#L167-L183 |
22,688 | Innmind/neo4j-dbal | src/Query/Query.php | Query.withProperties | public function withProperties(array $properties): self
{
$query = $this;
foreach ($properties as $property => $cypher) {
$query = $query->withProperty($property, $cypher);
}
return $query;
} | php | public function withProperties(array $properties): self
{
$query = $this;
foreach ($properties as $property => $cypher) {
$query = $query->withProperty($property, $cypher);
}
return $query;
} | [
"public",
"function",
"withProperties",
"(",
"array",
"$",
"properties",
")",
":",
"self",
"{",
"$",
"query",
"=",
"$",
"this",
";",
"foreach",
"(",
"$",
"properties",
"as",
"$",
"property",
"=>",
"$",
"cypher",
")",
"{",
"$",
"query",
"=",
"$",
"que... | Specify a set of properties to be matched
@param array $properties
@throws NonPathAwareClause
@return self | [
"Specify",
"a",
"set",
"of",
"properties",
"to",
"be",
"matched"
] | 12cb71e698cc0f4d55b7f2eb40f7b353c778a20b | https://github.com/Innmind/neo4j-dbal/blob/12cb71e698cc0f4d55b7f2eb40f7b353c778a20b/src/Query/Query.php#L194-L203 |
22,689 | Innmind/neo4j-dbal | src/Query/Query.php | Query.withProperty | public function withProperty(string $property, string $cypher): self
{
$clause = $this->clauses->last();
if (!$clause instanceof Clause\PathAware) {
throw new NonPathAwareClause;
}
$clause = $clause->withProperty($property, $cypher);
$query = new self;
$... | php | public function withProperty(string $property, string $cypher): self
{
$clause = $this->clauses->last();
if (!$clause instanceof Clause\PathAware) {
throw new NonPathAwareClause;
}
$clause = $clause->withProperty($property, $cypher);
$query = new self;
$... | [
"public",
"function",
"withProperty",
"(",
"string",
"$",
"property",
",",
"string",
"$",
"cypher",
")",
":",
"self",
"{",
"$",
"clause",
"=",
"$",
"this",
"->",
"clauses",
"->",
"last",
"(",
")",
";",
"if",
"(",
"!",
"$",
"clause",
"instanceof",
"Cl... | Specify a property to be matched
@param string $property
@param string $cypher
@throws NonPathAwareClause
@return self | [
"Specify",
"a",
"property",
"to",
"be",
"matched"
] | 12cb71e698cc0f4d55b7f2eb40f7b353c778a20b | https://github.com/Innmind/neo4j-dbal/blob/12cb71e698cc0f4d55b7f2eb40f7b353c778a20b/src/Query/Query.php#L215-L231 |
22,690 | Innmind/neo4j-dbal | src/Query/Query.php | Query.linkedTo | public function linkedTo(string $variable = null, array $labels = []): self
{
$clause = $this->clauses->last();
if (!$clause instanceof Clause\PathAware) {
throw new NonPathAwareClause;
}
$clause = $clause->linkedTo($variable, $labels);
$query = new self;
... | php | public function linkedTo(string $variable = null, array $labels = []): self
{
$clause = $this->clauses->last();
if (!$clause instanceof Clause\PathAware) {
throw new NonPathAwareClause;
}
$clause = $clause->linkedTo($variable, $labels);
$query = new self;
... | [
"public",
"function",
"linkedTo",
"(",
"string",
"$",
"variable",
"=",
"null",
",",
"array",
"$",
"labels",
"=",
"[",
"]",
")",
":",
"self",
"{",
"$",
"clause",
"=",
"$",
"this",
"->",
"clauses",
"->",
"last",
"(",
")",
";",
"if",
"(",
"!",
"$",
... | Match the node linked to the previous declared node match
@param string $variable
@param array $labels
@throws NonPathAwareClause
@return self | [
"Match",
"the",
"node",
"linked",
"to",
"the",
"previous",
"declared",
"node",
"match"
] | 12cb71e698cc0f4d55b7f2eb40f7b353c778a20b | https://github.com/Innmind/neo4j-dbal/blob/12cb71e698cc0f4d55b7f2eb40f7b353c778a20b/src/Query/Query.php#L243-L259 |
22,691 | Innmind/neo4j-dbal | src/Query/Query.php | Query.through | public function through(
string $type,
string $variable = null,
string $direction = 'BOTH'
): self {
$clause = $this->clauses->last();
if (!$clause instanceof Clause\PathAware) {
throw new NonPathAwareClause;
}
$clause = $clause->through($variabl... | php | public function through(
string $type,
string $variable = null,
string $direction = 'BOTH'
): self {
$clause = $this->clauses->last();
if (!$clause instanceof Clause\PathAware) {
throw new NonPathAwareClause;
}
$clause = $clause->through($variabl... | [
"public",
"function",
"through",
"(",
"string",
"$",
"type",
",",
"string",
"$",
"variable",
"=",
"null",
",",
"string",
"$",
"direction",
"=",
"'BOTH'",
")",
":",
"self",
"{",
"$",
"clause",
"=",
"$",
"this",
"->",
"clauses",
"->",
"last",
"(",
")",... | Specify the type of relationship for the last match clause
@param string $type
@param string $variable
@param string $direction
@throws NonPathAwareClause
@return self | [
"Specify",
"the",
"type",
"of",
"relationship",
"for",
"the",
"last",
"match",
"clause"
] | 12cb71e698cc0f4d55b7f2eb40f7b353c778a20b | https://github.com/Innmind/neo4j-dbal/blob/12cb71e698cc0f4d55b7f2eb40f7b353c778a20b/src/Query/Query.php#L272-L291 |
22,692 | Innmind/neo4j-dbal | src/Query/Query.php | Query.withADistanceOf | public function withADistanceOf(int $distance): self
{
$clause = $this->clauses->last();
if (!$clause instanceof Clause\PathAware) {
throw new NonPathAwareClause;
}
$clause = $clause->withADistanceOf($distance);
$query = new self;
$query->clauses = $this... | php | public function withADistanceOf(int $distance): self
{
$clause = $this->clauses->last();
if (!$clause instanceof Clause\PathAware) {
throw new NonPathAwareClause;
}
$clause = $clause->withADistanceOf($distance);
$query = new self;
$query->clauses = $this... | [
"public",
"function",
"withADistanceOf",
"(",
"int",
"$",
"distance",
")",
":",
"self",
"{",
"$",
"clause",
"=",
"$",
"this",
"->",
"clauses",
"->",
"last",
"(",
")",
";",
"if",
"(",
"!",
"$",
"clause",
"instanceof",
"Clause",
"\\",
"PathAware",
")",
... | Define the deepness of the relationship
@param int $distance
@throws LogicException If no relationship in the path
@return self | [
"Define",
"the",
"deepness",
"of",
"the",
"relationship"
] | 12cb71e698cc0f4d55b7f2eb40f7b353c778a20b | https://github.com/Innmind/neo4j-dbal/blob/12cb71e698cc0f4d55b7f2eb40f7b353c778a20b/src/Query/Query.php#L302-L318 |
22,693 | Innmind/neo4j-dbal | src/Query/Query.php | Query.with | public function with(string ...$variables): self
{
$query = new self;
$query->clauses = $this->clauses->add(
new Clause\WithClause(...$variables)
);
return $query;
} | php | public function with(string ...$variables): self
{
$query = new self;
$query->clauses = $this->clauses->add(
new Clause\WithClause(...$variables)
);
return $query;
} | [
"public",
"function",
"with",
"(",
"string",
"...",
"$",
"variables",
")",
":",
"self",
"{",
"$",
"query",
"=",
"new",
"self",
";",
"$",
"query",
"->",
"clauses",
"=",
"$",
"this",
"->",
"clauses",
"->",
"add",
"(",
"new",
"Clause",
"\\",
"WithClause... | Add a WITH clause
@param string[] $variables
@return self | [
"Add",
"a",
"WITH",
"clause"
] | 12cb71e698cc0f4d55b7f2eb40f7b353c778a20b | https://github.com/Innmind/neo4j-dbal/blob/12cb71e698cc0f4d55b7f2eb40f7b353c778a20b/src/Query/Query.php#L436-L444 |
22,694 | Innmind/neo4j-dbal | src/Query/Query.php | Query.where | public function where(string $cypher): self
{
$query = new self;
$query->clauses = $this->clauses->add(
new Clause\WhereClause($cypher)
);
return $query;
} | php | public function where(string $cypher): self
{
$query = new self;
$query->clauses = $this->clauses->add(
new Clause\WhereClause($cypher)
);
return $query;
} | [
"public",
"function",
"where",
"(",
"string",
"$",
"cypher",
")",
":",
"self",
"{",
"$",
"query",
"=",
"new",
"self",
";",
"$",
"query",
"->",
"clauses",
"=",
"$",
"this",
"->",
"clauses",
"->",
"add",
"(",
"new",
"Clause",
"\\",
"WhereClause",
"(",
... | Add a WHERE clause
@param string $cypher
@return self | [
"Add",
"a",
"WHERE",
"clause"
] | 12cb71e698cc0f4d55b7f2eb40f7b353c778a20b | https://github.com/Innmind/neo4j-dbal/blob/12cb71e698cc0f4d55b7f2eb40f7b353c778a20b/src/Query/Query.php#L453-L461 |
22,695 | Innmind/neo4j-dbal | src/Query/Query.php | Query.set | public function set(string $cypher): self
{
$query = new self;
$query->clauses = $this->clauses->add(
new Clause\SetClause($cypher)
);
return $query;
} | php | public function set(string $cypher): self
{
$query = new self;
$query->clauses = $this->clauses->add(
new Clause\SetClause($cypher)
);
return $query;
} | [
"public",
"function",
"set",
"(",
"string",
"$",
"cypher",
")",
":",
"self",
"{",
"$",
"query",
"=",
"new",
"self",
";",
"$",
"query",
"->",
"clauses",
"=",
"$",
"this",
"->",
"clauses",
"->",
"add",
"(",
"new",
"Clause",
"\\",
"SetClause",
"(",
"$... | Add a SET clause
@param string $cypher
@return self | [
"Add",
"a",
"SET",
"clause"
] | 12cb71e698cc0f4d55b7f2eb40f7b353c778a20b | https://github.com/Innmind/neo4j-dbal/blob/12cb71e698cc0f4d55b7f2eb40f7b353c778a20b/src/Query/Query.php#L470-L478 |
22,696 | Innmind/neo4j-dbal | src/Query/Query.php | Query.using | public function using(string $cypher): self
{
$query = new self;
$query->clauses = $this->clauses->add(
new Clause\UsingClause($cypher)
);
return $query;
} | php | public function using(string $cypher): self
{
$query = new self;
$query->clauses = $this->clauses->add(
new Clause\UsingClause($cypher)
);
return $query;
} | [
"public",
"function",
"using",
"(",
"string",
"$",
"cypher",
")",
":",
"self",
"{",
"$",
"query",
"=",
"new",
"self",
";",
"$",
"query",
"->",
"clauses",
"=",
"$",
"this",
"->",
"clauses",
"->",
"add",
"(",
"new",
"Clause",
"\\",
"UsingClause",
"(",
... | Add a USING clause
@param string $cypher
@return self | [
"Add",
"a",
"USING",
"clause"
] | 12cb71e698cc0f4d55b7f2eb40f7b353c778a20b | https://github.com/Innmind/neo4j-dbal/blob/12cb71e698cc0f4d55b7f2eb40f7b353c778a20b/src/Query/Query.php#L487-L495 |
22,697 | Innmind/neo4j-dbal | src/Query/Query.php | Query.unwind | public function unwind(string $cypher): self
{
$query = new self;
$query->clauses = $this->clauses->add(
new Clause\UnwindClause($cypher)
);
return $query;
} | php | public function unwind(string $cypher): self
{
$query = new self;
$query->clauses = $this->clauses->add(
new Clause\UnwindClause($cypher)
);
return $query;
} | [
"public",
"function",
"unwind",
"(",
"string",
"$",
"cypher",
")",
":",
"self",
"{",
"$",
"query",
"=",
"new",
"self",
";",
"$",
"query",
"->",
"clauses",
"=",
"$",
"this",
"->",
"clauses",
"->",
"add",
"(",
"new",
"Clause",
"\\",
"UnwindClause",
"("... | Add a UNWIND clause
@param string $cypher
@return self | [
"Add",
"a",
"UNWIND",
"clause"
] | 12cb71e698cc0f4d55b7f2eb40f7b353c778a20b | https://github.com/Innmind/neo4j-dbal/blob/12cb71e698cc0f4d55b7f2eb40f7b353c778a20b/src/Query/Query.php#L504-L512 |
22,698 | Innmind/neo4j-dbal | src/Query/Query.php | Query.union | public function union(): self
{
$query = new self;
$query->clauses = $this->clauses->add(
new Clause\UnionClause
);
return $query;
} | php | public function union(): self
{
$query = new self;
$query->clauses = $this->clauses->add(
new Clause\UnionClause
);
return $query;
} | [
"public",
"function",
"union",
"(",
")",
":",
"self",
"{",
"$",
"query",
"=",
"new",
"self",
";",
"$",
"query",
"->",
"clauses",
"=",
"$",
"this",
"->",
"clauses",
"->",
"add",
"(",
"new",
"Clause",
"\\",
"UnionClause",
")",
";",
"return",
"$",
"qu... | Add a UNION clause
@return self | [
"Add",
"a",
"UNION",
"clause"
] | 12cb71e698cc0f4d55b7f2eb40f7b353c778a20b | https://github.com/Innmind/neo4j-dbal/blob/12cb71e698cc0f4d55b7f2eb40f7b353c778a20b/src/Query/Query.php#L519-L527 |
22,699 | Innmind/neo4j-dbal | src/Query/Query.php | Query.skip | public function skip(string $cypher): self
{
$query = new self;
$query->clauses = $this->clauses->add(
new Clause\SkipClause($cypher)
);
return $query;
} | php | public function skip(string $cypher): self
{
$query = new self;
$query->clauses = $this->clauses->add(
new Clause\SkipClause($cypher)
);
return $query;
} | [
"public",
"function",
"skip",
"(",
"string",
"$",
"cypher",
")",
":",
"self",
"{",
"$",
"query",
"=",
"new",
"self",
";",
"$",
"query",
"->",
"clauses",
"=",
"$",
"this",
"->",
"clauses",
"->",
"add",
"(",
"new",
"Clause",
"\\",
"SkipClause",
"(",
... | Add a SKIP clause
@see http://neo4j.com/docs/stable/query-skip.html#skip-skip-first-from-expression
@param string $cypher Of type string as it may contain operations
@return self | [
"Add",
"a",
"SKIP",
"clause"
] | 12cb71e698cc0f4d55b7f2eb40f7b353c778a20b | https://github.com/Innmind/neo4j-dbal/blob/12cb71e698cc0f4d55b7f2eb40f7b353c778a20b/src/Query/Query.php#L537-L545 |
Subsets and Splits
Yii Code Samples
Gathers all records from test, train, and validation sets that contain the word 'yii', providing a basic filtered view of the dataset relevant to Yii-related content.