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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
23,300 | WScore/Validation | src/Dio.php | Dio.setupRules | private function setupRules($rules)
{
// prepares filter for requiredIf
$rules = Utils\HelperRequiredIf::prepare($this, $rules);
// prepares filter for sameWith.
$rules = Utils\HelperSameWith::prepare($this, $rules);
return $rules;
} | php | private function setupRules($rules)
{
// prepares filter for requiredIf
$rules = Utils\HelperRequiredIf::prepare($this, $rules);
// prepares filter for sameWith.
$rules = Utils\HelperSameWith::prepare($this, $rules);
return $rules;
} | [
"private",
"function",
"setupRules",
"(",
"$",
"rules",
")",
"{",
"// prepares filter for requiredIf",
"$",
"rules",
"=",
"Utils",
"\\",
"HelperRequiredIf",
"::",
"prepare",
"(",
"$",
"this",
",",
"$",
"rules",
")",
";",
"// prepares filter for sameWith.",
"$",
... | set up rules;
- add required rule based on requiredIf rule.
- add sameAs rule based on sameWith rule.
@param array|Rules $rules
@return array|Rules | [
"set",
"up",
"rules",
";",
"-",
"add",
"required",
"rule",
"based",
"on",
"requiredIf",
"rule",
".",
"-",
"add",
"sameAs",
"rule",
"based",
"on",
"sameWith",
"rule",
"."
] | 25c0dca37d624bb0bb22f8e79ba54db2f69e0950 | https://github.com/WScore/Validation/blob/25c0dca37d624bb0bb22f8e79ba54db2f69e0950/src/Dio.php#L276-L285 |
23,301 | heidelpay/PhpDoc | src/phpDocumentor/Plugin/Core/Descriptor/Validator/Constraints/Functions/IsArgumentInDocBlockValidator.php | IsArgumentInDocBlockValidator.existsParamTagWithArgument | private function existsParamTagWithArgument($parameters, ArgumentDescriptor $argument)
{
foreach ($parameters as $parameter) {
if ($argument->getName() == $parameter->getVariableName()) {
return true;
}
}
return false;
} | php | private function existsParamTagWithArgument($parameters, ArgumentDescriptor $argument)
{
foreach ($parameters as $parameter) {
if ($argument->getName() == $parameter->getVariableName()) {
return true;
}
}
return false;
} | [
"private",
"function",
"existsParamTagWithArgument",
"(",
"$",
"parameters",
",",
"ArgumentDescriptor",
"$",
"argument",
")",
"{",
"foreach",
"(",
"$",
"parameters",
"as",
"$",
"parameter",
")",
"{",
"if",
"(",
"$",
"argument",
"->",
"getName",
"(",
")",
"==... | Returns whether the list of param tags features the given argument.
@param ParamDescriptor[]|Collection $parameters
@param ArgumentDescriptor $argument
@return boolean | [
"Returns",
"whether",
"the",
"list",
"of",
"param",
"tags",
"features",
"the",
"given",
"argument",
"."
] | 5ac9e842cbd4cbb70900533b240c131f3515ee02 | https://github.com/heidelpay/PhpDoc/blob/5ac9e842cbd4cbb70900533b240c131f3515ee02/src/phpDocumentor/Plugin/Core/Descriptor/Validator/Constraints/Functions/IsArgumentInDocBlockValidator.php#L62-L71 |
23,302 | heidelpay/PhpDoc | src/phpDocumentor/Parser/Command/Project/ParseCommand.php | ParseCommand.getProgressBar | protected function getProgressBar(InputInterface $input)
{
$progress = parent::getProgressBar($input);
if (!$progress) {
return null;
}
$this->getService('event_dispatcher')->addListener(
'parser.file.pre',
function (PreFileEvent $event) use ($pro... | php | protected function getProgressBar(InputInterface $input)
{
$progress = parent::getProgressBar($input);
if (!$progress) {
return null;
}
$this->getService('event_dispatcher')->addListener(
'parser.file.pre',
function (PreFileEvent $event) use ($pro... | [
"protected",
"function",
"getProgressBar",
"(",
"InputInterface",
"$",
"input",
")",
"{",
"$",
"progress",
"=",
"parent",
"::",
"getProgressBar",
"(",
"$",
"input",
")",
";",
"if",
"(",
"!",
"$",
"progress",
")",
"{",
"return",
"null",
";",
"}",
"$",
"... | Adds the parser.file.pre event to the advance the progressbar.
@param InputInterface $input
@return \Symfony\Component\Console\Helper\HelperInterface|null | [
"Adds",
"the",
"parser",
".",
"file",
".",
"pre",
"event",
"to",
"the",
"advance",
"the",
"progressbar",
"."
] | 5ac9e842cbd4cbb70900533b240c131f3515ee02 | https://github.com/heidelpay/PhpDoc/blob/5ac9e842cbd4cbb70900533b240c131f3515ee02/src/phpDocumentor/Parser/Command/Project/ParseCommand.php#L346-L361 |
23,303 | zhouyl/mellivora | Mellivora/Database/Query/Grammars/PostgresGrammar.php | PostgresGrammar.compileUpdateJoinWheres | protected function compileUpdateJoinWheres(Builder $query)
{
$joinWheres = [];
// Here we will just loop through all of the join constraints and compile them
// all out then implode them. This should give us "where" like syntax after
// everything has been built and then we will joi... | php | protected function compileUpdateJoinWheres(Builder $query)
{
$joinWheres = [];
// Here we will just loop through all of the join constraints and compile them
// all out then implode them. This should give us "where" like syntax after
// everything has been built and then we will joi... | [
"protected",
"function",
"compileUpdateJoinWheres",
"(",
"Builder",
"$",
"query",
")",
"{",
"$",
"joinWheres",
"=",
"[",
"]",
";",
"// Here we will just loop through all of the join constraints and compile them",
"// all out then implode them. This should give us \"where\" like synta... | Compile the "join" clause where clauses for an update.
@param \Mellivora\Database\Query\Builder $query
@return string | [
"Compile",
"the",
"join",
"clause",
"where",
"clauses",
"for",
"an",
"update",
"."
] | 79f844c5c9c25ffbe18d142062e9bc3df00b36a1 | https://github.com/zhouyl/mellivora/blob/79f844c5c9c25ffbe18d142062e9bc3df00b36a1/Mellivora/Database/Query/Grammars/PostgresGrammar.php#L189-L205 |
23,304 | xiewulong/yii2-fileupload | oss/libs/guzzle/plugin/Guzzle/Plugin/Backoff/BackoffPlugin.php | BackoffPlugin.onRequestSent | public function onRequestSent(Event $event)
{
$request = $event['request'];
$response = $event['response'];
$exception = $event['exception'];
$params = $request->getParams();
$retries = (int) $params->get(self::RETRY_PARAM);
$delay = $this->strategy->getBackoffPeriod... | php | public function onRequestSent(Event $event)
{
$request = $event['request'];
$response = $event['response'];
$exception = $event['exception'];
$params = $request->getParams();
$retries = (int) $params->get(self::RETRY_PARAM);
$delay = $this->strategy->getBackoffPeriod... | [
"public",
"function",
"onRequestSent",
"(",
"Event",
"$",
"event",
")",
"{",
"$",
"request",
"=",
"$",
"event",
"[",
"'request'",
"]",
";",
"$",
"response",
"=",
"$",
"event",
"[",
"'response'",
"]",
";",
"$",
"exception",
"=",
"$",
"event",
"[",
"'e... | Called when a request has been sent and isn't finished processing
@param Event $event | [
"Called",
"when",
"a",
"request",
"has",
"been",
"sent",
"and",
"isn",
"t",
"finished",
"processing"
] | 3e75b17a4a18dd8466e3f57c63136de03470ca82 | https://github.com/xiewulong/yii2-fileupload/blob/3e75b17a4a18dd8466e3f57c63136de03470ca82/oss/libs/guzzle/plugin/Guzzle/Plugin/Backoff/BackoffPlugin.php#L76-L100 |
23,305 | expectation-php/expect | src/config/ConfigurationLoader.php | ConfigurationLoader.createPackages | private function createPackages(array $packages)
{
$matcherPackages = [];
foreach ($packages as $package) {
$reflection = new ReflectionClass($package);
if ($reflection->implementsInterface(self::PACKAGE_REGISTRAR) === false) {
throw NotAvailableException::c... | php | private function createPackages(array $packages)
{
$matcherPackages = [];
foreach ($packages as $package) {
$reflection = new ReflectionClass($package);
if ($reflection->implementsInterface(self::PACKAGE_REGISTRAR) === false) {
throw NotAvailableException::c... | [
"private",
"function",
"createPackages",
"(",
"array",
"$",
"packages",
")",
"{",
"$",
"matcherPackages",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"packages",
"as",
"$",
"package",
")",
"{",
"$",
"reflection",
"=",
"new",
"ReflectionClass",
"(",
"$",
"pa... | Create a few new package registrars
@param array $packages
@return \expect\PackageRegistrar[] | [
"Create",
"a",
"few",
"new",
"package",
"registrars"
] | 1a32c5af37f3dc8dabe4e8eedeeb21aea16ce139 | https://github.com/expectation-php/expect/blob/1a32c5af37f3dc8dabe4e8eedeeb21aea16ce139/src/config/ConfigurationLoader.php#L62-L76 |
23,306 | expectation-php/expect | src/config/ConfigurationLoader.php | ConfigurationLoader.createReporter | private function createReporter($reporter)
{
$reflection = new ReflectionClass($reporter);
if ($reflection->implementsInterface(self::REPORTER) === false) {
throw NotAvailableException::createForReporter(self::REPORTER);
}
return $reflection->newInstance();
} | php | private function createReporter($reporter)
{
$reflection = new ReflectionClass($reporter);
if ($reflection->implementsInterface(self::REPORTER) === false) {
throw NotAvailableException::createForReporter(self::REPORTER);
}
return $reflection->newInstance();
} | [
"private",
"function",
"createReporter",
"(",
"$",
"reporter",
")",
"{",
"$",
"reflection",
"=",
"new",
"ReflectionClass",
"(",
"$",
"reporter",
")",
";",
"if",
"(",
"$",
"reflection",
"->",
"implementsInterface",
"(",
"self",
"::",
"REPORTER",
")",
"===",
... | Create a new result reporter
@param string $reporter
@return \expect\ResultReporter | [
"Create",
"a",
"new",
"result",
"reporter"
] | 1a32c5af37f3dc8dabe4e8eedeeb21aea16ce139 | https://github.com/expectation-php/expect/blob/1a32c5af37f3dc8dabe4e8eedeeb21aea16ce139/src/config/ConfigurationLoader.php#L85-L94 |
23,307 | engineor/flysystem-runabove | src/RunaboveAdapter.php | RunaboveAdapter.getObject | protected function getObject($path)
{
$location = $this->applyPathPrefix($path);
return $this->container->getObject($location);
} | php | protected function getObject($path)
{
$location = $this->applyPathPrefix($path);
return $this->container->getObject($location);
} | [
"protected",
"function",
"getObject",
"(",
"$",
"path",
")",
"{",
"$",
"location",
"=",
"$",
"this",
"->",
"applyPathPrefix",
"(",
"$",
"path",
")",
";",
"return",
"$",
"this",
"->",
"container",
"->",
"getObject",
"(",
"$",
"location",
")",
";",
"}"
] | Get an object.
@param string $path
@return DataObject | [
"Get",
"an",
"object",
"."
] | d8c22dbf25c3bf2b62187f9da07efb48888d44de | https://github.com/engineor/flysystem-runabove/blob/d8c22dbf25c3bf2b62187f9da07efb48888d44de/src/RunaboveAdapter.php#L60-L65 |
23,308 | raulfraile/ladybug-installer | src/Ladybug/Installer/Composer/Installer.php | Installer.getRootPath | protected function getRootPath(PackageInterface $package)
{
$rootPath = $this->vendorDir . '/raulfraile/ladybug-themes/Ladybug/';
if ($this->composer->getPackage()->getName() === 'raulfraile/ladybug') {
$rootPath = 'data/' . ($package->getType() === self::PACKAGE_TYPE_THEME ? 'themes' :... | php | protected function getRootPath(PackageInterface $package)
{
$rootPath = $this->vendorDir . '/raulfraile/ladybug-themes/Ladybug/';
if ($this->composer->getPackage()->getName() === 'raulfraile/ladybug') {
$rootPath = 'data/' . ($package->getType() === self::PACKAGE_TYPE_THEME ? 'themes' :... | [
"protected",
"function",
"getRootPath",
"(",
"PackageInterface",
"$",
"package",
")",
"{",
"$",
"rootPath",
"=",
"$",
"this",
"->",
"vendorDir",
".",
"'/raulfraile/ladybug-themes/Ladybug/'",
";",
"if",
"(",
"$",
"this",
"->",
"composer",
"->",
"getPackage",
"(",... | Returns the root installation path for templates.
@param PackageInterface $package
@return string a path relative to the root of the composer.json | [
"Returns",
"the",
"root",
"installation",
"path",
"for",
"templates",
"."
] | 04f38f50cac673d3ca93de9c0805889e37804b33 | https://github.com/raulfraile/ladybug-installer/blob/04f38f50cac673d3ca93de9c0805889e37804b33/src/Ladybug/Installer/Composer/Installer.php#L55-L66 |
23,309 | pinepain/amqpy | src/AMQPy/AbstractListener.php | AbstractListener.consume | public function consume(AbstractConsumer $consumer, $auto_ack = false)
{
if (!$consumer->active()) {
// prevent dirty consumer been listening on queue
return;
}
$outside_error = null;
try {
$consumer->begin($this);
$this->queue->cons... | php | public function consume(AbstractConsumer $consumer, $auto_ack = false)
{
if (!$consumer->active()) {
// prevent dirty consumer been listening on queue
return;
}
$outside_error = null;
try {
$consumer->begin($this);
$this->queue->cons... | [
"public",
"function",
"consume",
"(",
"AbstractConsumer",
"$",
"consumer",
",",
"$",
"auto_ack",
"=",
"false",
")",
"{",
"if",
"(",
"!",
"$",
"consumer",
"->",
"active",
"(",
")",
")",
"{",
"// prevent dirty consumer been listening on queue",
"return",
";",
"}... | Attach consumer to process payload from queue
@param AbstractConsumer $consumer Consumer to process payload and handle possible errors
@param bool $auto_ack Should message been acknowledged upon receive
@return mixed
@throws SerializerException
@throws Exception Any exception from pre/post-cons... | [
"Attach",
"consumer",
"to",
"process",
"payload",
"from",
"queue"
] | fc61dacc37a97a100caf67232a72be32dd7cc896 | https://github.com/pinepain/amqpy/blob/fc61dacc37a97a100caf67232a72be32dd7cc896/src/AMQPy/AbstractListener.php#L93-L128 |
23,310 | hametuha/wpametu | src/WPametu/UI/Field/Taxonomy.php | Taxonomy.get_options | protected function get_options(){
$terms = get_terms($this->name);
if( !$terms || is_wp_error($terms) ){
return [];
}else{
$result = [];
foreach( $terms as $term ){
$result[$term->term_id] = $term->name;
}
return $result... | php | protected function get_options(){
$terms = get_terms($this->name);
if( !$terms || is_wp_error($terms) ){
return [];
}else{
$result = [];
foreach( $terms as $term ){
$result[$term->term_id] = $term->name;
}
return $result... | [
"protected",
"function",
"get_options",
"(",
")",
"{",
"$",
"terms",
"=",
"get_terms",
"(",
"$",
"this",
"->",
"name",
")",
";",
"if",
"(",
"!",
"$",
"terms",
"||",
"is_wp_error",
"(",
"$",
"terms",
")",
")",
"{",
"return",
"[",
"]",
";",
"}",
"e... | Get terms as option
@return array | [
"Get",
"terms",
"as",
"option"
] | 0939373800815a8396291143d2a57967340da5aa | https://github.com/hametuha/wpametu/blob/0939373800815a8396291143d2a57967340da5aa/src/WPametu/UI/Field/Taxonomy.php#L53-L64 |
23,311 | antaresproject/notifications | src/Http/Form/Form.php | Form.buttons | protected function buttons($fluent, Fieldset $fieldset)
{
$fieldset->control('button', 'cancel')
->field(function() {
return app('html')->link(handles("antares::notifications/"), trans('Cancel'), ['class' => 'btn btn--md btn--default mdl-button mdl-js-button']);
... | php | protected function buttons($fluent, Fieldset $fieldset)
{
$fieldset->control('button', 'cancel')
->field(function() {
return app('html')->link(handles("antares::notifications/"), trans('Cancel'), ['class' => 'btn btn--md btn--default mdl-button mdl-js-button']);
... | [
"protected",
"function",
"buttons",
"(",
"$",
"fluent",
",",
"Fieldset",
"$",
"fieldset",
")",
"{",
"$",
"fieldset",
"->",
"control",
"(",
"'button'",
",",
"'cancel'",
")",
"->",
"field",
"(",
"function",
"(",
")",
"{",
"return",
"app",
"(",
"'html'",
... | buttons in form
@param Fluent $fluent
@param Fieldset $fieldset | [
"buttons",
"in",
"form"
] | 60de743477b7e9cbb51de66da5fd9461adc9dd8a | https://github.com/antaresproject/notifications/blob/60de743477b7e9cbb51de66da5fd9461adc9dd8a/src/Http/Form/Form.php#L160-L193 |
23,312 | antaresproject/notifications | src/Http/Form/Form.php | Form.onCreate | public function onCreate()
{
$this->grid->attributes([
'url' => handles('antares::notifications/store'),
'method' => 'POST',
]);
$layout = ($this->fluent->type == 'sms') ? 'antares/notifications::admin.index.form_sms' : 'antares/notifications::admin.index.form';
... | php | public function onCreate()
{
$this->grid->attributes([
'url' => handles('antares::notifications/store'),
'method' => 'POST',
]);
$layout = ($this->fluent->type == 'sms') ? 'antares/notifications::admin.index.form_sms' : 'antares/notifications::admin.index.form';
... | [
"public",
"function",
"onCreate",
"(",
")",
"{",
"$",
"this",
"->",
"grid",
"->",
"attributes",
"(",
"[",
"'url'",
"=>",
"handles",
"(",
"'antares::notifications/store'",
")",
",",
"'method'",
"=>",
"'POST'",
",",
"]",
")",
";",
"$",
"layout",
"=",
"(",
... | on create scenario
@param String $type
@return \Antares\Notifications\Http\Form\Form | [
"on",
"create",
"scenario"
] | 60de743477b7e9cbb51de66da5fd9461adc9dd8a | https://github.com/antaresproject/notifications/blob/60de743477b7e9cbb51de66da5fd9461adc9dd8a/src/Http/Form/Form.php#L213-L222 |
23,313 | antaresproject/notifications | src/Http/Form/Form.php | Form.getNotificationContentData | protected function getNotificationContentData($fluent, $langId, $key = 'title')
{
foreach ($fluent->contents as $content) {
if ($langId !== $content['lang_id']) {
continue;
}
return array_get($content, $key);
}
return '';
} | php | protected function getNotificationContentData($fluent, $langId, $key = 'title')
{
foreach ($fluent->contents as $content) {
if ($langId !== $content['lang_id']) {
continue;
}
return array_get($content, $key);
}
return '';
} | [
"protected",
"function",
"getNotificationContentData",
"(",
"$",
"fluent",
",",
"$",
"langId",
",",
"$",
"key",
"=",
"'title'",
")",
"{",
"foreach",
"(",
"$",
"fluent",
"->",
"contents",
"as",
"$",
"content",
")",
"{",
"if",
"(",
"$",
"langId",
"!==",
... | Gets notification data
@param Fluent $fluent
@param mixed $langId
@param String $key
@return String | [
"Gets",
"notification",
"data"
] | 60de743477b7e9cbb51de66da5fd9461adc9dd8a | https://github.com/antaresproject/notifications/blob/60de743477b7e9cbb51de66da5fd9461adc9dd8a/src/Http/Form/Form.php#L232-L241 |
23,314 | RhubarbPHP/Module.RestApi | src/Modelling/ApiModel.php | ApiModel.delete | public function delete()
{
if ($this->isNewRecord()) {
throw new DeleteModelException("New models can't be deleted.");
}
$this->beforeDelete();
$this->raiseEvent("BeforeDelete");
$this->Deleted = true;
$this->save();
$this->afterDelete();
... | php | public function delete()
{
if ($this->isNewRecord()) {
throw new DeleteModelException("New models can't be deleted.");
}
$this->beforeDelete();
$this->raiseEvent("BeforeDelete");
$this->Deleted = true;
$this->save();
$this->afterDelete();
... | [
"public",
"function",
"delete",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"isNewRecord",
"(",
")",
")",
"{",
"throw",
"new",
"DeleteModelException",
"(",
"\"New models can't be deleted.\"",
")",
";",
"}",
"$",
"this",
"->",
"beforeDelete",
"(",
")",
";"... | Replaces the standard delete by flagging the entry deleted instead. | [
"Replaces",
"the",
"standard",
"delete",
"by",
"flagging",
"the",
"entry",
"deleted",
"instead",
"."
] | 825d2b920caed13811971c5eb2784a94417787bd | https://github.com/RhubarbPHP/Module.RestApi/blob/825d2b920caed13811971c5eb2784a94417787bd/src/Modelling/ApiModel.php#L55-L69 |
23,315 | mridang/magazine | lib/magento/Package.php | Mage_Connect_Package._init | protected function _init($definition=null)
{
if (!is_null($definition)) {
$this->_packageXml = simplexml_load_string($definition);
} else {
$packageXmlStub = <<<END
<?xml version="1.0"?>
<package>
<name />
<version />
<stability />
<license />
<channel />... | php | protected function _init($definition=null)
{
if (!is_null($definition)) {
$this->_packageXml = simplexml_load_string($definition);
} else {
$packageXmlStub = <<<END
<?xml version="1.0"?>
<package>
<name />
<version />
<stability />
<license />
<channel />... | [
"protected",
"function",
"_init",
"(",
"$",
"definition",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"is_null",
"(",
"$",
"definition",
")",
")",
"{",
"$",
"this",
"->",
"_packageXml",
"=",
"simplexml_load_string",
"(",
"$",
"definition",
")",
";",
"}",
"e... | Initializes an empty package object
@param null|string $definition optional package definition xml
@return Mage_Connect_Package | [
"Initializes",
"an",
"empty",
"package",
"object"
] | 5b3cfecc472c61fde6af63efe62690a30a267a04 | https://github.com/mridang/magazine/blob/5b3cfecc472c61fde6af63efe62690a30a267a04/lib/magento/Package.php#L165-L194 |
23,316 | mridang/magazine | lib/magento/Package.php | Mage_Connect_Package._loadFile | protected function _loadFile($filename='')
{
if (is_null($this->_reader)) {
$this->_reader = new Mage_Connect_Package_Reader($filename);
}
$content = $this->_reader->load();
$this->_packageXml = simplexml_load_string($content);
return $this;
} | php | protected function _loadFile($filename='')
{
if (is_null($this->_reader)) {
$this->_reader = new Mage_Connect_Package_Reader($filename);
}
$content = $this->_reader->load();
$this->_packageXml = simplexml_load_string($content);
return $this;
} | [
"protected",
"function",
"_loadFile",
"(",
"$",
"filename",
"=",
"''",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"this",
"->",
"_reader",
")",
")",
"{",
"$",
"this",
"->",
"_reader",
"=",
"new",
"Mage_Connect_Package_Reader",
"(",
"$",
"filename",
")",
... | Loads a package from specified file
@param string $filename
@return Mage_Connect_Package | [
"Loads",
"a",
"package",
"from",
"specified",
"file"
] | 5b3cfecc472c61fde6af63efe62690a30a267a04 | https://github.com/mridang/magazine/blob/5b3cfecc472c61fde6af63efe62690a30a267a04/lib/magento/Package.php#L202-L210 |
23,317 | mridang/magazine | lib/magento/Package.php | Mage_Connect_Package.save | public function save($path)
{
$this->validate();
$path = rtrim($path, "\\/") . DS;
$this->_savePackage($path);
return $this;
} | php | public function save($path)
{
$this->validate();
$path = rtrim($path, "\\/") . DS;
$this->_savePackage($path);
return $this;
} | [
"public",
"function",
"save",
"(",
"$",
"path",
")",
"{",
"$",
"this",
"->",
"validate",
"(",
")",
";",
"$",
"path",
"=",
"rtrim",
"(",
"$",
"path",
",",
"\"\\\\/\"",
")",
".",
"DS",
";",
"$",
"this",
"->",
"_savePackage",
"(",
"$",
"path",
")",
... | Creates a package and saves it
@param string $path
@return Mage_Connect_Package | [
"Creates",
"a",
"package",
"and",
"saves",
"it"
] | 5b3cfecc472c61fde6af63efe62690a30a267a04 | https://github.com/mridang/magazine/blob/5b3cfecc472c61fde6af63efe62690a30a267a04/lib/magento/Package.php#L218-L224 |
23,318 | mridang/magazine | lib/magento/Package.php | Mage_Connect_Package._savePackage | protected function _savePackage($path)
{
$fileName = $this->getReleaseFilename();
if (is_null($this->_writer)) {
$this->_writer = new Mage_Connect_Package_Writer($this->getContents(), $path.$fileName);
}
$this->_writer
->composePackage()
->addPacka... | php | protected function _savePackage($path)
{
$fileName = $this->getReleaseFilename();
if (is_null($this->_writer)) {
$this->_writer = new Mage_Connect_Package_Writer($this->getContents(), $path.$fileName);
}
$this->_writer
->composePackage()
->addPacka... | [
"protected",
"function",
"_savePackage",
"(",
"$",
"path",
")",
"{",
"$",
"fileName",
"=",
"$",
"this",
"->",
"getReleaseFilename",
"(",
")",
";",
"if",
"(",
"is_null",
"(",
"$",
"this",
"->",
"_writer",
")",
")",
"{",
"$",
"this",
"->",
"_writer",
"... | Creates a package archive and saves it to specified path
@param string $path
@return Mage_Connect_Package | [
"Creates",
"a",
"package",
"archive",
"and",
"saves",
"it",
"to",
"specified",
"path"
] | 5b3cfecc472c61fde6af63efe62690a30a267a04 | https://github.com/mridang/magazine/blob/5b3cfecc472c61fde6af63efe62690a30a267a04/lib/magento/Package.php#L232-L243 |
23,319 | mridang/magazine | lib/magento/Package.php | Mage_Connect_Package._getNode | protected function _getNode($tag, $parent, $name='')
{
$found = false;
foreach ($parent->xpath($tag) as $_node) {
if ($_node['name'] == $name) {
$node = $_node;
$found = true;
break;
}
}
if (!$found) {
... | php | protected function _getNode($tag, $parent, $name='')
{
$found = false;
foreach ($parent->xpath($tag) as $_node) {
if ($_node['name'] == $name) {
$node = $_node;
$found = true;
break;
}
}
if (!$found) {
... | [
"protected",
"function",
"_getNode",
"(",
"$",
"tag",
",",
"$",
"parent",
",",
"$",
"name",
"=",
"''",
")",
"{",
"$",
"found",
"=",
"false",
";",
"foreach",
"(",
"$",
"parent",
"->",
"xpath",
"(",
"$",
"tag",
")",
"as",
"$",
"_node",
")",
"{",
... | Retrieve SimpleXMLElement node by xpath. If it absent, create new.
For comparing nodes method uses attribute "name" in each nodes.
If attribute "name" is same for both nodes, nodes are same.
@param string $tag
@param SimpleXMLElement $parent
@param string $name
@return SimpleXMLElement | [
"Retrieve",
"SimpleXMLElement",
"node",
"by",
"xpath",
".",
"If",
"it",
"absent",
"create",
"new",
".",
"For",
"comparing",
"nodes",
"method",
"uses",
"attribute",
"name",
"in",
"each",
"nodes",
".",
"If",
"attribute",
"name",
"is",
"same",
"for",
"both",
... | 5b3cfecc472c61fde6af63efe62690a30a267a04 | https://github.com/mridang/magazine/blob/5b3cfecc472c61fde6af63efe62690a30a267a04/lib/magento/Package.php#L443-L460 |
23,320 | mridang/magazine | lib/magento/Package.php | Mage_Connect_Package.setDependencyPhpVersion | public function setDependencyPhpVersion($minVersion, $maxVersion)
{
$parent = $this->_packageXml->dependencies;
$parent = $this->_getNode('required', $parent);
$parent = $this->_getNode('php', $parent);
$parent->addChild('min', $minVersion);
$parent->addChild('max', $maxVersi... | php | public function setDependencyPhpVersion($minVersion, $maxVersion)
{
$parent = $this->_packageXml->dependencies;
$parent = $this->_getNode('required', $parent);
$parent = $this->_getNode('php', $parent);
$parent->addChild('min', $minVersion);
$parent->addChild('max', $maxVersi... | [
"public",
"function",
"setDependencyPhpVersion",
"(",
"$",
"minVersion",
",",
"$",
"maxVersion",
")",
"{",
"$",
"parent",
"=",
"$",
"this",
"->",
"_packageXml",
"->",
"dependencies",
";",
"$",
"parent",
"=",
"$",
"this",
"->",
"_getNode",
"(",
"'required'",
... | Set dependency from php version.
@param string $minVersion
@param string $maxVersion
@return Mage_Connect_Package | [
"Set",
"dependency",
"from",
"php",
"version",
"."
] | 5b3cfecc472c61fde6af63efe62690a30a267a04 | https://github.com/mridang/magazine/blob/5b3cfecc472c61fde6af63efe62690a30a267a04/lib/magento/Package.php#L557-L565 |
23,321 | mridang/magazine | lib/magento/Package.php | Mage_Connect_Package.checkPhpVersion | public function checkPhpVersion()
{
$min = $this->getDependencyPhpVersionMin();
$max = $this->getDependencyPhpVersionMax();
$minOk = $min? version_compare(PHP_VERSION, $min, ">=") : true;
$maxOk = $max? version_compare(PHP_VERSION, $max, "<=") : true;
if(!$minOk || !$maxOk)... | php | public function checkPhpVersion()
{
$min = $this->getDependencyPhpVersionMin();
$max = $this->getDependencyPhpVersionMax();
$minOk = $min? version_compare(PHP_VERSION, $min, ">=") : true;
$maxOk = $max? version_compare(PHP_VERSION, $max, "<=") : true;
if(!$minOk || !$maxOk)... | [
"public",
"function",
"checkPhpVersion",
"(",
")",
"{",
"$",
"min",
"=",
"$",
"this",
"->",
"getDependencyPhpVersionMin",
"(",
")",
";",
"$",
"max",
"=",
"$",
"this",
"->",
"getDependencyPhpVersionMax",
"(",
")",
";",
"$",
"minOk",
"=",
"$",
"min",
"?",
... | Check PHP version restriction
@param $phpVersion PHP_VERSION by default
@return true | string | [
"Check",
"PHP",
"version",
"restriction"
] | 5b3cfecc472c61fde6af63efe62690a30a267a04 | https://github.com/mridang/magazine/blob/5b3cfecc472c61fde6af63efe62690a30a267a04/lib/magento/Package.php#L573-L594 |
23,322 | mridang/magazine | lib/magento/Package.php | Mage_Connect_Package.checkPhpDependencies | public function checkPhpDependencies()
{
$errors = array();
foreach($this->getDependencyPhpExtensions() as $dep)
{
if(!extension_loaded($dep['name'])) {
$errors[] = $dep;
}
}
if(count($errors)) {
return $errors;
}
... | php | public function checkPhpDependencies()
{
$errors = array();
foreach($this->getDependencyPhpExtensions() as $dep)
{
if(!extension_loaded($dep['name'])) {
$errors[] = $dep;
}
}
if(count($errors)) {
return $errors;
}
... | [
"public",
"function",
"checkPhpDependencies",
"(",
")",
"{",
"$",
"errors",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"getDependencyPhpExtensions",
"(",
")",
"as",
"$",
"dep",
")",
"{",
"if",
"(",
"!",
"extension_loaded",
"(",
"$",
... | Check PHP extensions availability
@throws Exceptiom on failure
@return true | array | [
"Check",
"PHP",
"extensions",
"availability"
] | 5b3cfecc472c61fde6af63efe62690a30a267a04 | https://github.com/mridang/magazine/blob/5b3cfecc472c61fde6af63efe62690a30a267a04/lib/magento/Package.php#L602-L615 |
23,323 | mridang/magazine | lib/magento/Package.php | Mage_Connect_Package.setDependencyPhpExtensions | public function setDependencyPhpExtensions($extensions)
{
foreach($extensions as $_extension) {
$this->addDependencyExtension(
$_extension['name'],
$_extension['min_version'],
$_extension['max_version']
);
}
return $this... | php | public function setDependencyPhpExtensions($extensions)
{
foreach($extensions as $_extension) {
$this->addDependencyExtension(
$_extension['name'],
$_extension['min_version'],
$_extension['max_version']
);
}
return $this... | [
"public",
"function",
"setDependencyPhpExtensions",
"(",
"$",
"extensions",
")",
"{",
"foreach",
"(",
"$",
"extensions",
"as",
"$",
"_extension",
")",
"{",
"$",
"this",
"->",
"addDependencyExtension",
"(",
"$",
"_extension",
"[",
"'name'",
"]",
",",
"$",
"_e... | Set dependency from php extensions.
$extension has next view:
array('curl', 'mysql')
@param array|string $extensions
@return Mage_Connect_Package | [
"Set",
"dependency",
"from",
"php",
"extensions",
"."
] | 5b3cfecc472c61fde6af63efe62690a30a267a04 | https://github.com/mridang/magazine/blob/5b3cfecc472c61fde6af63efe62690a30a267a04/lib/magento/Package.php#L627-L637 |
23,324 | mridang/magazine | lib/magento/Package.php | Mage_Connect_Package.setDependencyPackages | public function setDependencyPackages($packages, $clear = false)
{
if($clear) {
unset($this->_packageXml->dependencies->required->package);
}
foreach($packages as $_package) {
$filesArrayCondition = isset($_package['files']) && is_array($_package['files']);
... | php | public function setDependencyPackages($packages, $clear = false)
{
if($clear) {
unset($this->_packageXml->dependencies->required->package);
}
foreach($packages as $_package) {
$filesArrayCondition = isset($_package['files']) && is_array($_package['files']);
... | [
"public",
"function",
"setDependencyPackages",
"(",
"$",
"packages",
",",
"$",
"clear",
"=",
"false",
")",
"{",
"if",
"(",
"$",
"clear",
")",
"{",
"unset",
"(",
"$",
"this",
"->",
"_packageXml",
"->",
"dependencies",
"->",
"required",
"->",
"package",
")... | Set dependency from another packages.
$packages should contain:
array(
array('name'=>'test1', 'channel'=>'test1', 'min_version'=>'0.0.1', 'max_version'=>'0.1.0'),
array('name'=>'test2', 'channel'=>'test2', 'min_version'=>'0.0.1', 'max_version'=>'0.1.0'),
)
@param array $packages
@param bool $clear
@return Mage_Connec... | [
"Set",
"dependency",
"from",
"another",
"packages",
"."
] | 5b3cfecc472c61fde6af63efe62690a30a267a04 | https://github.com/mridang/magazine/blob/5b3cfecc472c61fde6af63efe62690a30a267a04/lib/magento/Package.php#L652-L672 |
23,325 | mridang/magazine | lib/magento/Package.php | Mage_Connect_Package.addDependencyPackage | public function addDependencyPackage($name, $channel, $minVersion, $maxVersion, $files = array())
{
$parent = $this->_packageXml->dependencies;
$parent = $this->_getNode('required', $parent);
$parent = $parent->addChild('package');
$parent->addChild('name', $name);
$parent->a... | php | public function addDependencyPackage($name, $channel, $minVersion, $maxVersion, $files = array())
{
$parent = $this->_packageXml->dependencies;
$parent = $this->_getNode('required', $parent);
$parent = $parent->addChild('package');
$parent->addChild('name', $name);
$parent->a... | [
"public",
"function",
"addDependencyPackage",
"(",
"$",
"name",
",",
"$",
"channel",
",",
"$",
"minVersion",
",",
"$",
"maxVersion",
",",
"$",
"files",
"=",
"array",
"(",
")",
")",
"{",
"$",
"parent",
"=",
"$",
"this",
"->",
"_packageXml",
"->",
"depen... | Add package to dependency packages.
@param string $package
@param string $channel
@param string $minVersion
@param string $maxVersion
@return Mage_Connect_Package | [
"Add",
"package",
"to",
"dependency",
"packages",
"."
] | 5b3cfecc472c61fde6af63efe62690a30a267a04 | https://github.com/mridang/magazine/blob/5b3cfecc472c61fde6af63efe62690a30a267a04/lib/magento/Package.php#L685-L706 |
23,326 | mridang/magazine | lib/magento/Package.php | Mage_Connect_Package.addDependencyExtension | public function addDependencyExtension($name, $minVersion, $maxVersion)
{
$parent = $this->_packageXml->dependencies;
$parent = $this->_getNode('required', $parent);
$parent = $parent->addChild('extension');
$parent->addChild('name', $name);
$parent->addChild('min', $minVersi... | php | public function addDependencyExtension($name, $minVersion, $maxVersion)
{
$parent = $this->_packageXml->dependencies;
$parent = $this->_getNode('required', $parent);
$parent = $parent->addChild('extension');
$parent->addChild('name', $name);
$parent->addChild('min', $minVersi... | [
"public",
"function",
"addDependencyExtension",
"(",
"$",
"name",
",",
"$",
"minVersion",
",",
"$",
"maxVersion",
")",
"{",
"$",
"parent",
"=",
"$",
"this",
"->",
"_packageXml",
"->",
"dependencies",
";",
"$",
"parent",
"=",
"$",
"this",
"->",
"_getNode",
... | Add package to dependency extension.
@param string $package
@param string $minVersion
@param string $maxVersion
@return Mage_Connect_Package | [
"Add",
"package",
"to",
"dependency",
"extension",
"."
] | 5b3cfecc472c61fde6af63efe62690a30a267a04 | https://github.com/mridang/magazine/blob/5b3cfecc472c61fde6af63efe62690a30a267a04/lib/magento/Package.php#L718-L727 |
23,327 | mridang/magazine | lib/magento/Package.php | Mage_Connect_Package.getAuthors | public function getAuthors()
{
if (is_array($this->_authors)) return $this->_authors;
$this->_authors = array();
if(!isset($this->_packageXml->authors->author)) {
return array();
}
foreach ($this->_packageXml->authors->author as $_author) {
$this->_aut... | php | public function getAuthors()
{
if (is_array($this->_authors)) return $this->_authors;
$this->_authors = array();
if(!isset($this->_packageXml->authors->author)) {
return array();
}
foreach ($this->_packageXml->authors->author as $_author) {
$this->_aut... | [
"public",
"function",
"getAuthors",
"(",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"this",
"->",
"_authors",
")",
")",
"return",
"$",
"this",
"->",
"_authors",
";",
"$",
"this",
"->",
"_authors",
"=",
"array",
"(",
")",
";",
"if",
"(",
"!",
"isset... | Get list of authors in associative array.
@return array | [
"Get",
"list",
"of",
"authors",
"in",
"associative",
"array",
"."
] | 5b3cfecc472c61fde6af63efe62690a30a267a04 | https://github.com/mridang/magazine/blob/5b3cfecc472c61fde6af63efe62690a30a267a04/lib/magento/Package.php#L776-L791 |
23,328 | mridang/magazine | lib/magento/Package.php | Mage_Connect_Package.getContents | public function getContents()
{
if (is_array($this->_contents)) return $this->_contents;
$this->_contents = array();
if(!isset($this->_packageXml->contents->target)) {
return $this->_contents;
}
foreach($this->_packageXml->contents->target as $target) {
... | php | public function getContents()
{
if (is_array($this->_contents)) return $this->_contents;
$this->_contents = array();
if(!isset($this->_packageXml->contents->target)) {
return $this->_contents;
}
foreach($this->_packageXml->contents->target as $target) {
... | [
"public",
"function",
"getContents",
"(",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"this",
"->",
"_contents",
")",
")",
"return",
"$",
"this",
"->",
"_contents",
";",
"$",
"this",
"->",
"_contents",
"=",
"array",
"(",
")",
";",
"if",
"(",
"!",
"i... | Create list of all files from package.xml
@return array | [
"Create",
"list",
"of",
"all",
"files",
"from",
"package",
".",
"xml"
] | 5b3cfecc472c61fde6af63efe62690a30a267a04 | https://github.com/mridang/magazine/blob/5b3cfecc472c61fde6af63efe62690a30a267a04/lib/magento/Package.php#L868-L880 |
23,329 | mridang/magazine | lib/magento/Package.php | Mage_Connect_Package.getHashContents | public function getHashContents()
{
if (is_array($this->_hashContents)) return $this->_hashContents;
$this->_hashContents = array();
if(!isset($this->_packageXml->contents->target)) {
return $this->_hashContents;
}
foreach($this->_packageXml->contents->target as $... | php | public function getHashContents()
{
if (is_array($this->_hashContents)) return $this->_hashContents;
$this->_hashContents = array();
if(!isset($this->_packageXml->contents->target)) {
return $this->_hashContents;
}
foreach($this->_packageXml->contents->target as $... | [
"public",
"function",
"getHashContents",
"(",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"this",
"->",
"_hashContents",
")",
")",
"return",
"$",
"this",
"->",
"_hashContents",
";",
"$",
"this",
"->",
"_hashContents",
"=",
"array",
"(",
")",
";",
"if",
... | Create list of all files from package.xml with hash
@return array | [
"Create",
"list",
"of",
"all",
"files",
"from",
"package",
".",
"xml",
"with",
"hash"
] | 5b3cfecc472c61fde6af63efe62690a30a267a04 | https://github.com/mridang/magazine/blob/5b3cfecc472c61fde6af63efe62690a30a267a04/lib/magento/Package.php#L904-L916 |
23,330 | mridang/magazine | lib/magento/Package.php | Mage_Connect_Package.getCompatible | public function getCompatible()
{
if (is_array($this->_compatible)) return $this->_compatible;
$this->_compatible = array();
if(!isset($this->_packageXml->compatible->package)) {
return array();
}
foreach ($this->_packageXml->compatible->package as $_package) {
... | php | public function getCompatible()
{
if (is_array($this->_compatible)) return $this->_compatible;
$this->_compatible = array();
if(!isset($this->_packageXml->compatible->package)) {
return array();
}
foreach ($this->_packageXml->compatible->package as $_package) {
... | [
"public",
"function",
"getCompatible",
"(",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"this",
"->",
"_compatible",
")",
")",
"return",
"$",
"this",
"->",
"_compatible",
";",
"$",
"this",
"->",
"_compatible",
"=",
"array",
"(",
")",
";",
"if",
"(",
"... | Get compatible packages.
@return array | [
"Get",
"compatible",
"packages",
"."
] | 5b3cfecc472c61fde6af63efe62690a30a267a04 | https://github.com/mridang/magazine/blob/5b3cfecc472c61fde6af63efe62690a30a267a04/lib/magento/Package.php#L944-L960 |
23,331 | mridang/magazine | lib/magento/Package.php | Mage_Connect_Package.getDependencyPhpExtensions | public function getDependencyPhpExtensions()
{
if (is_array($this->_dependencyPhpExtensions)) return $this->_dependencyPhpExtensions;
$this->_dependencyPhpExtensions = array();
if (!isset($this->_packageXml->dependencies->required->extension)) {
return $this->_dependencyPhpExtens... | php | public function getDependencyPhpExtensions()
{
if (is_array($this->_dependencyPhpExtensions)) return $this->_dependencyPhpExtensions;
$this->_dependencyPhpExtensions = array();
if (!isset($this->_packageXml->dependencies->required->extension)) {
return $this->_dependencyPhpExtens... | [
"public",
"function",
"getDependencyPhpExtensions",
"(",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"this",
"->",
"_dependencyPhpExtensions",
")",
")",
"return",
"$",
"this",
"->",
"_dependencyPhpExtensions",
";",
"$",
"this",
"->",
"_dependencyPhpExtensions",
"="... | Get list of php extensions.
@return array | [
"Get",
"list",
"of",
"php",
"extensions",
"."
] | 5b3cfecc472c61fde6af63efe62690a30a267a04 | https://github.com/mridang/magazine/blob/5b3cfecc472c61fde6af63efe62690a30a267a04/lib/magento/Package.php#L993-L1008 |
23,332 | mridang/magazine | lib/magento/Package.php | Mage_Connect_Package.getDependencyPackages | public function getDependencyPackages()
{
$this->_dependencyPackages = array();
if (!isset($this->_packageXml->dependencies->required->package)) {
return $this->_dependencyPackages;
}
foreach($this->_packageXml->dependencies->required->package as $_package) {
... | php | public function getDependencyPackages()
{
$this->_dependencyPackages = array();
if (!isset($this->_packageXml->dependencies->required->package)) {
return $this->_dependencyPackages;
}
foreach($this->_packageXml->dependencies->required->package as $_package) {
... | [
"public",
"function",
"getDependencyPackages",
"(",
")",
"{",
"$",
"this",
"->",
"_dependencyPackages",
"=",
"array",
"(",
")",
";",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"_packageXml",
"->",
"dependencies",
"->",
"required",
"->",
"package",
")... | Get list of dependency packages.
@return array | [
"Get",
"list",
"of",
"dependency",
"packages",
"."
] | 5b3cfecc472c61fde6af63efe62690a30a267a04 | https://github.com/mridang/magazine/blob/5b3cfecc472c61fde6af63efe62690a30a267a04/lib/magento/Package.php#L1015-L1040 |
23,333 | mridang/magazine | lib/magento/Package.php | Mage_Connect_Package.convertChannelFromV1x | public function convertChannelFromV1x($channel)
{
$channelMap = array(
'connect.magentocommerce.com/community' => 'community',
'connect.magentocommerce.com/core' => 'community'
);
if (!empty($channel) && isset($channelMap[$channel])) {
$channel = $channelM... | php | public function convertChannelFromV1x($channel)
{
$channelMap = array(
'connect.magentocommerce.com/community' => 'community',
'connect.magentocommerce.com/core' => 'community'
);
if (!empty($channel) && isset($channelMap[$channel])) {
$channel = $channelM... | [
"public",
"function",
"convertChannelFromV1x",
"(",
"$",
"channel",
")",
"{",
"$",
"channelMap",
"=",
"array",
"(",
"'connect.magentocommerce.com/community'",
"=>",
"'community'",
",",
"'connect.magentocommerce.com/core'",
"=>",
"'community'",
")",
";",
"if",
"(",
"!"... | Convert package channel in order for it to be compatible with current version of Magento Connect Manager
@param string $channel
@return string | [
"Convert",
"package",
"channel",
"in",
"order",
"for",
"it",
"to",
"be",
"compatible",
"with",
"current",
"version",
"of",
"Magento",
"Connect",
"Manager"
] | 5b3cfecc472c61fde6af63efe62690a30a267a04 | https://github.com/mridang/magazine/blob/5b3cfecc472c61fde6af63efe62690a30a267a04/lib/magento/Package.php#L1488-L1498 |
23,334 | protophp/session | src/SessionManager.php | SessionManager.getUniqueKey | private function getUniqueKey(): string
{
do {
try {
$isDuplicate = null;
$key = random_bytes($this->getOpt(self::OPT_SESSION_KEY_LENGTH));
// Ask for duplicate key from storage
$this->emit('duplicate-check', [$key, &$isDuplicate])... | php | private function getUniqueKey(): string
{
do {
try {
$isDuplicate = null;
$key = random_bytes($this->getOpt(self::OPT_SESSION_KEY_LENGTH));
// Ask for duplicate key from storage
$this->emit('duplicate-check', [$key, &$isDuplicate])... | [
"private",
"function",
"getUniqueKey",
"(",
")",
":",
"string",
"{",
"do",
"{",
"try",
"{",
"$",
"isDuplicate",
"=",
"null",
";",
"$",
"key",
"=",
"random_bytes",
"(",
"$",
"this",
"->",
"getOpt",
"(",
"self",
"::",
"OPT_SESSION_KEY_LENGTH",
")",
")",
... | Generate unique key
@return string
@throws SessionException | [
"Generate",
"unique",
"key"
] | bd90c882628a556727b5bc02d63005a59afa4c3a | https://github.com/protophp/session/blob/bd90c882628a556727b5bc02d63005a59afa4c3a/src/SessionManager.php#L68-L84 |
23,335 | traderinteractive/util-http-php | src/Util/Http.php | Http.parseHeaders | public static function parseHeaders(string $rawHeaders) : array
{
if (empty(trim($rawHeaders))) {
throw new InvalidArgumentException('$rawHeaders cannot be whitespace');
}
$headers = [];
$rawHeaders = preg_replace("/\r\n[\t ]+/", ' ', trim($rawHeaders));
$fields ... | php | public static function parseHeaders(string $rawHeaders) : array
{
if (empty(trim($rawHeaders))) {
throw new InvalidArgumentException('$rawHeaders cannot be whitespace');
}
$headers = [];
$rawHeaders = preg_replace("/\r\n[\t ]+/", ' ', trim($rawHeaders));
$fields ... | [
"public",
"static",
"function",
"parseHeaders",
"(",
"string",
"$",
"rawHeaders",
")",
":",
"array",
"{",
"if",
"(",
"empty",
"(",
"trim",
"(",
"$",
"rawHeaders",
")",
")",
")",
"{",
"throw",
"new",
"InvalidArgumentException",
"(",
"'$rawHeaders cannot be whit... | Parses HTTP headers into an associative array.
Example:
<code>
$headers = "HTTP/1.1 200 OK\r\n".
"content-type: text/html; charset=UTF-8\r\n".
"Server: Funky/1.0\r\n".
"Set-Cookie: foo=bar\r\n".
"Set-Cookie: baz=quux\r\n".
"Folds: are\r\n\treformatted\r\n";
print_r(\TraderInteractive\HttpUtil::parseHeaders($headers));... | [
"Parses",
"HTTP",
"headers",
"into",
"an",
"associative",
"array",
"."
] | d3bba26fbd9ec5a3227c4580717019bf16a58c67 | https://github.com/traderinteractive/util-http-php/blob/d3bba26fbd9ec5a3227c4580717019bf16a58c67/src/Util/Http.php#L49-L96 |
23,336 | traderinteractive/util-http-php | src/Util/Http.php | Http.buildQueryString | public static function buildQueryString(array $parameters) : string
{
$queryStrings = [];
foreach ($parameters as $parameterName => $parameterValue) {
$parameterName = rawurlencode($parameterName);
if (is_array($parameterValue)) {
foreach ($parameterValue as ... | php | public static function buildQueryString(array $parameters) : string
{
$queryStrings = [];
foreach ($parameters as $parameterName => $parameterValue) {
$parameterName = rawurlencode($parameterName);
if (is_array($parameterValue)) {
foreach ($parameterValue as ... | [
"public",
"static",
"function",
"buildQueryString",
"(",
"array",
"$",
"parameters",
")",
":",
"string",
"{",
"$",
"queryStrings",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"parameters",
"as",
"$",
"parameterName",
"=>",
"$",
"parameterValue",
")",
"{",
"$"... | Generate URL-encoded query string
Example:
<code>
$parameters = [
'param1' => ['value', 'another value'],
'param2' => 'a value',
'param3' => false,
];
$queryString = \TraderInteractive\HttpUtil::buildQueryString($parameters);
echo $queryString
</code>
Output:
<pre>
param1=value¶m1=another+value¶m2=a+value&p... | [
"Generate",
"URL",
"-",
"encoded",
"query",
"string"
] | d3bba26fbd9ec5a3227c4580717019bf16a58c67 | https://github.com/traderinteractive/util-http-php/blob/d3bba26fbd9ec5a3227c4580717019bf16a58c67/src/Util/Http.php#L137-L159 |
23,337 | mikelgoig/nova-spotify-auth-tool | src/SpotifyAuthToolServiceProvider.php | SpotifyAuthToolServiceProvider.routes | protected function routes()
{
if ($this->app->routesAreCached()) {
return;
}
Route::middleware(['nova', Authorize::class])
->prefix('nova-vendor/nova-spotify-auth-tool')
->group(__DIR__.'/../routes/web.php');
Route::middleware(['nova', Authorize:... | php | protected function routes()
{
if ($this->app->routesAreCached()) {
return;
}
Route::middleware(['nova', Authorize::class])
->prefix('nova-vendor/nova-spotify-auth-tool')
->group(__DIR__.'/../routes/web.php');
Route::middleware(['nova', Authorize:... | [
"protected",
"function",
"routes",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"app",
"->",
"routesAreCached",
"(",
")",
")",
"{",
"return",
";",
"}",
"Route",
"::",
"middleware",
"(",
"[",
"'nova'",
",",
"Authorize",
"::",
"class",
"]",
")",
"->",
... | Register the tool's routes.
@return void | [
"Register",
"the",
"tool",
"s",
"routes",
"."
] | a5351c386206c45f77fe6ae833cdac51f2a030f4 | https://github.com/mikelgoig/nova-spotify-auth-tool/blob/a5351c386206c45f77fe6ae833cdac51f2a030f4/src/SpotifyAuthToolServiceProvider.php#L42-L55 |
23,338 | hametuha/wpametu | src/WPametu/UI/Admin/EditMetaBox.php | EditMetaBox.add_meta_boxes | public function add_meta_boxes($post_type, $post){
if( $this->is_valid_post_type($post_type) && $this->has_cap() ){
if( empty($this->name) || empty($this->label) ){
$message = sprintf($this->__('<code>%s</code> has invalid name or label.'), get_called_class());
add_ac... | php | public function add_meta_boxes($post_type, $post){
if( $this->is_valid_post_type($post_type) && $this->has_cap() ){
if( empty($this->name) || empty($this->label) ){
$message = sprintf($this->__('<code>%s</code> has invalid name or label.'), get_called_class());
add_ac... | [
"public",
"function",
"add_meta_boxes",
"(",
"$",
"post_type",
",",
"$",
"post",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"is_valid_post_type",
"(",
"$",
"post_type",
")",
"&&",
"$",
"this",
"->",
"has_cap",
"(",
")",
")",
"{",
"if",
"(",
"empty",
"("... | Register meta box
@param string $post_type
@param \WP_Post $post | [
"Register",
"meta",
"box"
] | 0939373800815a8396291143d2a57967340da5aa | https://github.com/hametuha/wpametu/blob/0939373800815a8396291143d2a57967340da5aa/src/WPametu/UI/Admin/EditMetaBox.php#L38-L49 |
23,339 | Eresus/EresusCMS | src/core/framework/core/3rdparty/ezcomponents/Base/src/base.php | ezcBase.autoload | public static function autoload( $className )
{
Eresus_Kernel::log(__METHOD__, LOG_DEBUG, '(%s)', $className);
ezcBase::setPackageDir();
// Check whether the classname is already in the cached autoloadArray.
if ( array_key_exists( $className, ezcBase::$autoloadArray ) )
{
... | php | public static function autoload( $className )
{
Eresus_Kernel::log(__METHOD__, LOG_DEBUG, '(%s)', $className);
ezcBase::setPackageDir();
// Check whether the classname is already in the cached autoloadArray.
if ( array_key_exists( $className, ezcBase::$autoloadArray ) )
{
... | [
"public",
"static",
"function",
"autoload",
"(",
"$",
"className",
")",
"{",
"Eresus_Kernel",
"::",
"log",
"(",
"__METHOD__",
",",
"LOG_DEBUG",
",",
"'(%s)'",
",",
"$",
"className",
")",
";",
"ezcBase",
"::",
"setPackageDir",
"(",
")",
";",
"// Check whether... | Tries to autoload the given className. If the className could be found
this method returns true, otherwise false.
This class caches the requested class names (including the ones who
failed to load).
@param string $className The name of the class that should be loaded.
@return bool | [
"Tries",
"to",
"autoload",
"the",
"given",
"className",
".",
"If",
"the",
"className",
"could",
"be",
"found",
"this",
"method",
"returns",
"true",
"otherwise",
"false",
"."
] | b0afc661105f0a2f65d49abac13956cc93c5188d | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/Base/src/base.php#L123-L217 |
23,340 | Eresus/EresusCMS | src/core/framework/core/3rdparty/ezcomponents/Base/src/base.php | ezcBase.setPackageDir | protected static function setPackageDir()
{
if ( ezcBase::$packageDir !== null )
{
return;
}
// Get the path to the components.
$baseDir = dirname( __FILE__ );
switch ( ezcBase::$libraryMode )
{
case "custom":
ezcBase:... | php | protected static function setPackageDir()
{
if ( ezcBase::$packageDir !== null )
{
return;
}
// Get the path to the components.
$baseDir = dirname( __FILE__ );
switch ( ezcBase::$libraryMode )
{
case "custom":
ezcBase:... | [
"protected",
"static",
"function",
"setPackageDir",
"(",
")",
"{",
"if",
"(",
"ezcBase",
"::",
"$",
"packageDir",
"!==",
"null",
")",
"{",
"return",
";",
"}",
"// Get the path to the components.",
"$",
"baseDir",
"=",
"dirname",
"(",
"__FILE__",
")",
";",
"s... | Figures out the base path of the eZ Components installation.
It stores the path that it finds in a static member variable. The path
depends on the installation method of the eZ Components. The SVN version
has a different path than the PEAR installed version. | [
"Figures",
"out",
"the",
"base",
"path",
"of",
"the",
"eZ",
"Components",
"installation",
"."
] | b0afc661105f0a2f65d49abac13956cc93c5188d | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/Base/src/base.php#L237-L260 |
23,341 | Eresus/EresusCMS | src/core/framework/core/3rdparty/ezcomponents/Base/src/base.php | ezcBase.requireFile | protected static function requireFile( $fileName, $className, $prefix )
{
$autoloadDir = ezcBase::$packageDir . "autoload/";
// We need the full path to the fileName. The method file_exists() doesn't
// automatically check the (php.ini) library paths. Therefore:
// file_exists( "ezc... | php | protected static function requireFile( $fileName, $className, $prefix )
{
$autoloadDir = ezcBase::$packageDir . "autoload/";
// We need the full path to the fileName. The method file_exists() doesn't
// automatically check the (php.ini) library paths. Therefore:
// file_exists( "ezc... | [
"protected",
"static",
"function",
"requireFile",
"(",
"$",
"fileName",
",",
"$",
"className",
",",
"$",
"prefix",
")",
"{",
"$",
"autoloadDir",
"=",
"ezcBase",
"::",
"$",
"packageDir",
".",
"\"autoload/\"",
";",
"// We need the full path to the fileName. The method... | Tries to load the autoload array and, if loaded correctly, includes the class.
@param string $fileName Name of the autoload file.
@param string $className Name of the class that should be autoloaded.
@param string $prefix The prefix of the class repository.
@return bool True is returned when the file is co... | [
"Tries",
"to",
"load",
"the",
"autoload",
"array",
"and",
"if",
"loaded",
"correctly",
"includes",
"the",
"class",
"."
] | b0afc661105f0a2f65d49abac13956cc93c5188d | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/Base/src/base.php#L272-L341 |
23,342 | Eresus/EresusCMS | src/core/framework/core/3rdparty/ezcomponents/Base/src/base.php | ezcBase.checkDependency | public static function checkDependency( $component, $type, $value )
{
switch ( $type )
{
case self::DEP_PHP_EXTENSION:
if ( extension_loaded( $value ) )
{
return;
}
else
{
... | php | public static function checkDependency( $component, $type, $value )
{
switch ( $type )
{
case self::DEP_PHP_EXTENSION:
if ( extension_loaded( $value ) )
{
return;
}
else
{
... | [
"public",
"static",
"function",
"checkDependency",
"(",
"$",
"component",
",",
"$",
"type",
",",
"$",
"value",
")",
"{",
"switch",
"(",
"$",
"type",
")",
"{",
"case",
"self",
"::",
"DEP_PHP_EXTENSION",
":",
"if",
"(",
"extension_loaded",
"(",
"$",
"value... | Checks for dependencies on PHP versions or extensions
The function as called by the $component component checks for the $type
dependency. The dependency $type is compared against the $value. The
function aborts the script if the dependency is not matched.
@param string $component
@param int $type
@param mixed $value | [
"Checks",
"for",
"dependencies",
"on",
"PHP",
"versions",
"or",
"extensions"
] | b0afc661105f0a2f65d49abac13956cc93c5188d | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/Base/src/base.php#L419-L448 |
23,343 | Eresus/EresusCMS | src/core/framework/core/3rdparty/ezcomponents/Base/src/base.php | ezcBase.getRepositoryDirectories | public static function getRepositoryDirectories()
{
$autoloadDirs = array();
ezcBase::setPackageDir();
$repositoryDir = self::$currentWorkingDirectory ? self::$currentWorkingDirectory : ( realpath( dirname( __FILE__ ) . '/../../' ) );
$autoloadDirs['ezc'] = new ezcBaseRepositoryDirec... | php | public static function getRepositoryDirectories()
{
$autoloadDirs = array();
ezcBase::setPackageDir();
$repositoryDir = self::$currentWorkingDirectory ? self::$currentWorkingDirectory : ( realpath( dirname( __FILE__ ) . '/../../' ) );
$autoloadDirs['ezc'] = new ezcBaseRepositoryDirec... | [
"public",
"static",
"function",
"getRepositoryDirectories",
"(",
")",
"{",
"$",
"autoloadDirs",
"=",
"array",
"(",
")",
";",
"ezcBase",
"::",
"setPackageDir",
"(",
")",
";",
"$",
"repositoryDir",
"=",
"self",
"::",
"$",
"currentWorkingDirectory",
"?",
"self",
... | Return the list of directories that contain class repositories.
The path to the eZ components directory is always included in the result
array. Each element in the returned array has the format of:
packageDirectory => ezcBaseRepositoryDirectory
@return array(string=>ezcBaseRepositoryDirectory) | [
"Return",
"the",
"list",
"of",
"directories",
"that",
"contain",
"class",
"repositories",
"."
] | b0afc661105f0a2f65d49abac13956cc93c5188d | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/Base/src/base.php#L459-L473 |
23,344 | Eresus/EresusCMS | src/core/framework/core/3rdparty/ezcomponents/Base/src/base.php | ezcBase.addClassRepository | public static function addClassRepository( $basePath, $autoloadDirPath = null, $prefix = null )
{
// check if base path exists
if ( !is_dir( $basePath ) )
{
throw new ezcBaseFileNotFoundException( $basePath, 'base directory' );
}
// calculate autoload path if it ... | php | public static function addClassRepository( $basePath, $autoloadDirPath = null, $prefix = null )
{
// check if base path exists
if ( !is_dir( $basePath ) )
{
throw new ezcBaseFileNotFoundException( $basePath, 'base directory' );
}
// calculate autoload path if it ... | [
"public",
"static",
"function",
"addClassRepository",
"(",
"$",
"basePath",
",",
"$",
"autoloadDirPath",
"=",
"null",
",",
"$",
"prefix",
"=",
"null",
")",
"{",
"// check if base path exists",
"if",
"(",
"!",
"is_dir",
"(",
"$",
"basePath",
")",
")",
"{",
... | Adds an additional class repository.
Used for adding class repositoryies outside the eZ components to be
loaded by the autoload system.
This function takes two arguments: $basePath is the base path for the
whole class repository and $autoloadDirPath the path where autoload
files for this repository are found. The pat... | [
"Adds",
"an",
"additional",
"class",
"repository",
"."
] | b0afc661105f0a2f65d49abac13956cc93c5188d | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/Base/src/base.php#L551-L589 |
23,345 | Eresus/EresusCMS | src/core/framework/core/3rdparty/ezcomponents/Base/src/base.php | ezcBase.getInstallationPath | public static function getInstallationPath()
{
self::setPackageDir();
$path = realpath( self::$packageDir );
if ( substr( $path, -1 ) !== DIRECTORY_SEPARATOR )
{
$path .= DIRECTORY_SEPARATOR;
}
return $path;
} | php | public static function getInstallationPath()
{
self::setPackageDir();
$path = realpath( self::$packageDir );
if ( substr( $path, -1 ) !== DIRECTORY_SEPARATOR )
{
$path .= DIRECTORY_SEPARATOR;
}
return $path;
} | [
"public",
"static",
"function",
"getInstallationPath",
"(",
")",
"{",
"self",
"::",
"setPackageDir",
"(",
")",
";",
"$",
"path",
"=",
"realpath",
"(",
"self",
"::",
"$",
"packageDir",
")",
";",
"if",
"(",
"substr",
"(",
"$",
"path",
",",
"-",
"1",
")... | Returns the base path of the eZ Components installation
This method returns the base path, including a trailing directory
separator.
@return string | [
"Returns",
"the",
"base",
"path",
"of",
"the",
"eZ",
"Components",
"installation"
] | b0afc661105f0a2f65d49abac13956cc93c5188d | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/Base/src/base.php#L599-L609 |
23,346 | Eresus/EresusCMS | src/core/framework/core/3rdparty/ezcomponents/Base/src/base.php | ezcBase.setRunMode | public static function setRunMode( $runMode )
{
if ( !in_array( $runMode, array( ezcBase::MODE_PRODUCTION, ezcBase::MODE_DEVELOPMENT ) ) )
{
throw new ezcBaseValueException( 'runMode', $runMode, 'ezcBase::MODE_PRODUCTION or ezcBase::MODE_DEVELOPMENT' );
}
self::$runMode ... | php | public static function setRunMode( $runMode )
{
if ( !in_array( $runMode, array( ezcBase::MODE_PRODUCTION, ezcBase::MODE_DEVELOPMENT ) ) )
{
throw new ezcBaseValueException( 'runMode', $runMode, 'ezcBase::MODE_PRODUCTION or ezcBase::MODE_DEVELOPMENT' );
}
self::$runMode ... | [
"public",
"static",
"function",
"setRunMode",
"(",
"$",
"runMode",
")",
"{",
"if",
"(",
"!",
"in_array",
"(",
"$",
"runMode",
",",
"array",
"(",
"ezcBase",
"::",
"MODE_PRODUCTION",
",",
"ezcBase",
"::",
"MODE_DEVELOPMENT",
")",
")",
")",
"{",
"throw",
"n... | Sets the development mode to the one specified.
@param int $runMode | [
"Sets",
"the",
"development",
"mode",
"to",
"the",
"one",
"specified",
"."
] | b0afc661105f0a2f65d49abac13956cc93c5188d | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/Base/src/base.php#L616-L624 |
23,347 | xiewulong/yii2-fileupload | oss/libs/symfony/yaml/Symfony/Component/Yaml/Inline.php | Inline.parse | public static function parse($value, $exceptionOnInvalidType = false, $objectSupport = false)
{
self::$exceptionOnInvalidType = $exceptionOnInvalidType;
self::$objectSupport = $objectSupport;
$value = trim($value);
if (0 == strlen($value)) {
return '';
}
... | php | public static function parse($value, $exceptionOnInvalidType = false, $objectSupport = false)
{
self::$exceptionOnInvalidType = $exceptionOnInvalidType;
self::$objectSupport = $objectSupport;
$value = trim($value);
if (0 == strlen($value)) {
return '';
}
... | [
"public",
"static",
"function",
"parse",
"(",
"$",
"value",
",",
"$",
"exceptionOnInvalidType",
"=",
"false",
",",
"$",
"objectSupport",
"=",
"false",
")",
"{",
"self",
"::",
"$",
"exceptionOnInvalidType",
"=",
"$",
"exceptionOnInvalidType",
";",
"self",
"::",... | Converts a YAML string to a PHP array.
@param string $value A YAML string
@param Boolean $exceptionOnInvalidType true if an exception must be thrown on invalid types (a PHP resource or object), false otherwise
@param Boolean $objectSupport true if object support is enabled, false otherwise
... | [
"Converts",
"a",
"YAML",
"string",
"to",
"a",
"PHP",
"array",
"."
] | 3e75b17a4a18dd8466e3f57c63136de03470ca82 | https://github.com/xiewulong/yii2-fileupload/blob/3e75b17a4a18dd8466e3f57c63136de03470ca82/oss/libs/symfony/yaml/Symfony/Component/Yaml/Inline.php#L39-L79 |
23,348 | xiewulong/yii2-fileupload | oss/libs/symfony/yaml/Symfony/Component/Yaml/Inline.php | Inline.parseScalar | public static function parseScalar($scalar, $delimiters = null, $stringDelimiters = array('"', "'"), &$i = 0, $evaluate = true)
{
if (in_array($scalar[$i], $stringDelimiters)) {
// quoted scalar
$output = self::parseQuotedScalar($scalar, $i);
if (null !== $delimiters) {
... | php | public static function parseScalar($scalar, $delimiters = null, $stringDelimiters = array('"', "'"), &$i = 0, $evaluate = true)
{
if (in_array($scalar[$i], $stringDelimiters)) {
// quoted scalar
$output = self::parseQuotedScalar($scalar, $i);
if (null !== $delimiters) {
... | [
"public",
"static",
"function",
"parseScalar",
"(",
"$",
"scalar",
",",
"$",
"delimiters",
"=",
"null",
",",
"$",
"stringDelimiters",
"=",
"array",
"(",
"'\"'",
",",
"\"'\"",
")",
",",
"&",
"$",
"i",
"=",
"0",
",",
"$",
"evaluate",
"=",
"true",
")",
... | Parses a scalar to a YAML string.
@param scalar $scalar
@param string $delimiters
@param array $stringDelimiters
@param integer &$i
@param Boolean $evaluate
@return string A YAML string
@throws ParseException When malformed inline YAML string is parsed | [
"Parses",
"a",
"scalar",
"to",
"a",
"YAML",
"string",
"."
] | 3e75b17a4a18dd8466e3f57c63136de03470ca82 | https://github.com/xiewulong/yii2-fileupload/blob/3e75b17a4a18dd8466e3f57c63136de03470ca82/oss/libs/symfony/yaml/Symfony/Component/Yaml/Inline.php#L193-L226 |
23,349 | flowcode/AmulenUserBundle | src/Flowcode/UserBundle/Controller/SecurityController.php | SecurityController.forgotCheckAction | public function forgotCheckAction(Request $request)
{
$error = null;
$last_email = null;
$userService = $this->get("flowcode.user");
$user = $userService->loadUserByUsername($request->get("_username"));
if ($user) {
$userService->resetPasssword($user);
}... | php | public function forgotCheckAction(Request $request)
{
$error = null;
$last_email = null;
$userService = $this->get("flowcode.user");
$user = $userService->loadUserByUsername($request->get("_username"));
if ($user) {
$userService->resetPasssword($user);
}... | [
"public",
"function",
"forgotCheckAction",
"(",
"Request",
"$",
"request",
")",
"{",
"$",
"error",
"=",
"null",
";",
"$",
"last_email",
"=",
"null",
";",
"$",
"userService",
"=",
"$",
"this",
"->",
"get",
"(",
"\"flowcode.user\"",
")",
";",
"$",
"user",
... | Forget check.
@Route("/forgot_check", name="amulen_forgot_check")
@Method("POST")
@Template("FlowcodeUserBundle:Security:forgot.html.twig") | [
"Forget",
"check",
"."
] | 00055834d9f094e63dcd8d66e2fedb822fcddee0 | https://github.com/flowcode/AmulenUserBundle/blob/00055834d9f094e63dcd8d66e2fedb822fcddee0/src/Flowcode/UserBundle/Controller/SecurityController.php#L90-L112 |
23,350 | Laralum/Events | src/Policies/EventPolicy.php | EventPolicy.view | public function view($user, Event $event)
{
if ($event->creator->id == $user->id) {
return true;
}
return User::findOrFail($user->id)->hasPermission('laralum::events.view');
} | php | public function view($user, Event $event)
{
if ($event->creator->id == $user->id) {
return true;
}
return User::findOrFail($user->id)->hasPermission('laralum::events.view');
} | [
"public",
"function",
"view",
"(",
"$",
"user",
",",
"Event",
"$",
"event",
")",
"{",
"if",
"(",
"$",
"event",
"->",
"creator",
"->",
"id",
"==",
"$",
"user",
"->",
"id",
")",
"{",
"return",
"true",
";",
"}",
"return",
"User",
"::",
"findOrFail",
... | Determine if the current user can view events.
@param mixed $user
@return bool | [
"Determine",
"if",
"the",
"current",
"user",
"can",
"view",
"events",
"."
] | 9dc36468f4253e7d040863a115ea94cded0e6aa5 | https://github.com/Laralum/Events/blob/9dc36468f4253e7d040863a115ea94cded0e6aa5/src/Policies/EventPolicy.php#L57-L64 |
23,351 | Laralum/Events | src/Policies/EventPolicy.php | EventPolicy.publicDelete | public function publicDelete($user, Event $event)
{
if ($event->creator->id == $user->id) {
return User::findOrFail($user->id)->hasPermission('laralum::events.delete-public');
}
return false;
} | php | public function publicDelete($user, Event $event)
{
if ($event->creator->id == $user->id) {
return User::findOrFail($user->id)->hasPermission('laralum::events.delete-public');
}
return false;
} | [
"public",
"function",
"publicDelete",
"(",
"$",
"user",
",",
"Event",
"$",
"event",
")",
"{",
"if",
"(",
"$",
"event",
"->",
"creator",
"->",
"id",
"==",
"$",
"user",
"->",
"id",
")",
"{",
"return",
"User",
"::",
"findOrFail",
"(",
"$",
"user",
"->... | Determine if the current user can delete events on public views.
@param mixed $user
@return bool | [
"Determine",
"if",
"the",
"current",
"user",
"can",
"delete",
"events",
"on",
"public",
"views",
"."
] | 9dc36468f4253e7d040863a115ea94cded0e6aa5 | https://github.com/Laralum/Events/blob/9dc36468f4253e7d040863a115ea94cded0e6aa5/src/Policies/EventPolicy.php#L185-L192 |
23,352 | 42mate/towel | src/Towel/Controller/BaseController.php | BaseController.routeError | public function routeError(\Exception $e)
{
if ($e instanceof NotFoundHttpException) {
$responseContent = $this->twig()->render('Default\404.twig');
$response = new Response($responseContent, 404);
} else {
$responseContent = $this->twig()->render('Default\500.twi... | php | public function routeError(\Exception $e)
{
if ($e instanceof NotFoundHttpException) {
$responseContent = $this->twig()->render('Default\404.twig');
$response = new Response($responseContent, 404);
} else {
$responseContent = $this->twig()->render('Default\500.twi... | [
"public",
"function",
"routeError",
"(",
"\\",
"Exception",
"$",
"e",
")",
"{",
"if",
"(",
"$",
"e",
"instanceof",
"NotFoundHttpException",
")",
"{",
"$",
"responseContent",
"=",
"$",
"this",
"->",
"twig",
"(",
")",
"->",
"render",
"(",
"'Default\\404.twig... | 404 and 500 error page for non debug mode
@param \Exception $e
@return Response | [
"404",
"and",
"500",
"error",
"page",
"for",
"non",
"debug",
"mode"
] | 5316c3075fc844e8a5cbae113712b26556227dff | https://github.com/42mate/towel/blob/5316c3075fc844e8a5cbae113712b26556227dff/src/Towel/Controller/BaseController.php#L34-L45 |
23,353 | 42mate/towel | src/Towel/Controller/BaseController.php | BaseController.setMessage | public function setMessage($type, $content)
{
$message = new \stdClass;
$message->mt = $type;
$message->content = $content;
$messages = $this->session()->get('messages', array());
$messages[] = $message;
$this->session()->set('messages', $messages);
} | php | public function setMessage($type, $content)
{
$message = new \stdClass;
$message->mt = $type;
$message->content = $content;
$messages = $this->session()->get('messages', array());
$messages[] = $message;
$this->session()->set('messages', $messages);
} | [
"public",
"function",
"setMessage",
"(",
"$",
"type",
",",
"$",
"content",
")",
"{",
"$",
"message",
"=",
"new",
"\\",
"stdClass",
";",
"$",
"message",
"->",
"mt",
"=",
"$",
"type",
";",
"$",
"message",
"->",
"content",
"=",
"$",
"content",
";",
"$... | Sets a user message to present after reload or redirect.
@param $type
@param $content | [
"Sets",
"a",
"user",
"message",
"to",
"present",
"after",
"reload",
"or",
"redirect",
"."
] | 5316c3075fc844e8a5cbae113712b26556227dff | https://github.com/42mate/towel/blob/5316c3075fc844e8a5cbae113712b26556227dff/src/Towel/Controller/BaseController.php#L83-L91 |
23,354 | 42mate/towel | src/Towel/Controller/BaseController.php | BaseController.hasErrorMessages | public function hasErrorMessages() {
$messages = $this->getMessages();
foreach ($messages as $message) {
if ($message->mt == 'error') {
return true;
}
}
return false;
} | php | public function hasErrorMessages() {
$messages = $this->getMessages();
foreach ($messages as $message) {
if ($message->mt == 'error') {
return true;
}
}
return false;
} | [
"public",
"function",
"hasErrorMessages",
"(",
")",
"{",
"$",
"messages",
"=",
"$",
"this",
"->",
"getMessages",
"(",
")",
";",
"foreach",
"(",
"$",
"messages",
"as",
"$",
"message",
")",
"{",
"if",
"(",
"$",
"message",
"->",
"mt",
"==",
"'error'",
"... | Checks into the message bag if there is some error message.
Type == error | [
"Checks",
"into",
"the",
"message",
"bag",
"if",
"there",
"is",
"some",
"error",
"message",
".",
"Type",
"==",
"error"
] | 5316c3075fc844e8a5cbae113712b26556227dff | https://github.com/42mate/towel/blob/5316c3075fc844e8a5cbae113712b26556227dff/src/Towel/Controller/BaseController.php#L97-L105 |
23,355 | 42mate/towel | src/Towel/Controller/BaseController.php | BaseController.attachFiles | public function attachFiles($id, $table, $files)
{
foreach ($files as $file) {
if (!empty($file)) {
$this->attachFile($id, $table, $file);
}
}
} | php | public function attachFiles($id, $table, $files)
{
foreach ($files as $file) {
if (!empty($file)) {
$this->attachFile($id, $table, $file);
}
}
} | [
"public",
"function",
"attachFiles",
"(",
"$",
"id",
",",
"$",
"table",
",",
"$",
"files",
")",
"{",
"foreach",
"(",
"$",
"files",
"as",
"$",
"file",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"file",
")",
")",
"{",
"$",
"this",
"->",
"attach... | It will attach the array of files to the entity.
@param $id
@param $table
@param $files | [
"It",
"will",
"attach",
"the",
"array",
"of",
"files",
"to",
"the",
"entity",
"."
] | 5316c3075fc844e8a5cbae113712b26556227dff | https://github.com/42mate/towel/blob/5316c3075fc844e8a5cbae113712b26556227dff/src/Towel/Controller/BaseController.php#L124-L131 |
23,356 | 42mate/towel | src/Towel/Controller/BaseController.php | BaseController.attachFile | public function attachFile($id, $table, \Symfony\Component\HttpFoundation\File\UploadedFile $file)
{
$newFileName = md5(microtime() . '.' . strtolower($file->getClientOriginalExtension()));
$relativePath = $table . '/' . date('Y/m/d');
$relativeFilePath = $relativePath . '/' . $newFileName;
... | php | public function attachFile($id, $table, \Symfony\Component\HttpFoundation\File\UploadedFile $file)
{
$newFileName = md5(microtime() . '.' . strtolower($file->getClientOriginalExtension()));
$relativePath = $table . '/' . date('Y/m/d');
$relativeFilePath = $relativePath . '/' . $newFileName;
... | [
"public",
"function",
"attachFile",
"(",
"$",
"id",
",",
"$",
"table",
",",
"\\",
"Symfony",
"\\",
"Component",
"\\",
"HttpFoundation",
"\\",
"File",
"\\",
"UploadedFile",
"$",
"file",
")",
"{",
"$",
"newFileName",
"=",
"md5",
"(",
"microtime",
"(",
")",... | It will attach the file.
@param $id
@param $table
@param \Symfony\Component\HttpFoundation\File\UploadedFile $file | [
"It",
"will",
"attach",
"the",
"file",
"."
] | 5316c3075fc844e8a5cbae113712b26556227dff | https://github.com/42mate/towel/blob/5316c3075fc844e8a5cbae113712b26556227dff/src/Towel/Controller/BaseController.php#L140-L154 |
23,357 | dappur/dappurware | app/src/Dappurware/Cookies.php | Cookies.setResponseCookie | public function setResponseCookie($response, $name, $value = null, $expiration = 0)
{
$expiration = 1;
if ($expiration == 0) {
$expiration = 30;
}
if (is_numeric($expiration)) {
$expiration = $expiration;
}
$response = FigResponseCookies::set(... | php | public function setResponseCookie($response, $name, $value = null, $expiration = 0)
{
$expiration = 1;
if ($expiration == 0) {
$expiration = 30;
}
if (is_numeric($expiration)) {
$expiration = $expiration;
}
$response = FigResponseCookies::set(... | [
"public",
"function",
"setResponseCookie",
"(",
"$",
"response",
",",
"$",
"name",
",",
"$",
"value",
"=",
"null",
",",
"$",
"expiration",
"=",
"0",
")",
"{",
"$",
"expiration",
"=",
"1",
";",
"if",
"(",
"$",
"expiration",
"==",
"0",
")",
"{",
"$",... | Set New Response Cookie | [
"Set",
"New",
"Response",
"Cookie"
] | 453ca999047693a1f009618820f8497a287f6a05 | https://github.com/dappur/dappurware/blob/453ca999047693a1f009618820f8497a287f6a05/app/src/Dappurware/Cookies.php#L22-L40 |
23,358 | dappur/dappurware | app/src/Dappurware/Cookies.php | Cookies.modifyResponseCookie | public function modifyResponseCookie($response, $name, $value = null, $expiration = 0)
{
$expiration = 1;
if ($expiration == 0) {
$expiration = 30; //Expire After 30 Days
}
if (is_numeric($expiration)) {
$expiration = $expiration;
}
$modify = ... | php | public function modifyResponseCookie($response, $name, $value = null, $expiration = 0)
{
$expiration = 1;
if ($expiration == 0) {
$expiration = 30; //Expire After 30 Days
}
if (is_numeric($expiration)) {
$expiration = $expiration;
}
$modify = ... | [
"public",
"function",
"modifyResponseCookie",
"(",
"$",
"response",
",",
"$",
"name",
",",
"$",
"value",
"=",
"null",
",",
"$",
"expiration",
"=",
"0",
")",
"{",
"$",
"expiration",
"=",
"1",
";",
"if",
"(",
"$",
"expiration",
"==",
"0",
")",
"{",
"... | Modify Response Cookie | [
"Modify",
"Response",
"Cookie"
] | 453ca999047693a1f009618820f8497a287f6a05 | https://github.com/dappur/dappurware/blob/453ca999047693a1f009618820f8497a287f6a05/app/src/Dappurware/Cookies.php#L43-L69 |
23,359 | dappur/dappurware | app/src/Dappurware/Cookies.php | Cookies.setRequestCookie | public function setRequestCookie($request, $name, $value = null)
{
if (empty($name)) {
return false;
}
$request = FigRequestCookies::set($request, Cookie::create($name, $value));
return $request;
} | php | public function setRequestCookie($request, $name, $value = null)
{
if (empty($name)) {
return false;
}
$request = FigRequestCookies::set($request, Cookie::create($name, $value));
return $request;
} | [
"public",
"function",
"setRequestCookie",
"(",
"$",
"request",
",",
"$",
"name",
",",
"$",
"value",
"=",
"null",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"name",
")",
")",
"{",
"return",
"false",
";",
"}",
"$",
"request",
"=",
"FigRequestCookies",
"::... | Set New Request Cookie | [
"Set",
"New",
"Request",
"Cookie"
] | 453ca999047693a1f009618820f8497a287f6a05 | https://github.com/dappur/dappurware/blob/453ca999047693a1f009618820f8497a287f6a05/app/src/Dappurware/Cookies.php#L86-L95 |
23,360 | dappur/dappurware | app/src/Dappurware/Cookies.php | Cookies.modifyRequestCookie | public function modifyRequestCookie($request, $name, $value = null)
{
$modify = function (Cookie $cookie) {
$value = $cookie->getValue();
return $cookie->withValue($value);
};
$request = FigRequestCookies::modify($request, $name, $modify);
return $request;
... | php | public function modifyRequestCookie($request, $name, $value = null)
{
$modify = function (Cookie $cookie) {
$value = $cookie->getValue();
return $cookie->withValue($value);
};
$request = FigRequestCookies::modify($request, $name, $modify);
return $request;
... | [
"public",
"function",
"modifyRequestCookie",
"(",
"$",
"request",
",",
"$",
"name",
",",
"$",
"value",
"=",
"null",
")",
"{",
"$",
"modify",
"=",
"function",
"(",
"Cookie",
"$",
"cookie",
")",
"{",
"$",
"value",
"=",
"$",
"cookie",
"->",
"getValue",
... | Modify Request Cookie | [
"Modify",
"Request",
"Cookie"
] | 453ca999047693a1f009618820f8497a287f6a05 | https://github.com/dappur/dappurware/blob/453ca999047693a1f009618820f8497a287f6a05/app/src/Dappurware/Cookies.php#L98-L109 |
23,361 | kecik-framework/kecik | Kecik/Request.php | UploadFile.move | public function move( $destination, $newName = '' ) {
$source = $this->file['tmp_name'];
if ( $destination != '' && substr( $destination, - 1 ) != '/' ) {
$destination .= '/';
}
if ( ! empty( $newName ) ) {
$target = $destination . $newName;
} else {
$target = $destination . $this->file['name'];
... | php | public function move( $destination, $newName = '' ) {
$source = $this->file['tmp_name'];
if ( $destination != '' && substr( $destination, - 1 ) != '/' ) {
$destination .= '/';
}
if ( ! empty( $newName ) ) {
$target = $destination . $newName;
} else {
$target = $destination . $this->file['name'];
... | [
"public",
"function",
"move",
"(",
"$",
"destination",
",",
"$",
"newName",
"=",
"''",
")",
"{",
"$",
"source",
"=",
"$",
"this",
"->",
"file",
"[",
"'tmp_name'",
"]",
";",
"if",
"(",
"$",
"destination",
"!=",
"''",
"&&",
"substr",
"(",
"$",
"desti... | Move file from temporary to actual location
@param $destination
@param string $newName
@return string
@throws FileException | [
"Move",
"file",
"from",
"temporary",
"to",
"actual",
"location"
] | fa87e593affe1c9c51a2acd264b85ec06df31d7c | https://github.com/kecik-framework/kecik/blob/fa87e593affe1c9c51a2acd264b85ec06df31d7c/Kecik/Request.php#L225-L255 |
23,362 | heidelpay/PhpDoc | src/phpDocumentor/Transformer/Router/Rule.php | Rule.translateToUrlEncodedPath | protected function translateToUrlEncodedPath($generatedPathAsUtf8)
{
$iso88591Path = explode('/', $generatedPathAsUtf8);
foreach ($iso88591Path as &$part) {
// identify and skip schemes
if (substr($part, -1) == ':') {
continue;
}
// o... | php | protected function translateToUrlEncodedPath($generatedPathAsUtf8)
{
$iso88591Path = explode('/', $generatedPathAsUtf8);
foreach ($iso88591Path as &$part) {
// identify and skip schemes
if (substr($part, -1) == ':') {
continue;
}
// o... | [
"protected",
"function",
"translateToUrlEncodedPath",
"(",
"$",
"generatedPathAsUtf8",
")",
"{",
"$",
"iso88591Path",
"=",
"explode",
"(",
"'/'",
",",
"$",
"generatedPathAsUtf8",
")",
";",
"foreach",
"(",
"$",
"iso88591Path",
"as",
"&",
"$",
"part",
")",
"{",
... | Translates the provided path, with UTF-8 characters, into a web- and windows-safe variant.
Windows does not support the use of UTF-8 characters on their file-system. In order to be sure that both
the web and windows can support the given filename we decode the UTF-8 characters and then url encode them
so that they wil... | [
"Translates",
"the",
"provided",
"path",
"with",
"UTF",
"-",
"8",
"characters",
"into",
"a",
"web",
"-",
"and",
"windows",
"-",
"safe",
"variant",
"."
] | 5ac9e842cbd4cbb70900533b240c131f3515ee02 | https://github.com/heidelpay/PhpDoc/blob/5ac9e842cbd4cbb70900533b240c131f3515ee02/src/phpDocumentor/Transformer/Router/Rule.php#L88-L110 |
23,363 | DevGroup-ru/yii2-measure | src/actions/UpdateAction.php | UpdateAction.run | public function run($id = null)
{
if ($id === null) {
$model = new Measure;
$model->loadDefaultValues();
} else {
$model = $this->controller->findModel($id);
}
$isLoaded = $model->load(\Yii::$app->request->post());
$hasAccess = ($model->isN... | php | public function run($id = null)
{
if ($id === null) {
$model = new Measure;
$model->loadDefaultValues();
} else {
$model = $this->controller->findModel($id);
}
$isLoaded = $model->load(\Yii::$app->request->post());
$hasAccess = ($model->isN... | [
"public",
"function",
"run",
"(",
"$",
"id",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"id",
"===",
"null",
")",
"{",
"$",
"model",
"=",
"new",
"Measure",
";",
"$",
"model",
"->",
"loadDefaultValues",
"(",
")",
";",
"}",
"else",
"{",
"$",
"model",
... | Updates an existing Measure model.
If update is successful, the browser will be redirected to the 'view' page.
@param integer $id
@return mixed | [
"Updates",
"an",
"existing",
"Measure",
"model",
".",
"If",
"update",
"is",
"successful",
"the",
"browser",
"will",
"be",
"redirected",
"to",
"the",
"view",
"page",
"."
] | 1d41a4af6ad3f2e34cabc32fa1c97bfd3643269c | https://github.com/DevGroup-ru/yii2-measure/blob/1d41a4af6ad3f2e34cabc32fa1c97bfd3643269c/src/actions/UpdateAction.php#L22-L47 |
23,364 | Laralum/Users | src/Models/User.php | User.avatar | public function avatar($size = 100)
{
/*
if(File::exists(public_path('/avatars'.'/'.md5($this->email)))){
return asset('/avatars'.'/'.md5($this->email));
}
return "https://tracker.moodle.org/secure/attachment/30912/f3.png";
*/
// Get gavatar avatar
... | php | public function avatar($size = 100)
{
/*
if(File::exists(public_path('/avatars'.'/'.md5($this->email)))){
return asset('/avatars'.'/'.md5($this->email));
}
return "https://tracker.moodle.org/secure/attachment/30912/f3.png";
*/
// Get gavatar avatar
... | [
"public",
"function",
"avatar",
"(",
"$",
"size",
"=",
"100",
")",
"{",
"/*\n if(File::exists(public_path('/avatars'.'/'.md5($this->email)))){\n return asset('/avatars'.'/'.md5($this->email));\n }\n return \"https://tracker.moodle.org/secure/attachment/30912/f3.pn... | Returns the user avatar. | [
"Returns",
"the",
"user",
"avatar",
"."
] | 788851d4cdf4bff548936faf1b12cf4697d13428 | https://github.com/Laralum/Users/blob/788851d4cdf4bff548936faf1b12cf4697d13428/src/Models/User.php#L47-L63 |
23,365 | vuer/token | src/Traits/Tokenable.php | Tokenable.getLastToken | public function getLastToken($type, $key = 'type')
{
return $this->token()->orderBy('tokens.created_at', 'desc')->where($key, $type)->first();
} | php | public function getLastToken($type, $key = 'type')
{
return $this->token()->orderBy('tokens.created_at', 'desc')->where($key, $type)->first();
} | [
"public",
"function",
"getLastToken",
"(",
"$",
"type",
",",
"$",
"key",
"=",
"'type'",
")",
"{",
"return",
"$",
"this",
"->",
"token",
"(",
")",
"->",
"orderBy",
"(",
"'tokens.created_at'",
",",
"'desc'",
")",
"->",
"where",
"(",
"$",
"key",
",",
"$... | Get the last Token by the type.
@param string $type
@param string $key
@return Token | [
"Get",
"the",
"last",
"Token",
"by",
"the",
"type",
"."
] | 096ba1820c850d5e29062a304bdc399789388714 | https://github.com/vuer/token/blob/096ba1820c850d5e29062a304bdc399789388714/src/Traits/Tokenable.php#L55-L58 |
23,366 | vuer/token | src/Traits/Tokenable.php | Tokenable.checkToken | public function checkToken($token)
{
return (bool) $this->token()->where('token', $token)->where('expiration_date', '>', Carbon::now())->count();
} | php | public function checkToken($token)
{
return (bool) $this->token()->where('token', $token)->where('expiration_date', '>', Carbon::now())->count();
} | [
"public",
"function",
"checkToken",
"(",
"$",
"token",
")",
"{",
"return",
"(",
"bool",
")",
"$",
"this",
"->",
"token",
"(",
")",
"->",
"where",
"(",
"'token'",
",",
"$",
"token",
")",
"->",
"where",
"(",
"'expiration_date'",
",",
"'>'",
",",
"Carbo... | Check the token.
@param string $token
@return boolean | [
"Check",
"the",
"token",
"."
] | 096ba1820c850d5e29062a304bdc399789388714 | https://github.com/vuer/token/blob/096ba1820c850d5e29062a304bdc399789388714/src/Traits/Tokenable.php#L76-L79 |
23,367 | vuer/token | src/Traits/Tokenable.php | Tokenable.createToken | public function createToken($type, $expire = 60, $length = 48, $customProperties = null)
{
return $this->token()->create([
'token' => $this->generateTokenString($length),
'expiration_date' => Carbon::now()->addMinutes($expire),
'type' => $type,
... | php | public function createToken($type, $expire = 60, $length = 48, $customProperties = null)
{
return $this->token()->create([
'token' => $this->generateTokenString($length),
'expiration_date' => Carbon::now()->addMinutes($expire),
'type' => $type,
... | [
"public",
"function",
"createToken",
"(",
"$",
"type",
",",
"$",
"expire",
"=",
"60",
",",
"$",
"length",
"=",
"48",
",",
"$",
"customProperties",
"=",
"null",
")",
"{",
"return",
"$",
"this",
"->",
"token",
"(",
")",
"->",
"create",
"(",
"[",
"'to... | Create new token and return the instance.
@param string $type token type
@param integer $expire expire in minutes
@param integer $length key length
@return Token | [
"Create",
"new",
"token",
"and",
"return",
"the",
"instance",
"."
] | 096ba1820c850d5e29062a304bdc399789388714 | https://github.com/vuer/token/blob/096ba1820c850d5e29062a304bdc399789388714/src/Traits/Tokenable.php#L99-L107 |
23,368 | ouropencode/dachi | src/Router.php | Router.route | public static function route() {
if(defined('DACHI_CLI'))
return false;
$uri = Request::getFullUri();
$route = self::findRoute($uri);
self::performRoute($route);
return Template::render();
} | php | public static function route() {
if(defined('DACHI_CLI'))
return false;
$uri = Request::getFullUri();
$route = self::findRoute($uri);
self::performRoute($route);
return Template::render();
} | [
"public",
"static",
"function",
"route",
"(",
")",
"{",
"if",
"(",
"defined",
"(",
"'DACHI_CLI'",
")",
")",
"return",
"false",
";",
"$",
"uri",
"=",
"Request",
"::",
"getFullUri",
"(",
")",
";",
"$",
"route",
"=",
"self",
"::",
"findRoute",
"(",
"$",... | Performs routing based upon the loaded routing information and the incoming request
@return null | [
"Performs",
"routing",
"based",
"upon",
"the",
"loaded",
"routing",
"information",
"and",
"the",
"incoming",
"request"
] | a0e1daf269d0345afbb859ce20ef9da6decd7efe | https://github.com/ouropencode/dachi/blob/a0e1daf269d0345afbb859ce20ef9da6decd7efe/src/Router.php#L28-L37 |
23,369 | ouropencode/dachi | src/Router.php | Router.findRoute | public static function findRoute($uri) {
if(self::$routes === array())
self::load();
$count = count($uri);
$position = &self::$routes;
for($i = 0; $i < $count; $i++) {
if($i == $count - 1) {
if(isset($position[$uri[$i]]) && isset($position[$uri[$i]]["route"])) {
return $position[$uri[$i]]["rout... | php | public static function findRoute($uri) {
if(self::$routes === array())
self::load();
$count = count($uri);
$position = &self::$routes;
for($i = 0; $i < $count; $i++) {
if($i == $count - 1) {
if(isset($position[$uri[$i]]) && isset($position[$uri[$i]]["route"])) {
return $position[$uri[$i]]["rout... | [
"public",
"static",
"function",
"findRoute",
"(",
"$",
"uri",
")",
"{",
"if",
"(",
"self",
"::",
"$",
"routes",
"===",
"array",
"(",
")",
")",
"self",
"::",
"load",
"(",
")",
";",
"$",
"count",
"=",
"count",
"(",
"$",
"uri",
")",
";",
"$",
"pos... | Find and process a valid route from the uri
@internal
@param array $uri Array of uri parts (split by /)
@throws ValidRouteNotFoundException
@return array | [
"Find",
"and",
"process",
"a",
"valid",
"route",
"from",
"the",
"uri"
] | a0e1daf269d0345afbb859ce20ef9da6decd7efe | https://github.com/ouropencode/dachi/blob/a0e1daf269d0345afbb859ce20ef9da6decd7efe/src/Router.php#L46-L74 |
23,370 | ouropencode/dachi | src/Router.php | Router.performRoute | public static function performRoute($route) {
$api_mode = isset($route["api-mode"]);
Request::setRequestVariables($route["variables"], $api_mode);
$controller = new $route["class"];
$response = $controller->$route["method"]();
if(!Request::isAjax() && !Request::isAPI() && isset($route["render-path"])) {
... | php | public static function performRoute($route) {
$api_mode = isset($route["api-mode"]);
Request::setRequestVariables($route["variables"], $api_mode);
$controller = new $route["class"];
$response = $controller->$route["method"]();
if(!Request::isAjax() && !Request::isAPI() && isset($route["render-path"])) {
... | [
"public",
"static",
"function",
"performRoute",
"(",
"$",
"route",
")",
"{",
"$",
"api_mode",
"=",
"isset",
"(",
"$",
"route",
"[",
"\"api-mode\"",
"]",
")",
";",
"Request",
"::",
"setRequestVariables",
"(",
"$",
"route",
"[",
"\"variables\"",
"]",
",",
... | Perform routing based upon the discovered route
@internal
@param array $route Format: array(class, method, uri_variables)
@see Request::setRequestVariables()
@return mixed Return value of last route to be executed | [
"Perform",
"routing",
"based",
"upon",
"the",
"discovered",
"route"
] | a0e1daf269d0345afbb859ce20ef9da6decd7efe | https://github.com/ouropencode/dachi/blob/a0e1daf269d0345afbb859ce20ef9da6decd7efe/src/Router.php#L83-L101 |
23,371 | digipolisgent/robo-digipolis-general | src/Common/DigipolisPropertiesAware.php | DigipolisPropertiesAware.readProperties | public function readProperties($root = null, $web = null, $vendor = null)
{
if (!$this->propertiesRead) {
if (is_null($root)) {
if (is_callable([$this, 'taskDetermineProjectRoot'])) {
$this->taskDetermineProjectRoot()->run();
}
... | php | public function readProperties($root = null, $web = null, $vendor = null)
{
if (!$this->propertiesRead) {
if (is_null($root)) {
if (is_callable([$this, 'taskDetermineProjectRoot'])) {
$this->taskDetermineProjectRoot()->run();
}
... | [
"public",
"function",
"readProperties",
"(",
"$",
"root",
"=",
"null",
",",
"$",
"web",
"=",
"null",
",",
"$",
"vendor",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"propertiesRead",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"root",
... | Read the properties from the YAML files. Determine project and web root
if needed.
@param string|null $root
The path to the project root, if null the project root will be
determined by taskDetermineProjectRoot().
@param string|null $web
The path to the project web root, if null the web root will be
determined by taskD... | [
"Read",
"the",
"properties",
"from",
"the",
"YAML",
"files",
".",
"Determine",
"project",
"and",
"web",
"root",
"if",
"needed",
"."
] | 66f0806c9ed7bd4e5aaf3f57ae1363f6aaae7cd9 | https://github.com/digipolisgent/robo-digipolis-general/blob/66f0806c9ed7bd4e5aaf3f57ae1363f6aaae7cd9/src/Common/DigipolisPropertiesAware.php#L27-L48 |
23,372 | netzmacht/contao-leaflet-geocode-widget | src/EventListener/RadiusWizardCallbackListener.php | RadiusWizardCallbackListener.generateWizard | public function generateWizard($dataContainer)
{
if (!isset($GLOBALS['TL_DCA'][$dataContainer->table]['fields'][$dataContainer->field]['eval']['coordinates'])) {
return '';
}
return sprintf(
'<a href="#" onclick="$(\'ctrl_%s_toggle\').click();return false;"><img src=... | php | public function generateWizard($dataContainer)
{
if (!isset($GLOBALS['TL_DCA'][$dataContainer->table]['fields'][$dataContainer->field]['eval']['coordinates'])) {
return '';
}
return sprintf(
'<a href="#" onclick="$(\'ctrl_%s_toggle\').click();return false;"><img src=... | [
"public",
"function",
"generateWizard",
"(",
"$",
"dataContainer",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"GLOBALS",
"[",
"'TL_DCA'",
"]",
"[",
"$",
"dataContainer",
"->",
"table",
"]",
"[",
"'fields'",
"]",
"[",
"$",
"dataContainer",
"->",
"field"... | Generate the wizard for the radius widget.
@param DataContainer $dataContainer Data container driver.
@return string
@SuppressWarnings(PHPMD.Superglobals) | [
"Generate",
"the",
"wizard",
"for",
"the",
"radius",
"widget",
"."
] | 08acfbc473696f385d7c6aed6148e51c91443e12 | https://github.com/netzmacht/contao-leaflet-geocode-widget/blob/08acfbc473696f385d7c6aed6148e51c91443e12/src/EventListener/RadiusWizardCallbackListener.php#L33-L44 |
23,373 | wenbinye/PhalconX | src/Helper/ArrayHelper.php | ArrayHelper.pull | public static function pull($arr, $name, $type = null)
{
$ret = [];
if ($type == self::GETTER) {
$method = 'get' . $name;
foreach ($arr as $elem) {
$ret[] = $elem->$method();
}
} elseif ($type == self::OBJ) {
foreach ($arr as $e... | php | public static function pull($arr, $name, $type = null)
{
$ret = [];
if ($type == self::GETTER) {
$method = 'get' . $name;
foreach ($arr as $elem) {
$ret[] = $elem->$method();
}
} elseif ($type == self::OBJ) {
foreach ($arr as $e... | [
"public",
"static",
"function",
"pull",
"(",
"$",
"arr",
",",
"$",
"name",
",",
"$",
"type",
"=",
"null",
")",
"{",
"$",
"ret",
"=",
"[",
"]",
";",
"if",
"(",
"$",
"type",
"==",
"self",
"::",
"GETTER",
")",
"{",
"$",
"method",
"=",
"'get'",
"... | Collects value from array
@param array $array
@param string $name
@param string $type
@return array | [
"Collects",
"value",
"from",
"array"
] | 0d2e1480e722dde56ccd23b2e8a5c8ac6ac2f8e1 | https://github.com/wenbinye/PhalconX/blob/0d2e1480e722dde56ccd23b2e8a5c8ac6ac2f8e1/src/Helper/ArrayHelper.php#L37-L55 |
23,374 | wenbinye/PhalconX | src/Helper/ArrayHelper.php | ArrayHelper.assoc | public static function assoc($arr, $name, $type = null)
{
$ret = [];
if (empty($arr)) {
return $ret;
}
if ($type == self::GETTER) {
$method = 'get' . $name;
foreach ($arr as $elem) {
$ret[$elem->$method()] = $elem;
}
... | php | public static function assoc($arr, $name, $type = null)
{
$ret = [];
if (empty($arr)) {
return $ret;
}
if ($type == self::GETTER) {
$method = 'get' . $name;
foreach ($arr as $elem) {
$ret[$elem->$method()] = $elem;
}
... | [
"public",
"static",
"function",
"assoc",
"(",
"$",
"arr",
",",
"$",
"name",
",",
"$",
"type",
"=",
"null",
")",
"{",
"$",
"ret",
"=",
"[",
"]",
";",
"if",
"(",
"empty",
"(",
"$",
"arr",
")",
")",
"{",
"return",
"$",
"ret",
";",
"}",
"if",
"... | Creates associated array
@param array $array
@param string $name
@param string $type
@return array | [
"Creates",
"associated",
"array"
] | 0d2e1480e722dde56ccd23b2e8a5c8ac6ac2f8e1 | https://github.com/wenbinye/PhalconX/blob/0d2e1480e722dde56ccd23b2e8a5c8ac6ac2f8e1/src/Helper/ArrayHelper.php#L65-L86 |
23,375 | wenbinye/PhalconX | src/Helper/ArrayHelper.php | ArrayHelper.select | public static function select($arr, $includedKeys)
{
$ret = [];
foreach ($includedKeys as $key) {
if (array_key_exists($key, $arr)) {
$ret[$key] = $arr[$key];
}
}
return $ret;
} | php | public static function select($arr, $includedKeys)
{
$ret = [];
foreach ($includedKeys as $key) {
if (array_key_exists($key, $arr)) {
$ret[$key] = $arr[$key];
}
}
return $ret;
} | [
"public",
"static",
"function",
"select",
"(",
"$",
"arr",
",",
"$",
"includedKeys",
")",
"{",
"$",
"ret",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"includedKeys",
"as",
"$",
"key",
")",
"{",
"if",
"(",
"array_key_exists",
"(",
"$",
"key",
",",
"$"... | Create array with given keys
@param array $array
@param array $includedKeys
@return array | [
"Create",
"array",
"with",
"given",
"keys"
] | 0d2e1480e722dde56ccd23b2e8a5c8ac6ac2f8e1 | https://github.com/wenbinye/PhalconX/blob/0d2e1480e722dde56ccd23b2e8a5c8ac6ac2f8e1/src/Helper/ArrayHelper.php#L107-L116 |
23,376 | i-lateral/silverstripe-deferedimages | src/DeferedImageExtension.php | DeferedImage.MicroImage | public function MicroImage()
{
$pixel = $this->config()->pixelate;
$blur = $this->config()->blur;
$quality = $this->config()->quality;
$scale = $this->config()->scale;
$variant = $this->owner->variantName(__FUNCTION__, $pixel, $blur, $quality, $scale);
return... | php | public function MicroImage()
{
$pixel = $this->config()->pixelate;
$blur = $this->config()->blur;
$quality = $this->config()->quality;
$scale = $this->config()->scale;
$variant = $this->owner->variantName(__FUNCTION__, $pixel, $blur, $quality, $scale);
return... | [
"public",
"function",
"MicroImage",
"(",
")",
"{",
"$",
"pixel",
"=",
"$",
"this",
"->",
"config",
"(",
")",
"->",
"pixelate",
";",
"$",
"blur",
"=",
"$",
"this",
"->",
"config",
"(",
")",
"->",
"blur",
";",
"$",
"quality",
"=",
"$",
"this",
"->"... | Generates a reduced quality version of the current image
@config
@return void | [
"Generates",
"a",
"reduced",
"quality",
"version",
"of",
"the",
"current",
"image"
] | 6095e2404bbc5e33a8d996909f34111d4f751026 | https://github.com/i-lateral/silverstripe-deferedimages/blob/6095e2404bbc5e33a8d996909f34111d4f751026/src/DeferedImageExtension.php#L50-L73 |
23,377 | zicht/z | src/Zicht/Tool/Container/Traverser.php | Traverser.addVisitor | public function addVisitor($callable, $condition, $when = self::BEFORE)
{
$this->visitors[] = array($when, $condition, $callable);
return $this;
} | php | public function addVisitor($callable, $condition, $when = self::BEFORE)
{
$this->visitors[] = array($when, $condition, $callable);
return $this;
} | [
"public",
"function",
"addVisitor",
"(",
"$",
"callable",
",",
"$",
"condition",
",",
"$",
"when",
"=",
"self",
"::",
"BEFORE",
")",
"{",
"$",
"this",
"->",
"visitors",
"[",
"]",
"=",
"array",
"(",
"$",
"when",
",",
"$",
"condition",
",",
"$",
"cal... | Add a visitor to the traverser. The node being visited is passed to the second callback to determine whether
the first callback should be called with the node. The arguments passed to both callbacks are the current node
and the path to the node. The result of the first callback is used to replace the node in the tree.
... | [
"Add",
"a",
"visitor",
"to",
"the",
"traverser",
".",
"The",
"node",
"being",
"visited",
"is",
"passed",
"to",
"the",
"second",
"callback",
"to",
"determine",
"whether",
"the",
"first",
"callback",
"should",
"be",
"called",
"with",
"the",
"node",
".",
"The... | 6a1731dad20b018555a96b726a61d4bf8ec8c886 | https://github.com/zicht/z/blob/6a1731dad20b018555a96b726a61d4bf8ec8c886/src/Zicht/Tool/Container/Traverser.php#L86-L91 |
23,378 | zicht/z | src/Zicht/Tool/Container/Traverser.php | Traverser.doTraverse | private function doTraverse($node, $path = array())
{
foreach ($node as $name => $value) {
$path[] = $name;
$value = $this->doVisit($path, $value, self::BEFORE);
if (is_array($value)) {
$value = $this->doTraverse($value, $path);
}
... | php | private function doTraverse($node, $path = array())
{
foreach ($node as $name => $value) {
$path[] = $name;
$value = $this->doVisit($path, $value, self::BEFORE);
if (is_array($value)) {
$value = $this->doTraverse($value, $path);
}
... | [
"private",
"function",
"doTraverse",
"(",
"$",
"node",
",",
"$",
"path",
"=",
"array",
"(",
")",
")",
"{",
"foreach",
"(",
"$",
"node",
"as",
"$",
"name",
"=>",
"$",
"value",
")",
"{",
"$",
"path",
"[",
"]",
"=",
"$",
"name",
";",
"$",
"value",... | Recursive traversal implementation
@param mixed $node
@param array $path
@return mixed | [
"Recursive",
"traversal",
"implementation"
] | 6a1731dad20b018555a96b726a61d4bf8ec8c886 | https://github.com/zicht/z/blob/6a1731dad20b018555a96b726a61d4bf8ec8c886/src/Zicht/Tool/Container/Traverser.php#L112-L128 |
23,379 | zicht/z | src/Zicht/Tool/Container/Traverser.php | Traverser.doVisit | private function doVisit($path, $value, $when)
{
foreach ($this->visitors as $visitor) {
if ($visitor[0] === $when && call_user_func($visitor[1], $path, $value)) {
try {
$value = call_user_func($visitor[2], $path, $value);
} catch (\Exception $... | php | private function doVisit($path, $value, $when)
{
foreach ($this->visitors as $visitor) {
if ($visitor[0] === $when && call_user_func($visitor[1], $path, $value)) {
try {
$value = call_user_func($visitor[2], $path, $value);
} catch (\Exception $... | [
"private",
"function",
"doVisit",
"(",
"$",
"path",
",",
"$",
"value",
",",
"$",
"when",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"visitors",
"as",
"$",
"visitor",
")",
"{",
"if",
"(",
"$",
"visitor",
"[",
"0",
"]",
"===",
"$",
"when",
"&&",
... | Visits the node with all visitors at the specified time.
@param array $path
@param mixed $value
@param int $when
@return mixed
@throws \RuntimeException | [
"Visits",
"the",
"node",
"with",
"all",
"visitors",
"at",
"the",
"specified",
"time",
"."
] | 6a1731dad20b018555a96b726a61d4bf8ec8c886 | https://github.com/zicht/z/blob/6a1731dad20b018555a96b726a61d4bf8ec8c886/src/Zicht/Tool/Container/Traverser.php#L141-L158 |
23,380 | hametuha/wpametu | src/WPametu/API/Ajax/AjaxPostSearch.php | AjaxPostSearch.get_data | protected function get_data()
{
$post_type = $this->input->get('post_type');
if( !post_type_exists($post_type) ){
$this->error(sprintf($this->__('Post type %s does not exist.'), $post_type), 404);
}
if( !current_user_can('edit_posts') ){
$this->error($this->__... | php | protected function get_data()
{
$post_type = $this->input->get('post_type');
if( !post_type_exists($post_type) ){
$this->error(sprintf($this->__('Post type %s does not exist.'), $post_type), 404);
}
if( !current_user_can('edit_posts') ){
$this->error($this->__... | [
"protected",
"function",
"get_data",
"(",
")",
"{",
"$",
"post_type",
"=",
"$",
"this",
"->",
"input",
"->",
"get",
"(",
"'post_type'",
")",
";",
"if",
"(",
"!",
"post_type_exists",
"(",
"$",
"post_type",
")",
")",
"{",
"$",
"this",
"->",
"error",
"(... | Returns data as array.
@return array | [
"Returns",
"data",
"as",
"array",
"."
] | 0939373800815a8396291143d2a57967340da5aa | https://github.com/hametuha/wpametu/blob/0939373800815a8396291143d2a57967340da5aa/src/WPametu/API/Ajax/AjaxPostSearch.php#L29-L69 |
23,381 | WellCommerce/AppBundle | Form/DataTransformer/MediaEntityToIdentifierTransformer.php | MediaEntityToIdentifierTransformer.reverseTransform | public function reverseTransform($modelData, PropertyPathInterface $propertyPath, $value)
{
$unmodified = intval($value['unmodified']);
if ($unmodified === 1) {
return;
}
$item = null;
if (isset($value[0])) {
$id = $value[0];
$it... | php | public function reverseTransform($modelData, PropertyPathInterface $propertyPath, $value)
{
$unmodified = intval($value['unmodified']);
if ($unmodified === 1) {
return;
}
$item = null;
if (isset($value[0])) {
$id = $value[0];
$it... | [
"public",
"function",
"reverseTransform",
"(",
"$",
"modelData",
",",
"PropertyPathInterface",
"$",
"propertyPath",
",",
"$",
"value",
")",
"{",
"$",
"unmodified",
"=",
"intval",
"(",
"$",
"value",
"[",
"'unmodified'",
"]",
")",
";",
"if",
"(",
"$",
"unmod... | Transforms identifier to entity
@param object $modelData
@param PropertyPathInterface $propertyPath
@param mixed $value | [
"Transforms",
"identifier",
"to",
"entity"
] | 2add687d1c898dd0b24afd611d896e3811a0eac3 | https://github.com/WellCommerce/AppBundle/blob/2add687d1c898dd0b24afd611d896e3811a0eac3/Form/DataTransformer/MediaEntityToIdentifierTransformer.php#L32-L46 |
23,382 | traderinteractive/filter-dates-php | src/Filter/DateTime.php | DateTime.filter | public static function filter($value, bool $allowNull = false, DateTimeZoneStandard $timezone = null)
{
if (self::valueIsNullAndValid($allowNull, $value)) {
return null;
}
if ($value instanceof DateTimeStandard) {
return $value;
}
if (is_int($value) ... | php | public static function filter($value, bool $allowNull = false, DateTimeZoneStandard $timezone = null)
{
if (self::valueIsNullAndValid($allowNull, $value)) {
return null;
}
if ($value instanceof DateTimeStandard) {
return $value;
}
if (is_int($value) ... | [
"public",
"static",
"function",
"filter",
"(",
"$",
"value",
",",
"bool",
"$",
"allowNull",
"=",
"false",
",",
"DateTimeZoneStandard",
"$",
"timezone",
"=",
"null",
")",
"{",
"if",
"(",
"self",
"::",
"valueIsNullAndValid",
"(",
"$",
"allowNull",
",",
"$",
... | Filters the given value into a \DateTime object.
@param mixed $value The value to be filtered.
@param boolean $allowNull True to allow nulls through, and false (default) if nulls should
not be allowed.
@param DateTimeZoneStandard $timezone A \DateTimeZone object representing the timezo... | [
"Filters",
"the",
"given",
"value",
"into",
"a",
"\\",
"DateTime",
"object",
"."
] | f9e60f139da3ebb565317c5d62a6fb0c347be4ee | https://github.com/traderinteractive/filter-dates-php/blob/f9e60f139da3ebb565317c5d62a6fb0c347be4ee/src/Filter/DateTime.php#L28-L47 |
23,383 | traderinteractive/filter-dates-php | src/Filter/DateTime.php | DateTime.format | public static function format(DateTimeInterface $dateTime, string $format = 'c') : string
{
if (empty(trim($format))) {
throw new \InvalidArgumentException('$format is not a non-empty string');
}
return $dateTime->format($format);
} | php | public static function format(DateTimeInterface $dateTime, string $format = 'c') : string
{
if (empty(trim($format))) {
throw new \InvalidArgumentException('$format is not a non-empty string');
}
return $dateTime->format($format);
} | [
"public",
"static",
"function",
"format",
"(",
"DateTimeInterface",
"$",
"dateTime",
",",
"string",
"$",
"format",
"=",
"'c'",
")",
":",
"string",
"{",
"if",
"(",
"empty",
"(",
"trim",
"(",
"$",
"format",
")",
")",
")",
"{",
"throw",
"new",
"\\",
"In... | Filters the give \DateTime object to a formatted string.
@param DateTimeInterface $dateTime The date to be formatted.
@param string $format The format of the outputted date string.
@return string
@throws \InvalidArgumentException Thrown if $format is not a string | [
"Filters",
"the",
"give",
"\\",
"DateTime",
"object",
"to",
"a",
"formatted",
"string",
"."
] | f9e60f139da3ebb565317c5d62a6fb0c347be4ee | https://github.com/traderinteractive/filter-dates-php/blob/f9e60f139da3ebb565317c5d62a6fb0c347be4ee/src/Filter/DateTime.php#L59-L66 |
23,384 | Eresus/EresusCMS | src/core/framework/core/3rdparty/ezcomponents/Mail/src/transports/imap/imap_transport.php | ezcMailImapTransport.disconnect | public function disconnect()
{
if ( $this->state !== self::STATE_NOT_CONNECTED
&& $this->connection->isConnected() === true )
{
$tag = $this->getNextTag();
$this->connection->sendData( "{$tag} LOGOUT" );
// discard the "bye bye" message ("{$tag} OK Lo... | php | public function disconnect()
{
if ( $this->state !== self::STATE_NOT_CONNECTED
&& $this->connection->isConnected() === true )
{
$tag = $this->getNextTag();
$this->connection->sendData( "{$tag} LOGOUT" );
// discard the "bye bye" message ("{$tag} OK Lo... | [
"public",
"function",
"disconnect",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"state",
"!==",
"self",
"::",
"STATE_NOT_CONNECTED",
"&&",
"$",
"this",
"->",
"connection",
"->",
"isConnected",
"(",
")",
"===",
"true",
")",
"{",
"$",
"tag",
"=",
"$",
... | Disconnects the transport from the IMAP server. | [
"Disconnects",
"the",
"transport",
"from",
"the",
"IMAP",
"server",
"."
] | b0afc661105f0a2f65d49abac13956cc93c5188d | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/Mail/src/transports/imap/imap_transport.php#L478-L494 |
23,385 | Eresus/EresusCMS | src/core/framework/core/3rdparty/ezcomponents/Mail/src/transports/imap/imap_transport.php | ezcMailImapTransport.listMailboxes | public function listMailboxes( $reference = '', $mailbox = '*' )
{
if ( $this->state != self::STATE_AUTHENTICATED &&
$this->state != self::STATE_SELECTED &&
$this->state != self::STATE_SELECTED_READONLY )
{
throw new ezcMailTransportException( "Can't call listMa... | php | public function listMailboxes( $reference = '', $mailbox = '*' )
{
if ( $this->state != self::STATE_AUTHENTICATED &&
$this->state != self::STATE_SELECTED &&
$this->state != self::STATE_SELECTED_READONLY )
{
throw new ezcMailTransportException( "Can't call listMa... | [
"public",
"function",
"listMailboxes",
"(",
"$",
"reference",
"=",
"''",
",",
"$",
"mailbox",
"=",
"'*'",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"state",
"!=",
"self",
"::",
"STATE_AUTHENTICATED",
"&&",
"$",
"this",
"->",
"state",
"!=",
"self",
"::",
... | Returns an array with the names of the available mailboxes for the user
currently authenticated on the IMAP server.
Before calling this method, a connection to the IMAP server must be
established and a user must be authenticated successfully.
For more information about $reference and $mailbox, consult
the IMAP RFCs d... | [
"Returns",
"an",
"array",
"with",
"the",
"names",
"of",
"the",
"available",
"mailboxes",
"for",
"the",
"user",
"currently",
"authenticated",
"on",
"the",
"IMAP",
"server",
"."
] | b0afc661105f0a2f65d49abac13956cc93c5188d | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/Mail/src/transports/imap/imap_transport.php#L593-L626 |
23,386 | Eresus/EresusCMS | src/core/framework/core/3rdparty/ezcomponents/Mail/src/transports/imap/imap_transport.php | ezcMailImapTransport.getHierarchyDelimiter | public function getHierarchyDelimiter()
{
if ( $this->state != self::STATE_AUTHENTICATED &&
$this->state != self::STATE_SELECTED &&
$this->state != self::STATE_SELECTED_READONLY )
{
throw new ezcMailTransportException( "Can't call getDelimiter() when not success... | php | public function getHierarchyDelimiter()
{
if ( $this->state != self::STATE_AUTHENTICATED &&
$this->state != self::STATE_SELECTED &&
$this->state != self::STATE_SELECTED_READONLY )
{
throw new ezcMailTransportException( "Can't call getDelimiter() when not success... | [
"public",
"function",
"getHierarchyDelimiter",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"state",
"!=",
"self",
"::",
"STATE_AUTHENTICATED",
"&&",
"$",
"this",
"->",
"state",
"!=",
"self",
"::",
"STATE_SELECTED",
"&&",
"$",
"this",
"->",
"state",
"!=",
... | Returns the hierarchy delimiter of the IMAP server, useful for handling
nested IMAP folders.
For more information about the hierarchy delimiter, consult the IMAP RFCs
{@link http://www.faqs.org/rfcs/rfc1730.html} or
{@link http://www.faqs.org/rfcs/rfc2060.html}, section 6.3.8.
Before calling this method, a connection... | [
"Returns",
"the",
"hierarchy",
"delimiter",
"of",
"the",
"IMAP",
"server",
"useful",
"for",
"handling",
"nested",
"IMAP",
"folders",
"."
] | b0afc661105f0a2f65d49abac13956cc93c5188d | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/Mail/src/transports/imap/imap_transport.php#L654-L685 |
23,387 | Eresus/EresusCMS | src/core/framework/core/3rdparty/ezcomponents/Mail/src/transports/imap/imap_transport.php | ezcMailImapTransport.listMessages | public function listMessages( $contentType = null )
{
if ( $this->state != self::STATE_SELECTED &&
$this->state != self::STATE_SELECTED_READONLY )
{
throw new ezcMailTransportException( "Can't call listMessages() on the IMAP transport when a mailbox is not selected." );
... | php | public function listMessages( $contentType = null )
{
if ( $this->state != self::STATE_SELECTED &&
$this->state != self::STATE_SELECTED_READONLY )
{
throw new ezcMailTransportException( "Can't call listMessages() on the IMAP transport when a mailbox is not selected." );
... | [
"public",
"function",
"listMessages",
"(",
"$",
"contentType",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"state",
"!=",
"self",
"::",
"STATE_SELECTED",
"&&",
"$",
"this",
"->",
"state",
"!=",
"self",
"::",
"STATE_SELECTED_READONLY",
")",
"{",
... | Returns a list of the not deleted messages in the current mailbox.
It returns only the messages with the flag DELETED not set.
Before calling this method, a connection to the IMAP server must be
established and a user must be authenticated successfully, and a mailbox
must be selected.
The format of the returned arra... | [
"Returns",
"a",
"list",
"of",
"the",
"not",
"deleted",
"messages",
"in",
"the",
"current",
"mailbox",
"."
] | b0afc661105f0a2f65d49abac13956cc93c5188d | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/Mail/src/transports/imap/imap_transport.php#L958-L1019 |
23,388 | Eresus/EresusCMS | src/core/framework/core/3rdparty/ezcomponents/Mail/src/transports/imap/imap_transport.php | ezcMailImapTransport.status | public function status( &$numMessages, &$sizeMessages, &$recent = 0, &$unseen = 0 )
{
if ( $this->state != self::STATE_SELECTED &&
$this->state != self::STATE_SELECTED_READONLY )
{
throw new ezcMailTransportException( "Can't call status() on the IMAP transport when a mailbox... | php | public function status( &$numMessages, &$sizeMessages, &$recent = 0, &$unseen = 0 )
{
if ( $this->state != self::STATE_SELECTED &&
$this->state != self::STATE_SELECTED_READONLY )
{
throw new ezcMailTransportException( "Can't call status() on the IMAP transport when a mailbox... | [
"public",
"function",
"status",
"(",
"&",
"$",
"numMessages",
",",
"&",
"$",
"sizeMessages",
",",
"&",
"$",
"recent",
"=",
"0",
",",
"&",
"$",
"unseen",
"=",
"0",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"state",
"!=",
"self",
"::",
"STATE_SELECTED"... | Returns information about the messages in the current mailbox.
The information returned through the parameters is:
- $numMessages = number of not deleted messages in the selected mailbox
- $sizeMessages = sum of the not deleted messages sizes
- $recent = number of recent and not deleted messages
- $unseen = number of ... | [
"Returns",
"information",
"about",
"the",
"messages",
"in",
"the",
"current",
"mailbox",
"."
] | b0afc661105f0a2f65d49abac13956cc93c5188d | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/Mail/src/transports/imap/imap_transport.php#L1142-L1158 |
23,389 | Eresus/EresusCMS | src/core/framework/core/3rdparty/ezcomponents/Mail/src/transports/imap/imap_transport.php | ezcMailImapTransport.listUniqueIdentifiers | public function listUniqueIdentifiers( $msgNum = null )
{
if ( $this->state != self::STATE_SELECTED &&
$this->state != self::STATE_SELECTED_READONLY )
{
throw new ezcMailTransportException( "Can't call listUniqueIdentifiers() on the IMAP transport when a mailbox is not selec... | php | public function listUniqueIdentifiers( $msgNum = null )
{
if ( $this->state != self::STATE_SELECTED &&
$this->state != self::STATE_SELECTED_READONLY )
{
throw new ezcMailTransportException( "Can't call listUniqueIdentifiers() on the IMAP transport when a mailbox is not selec... | [
"public",
"function",
"listUniqueIdentifiers",
"(",
"$",
"msgNum",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"state",
"!=",
"self",
"::",
"STATE_SELECTED",
"&&",
"$",
"this",
"->",
"state",
"!=",
"self",
"::",
"STATE_SELECTED_READONLY",
")",
"{"... | Returns the unique identifiers for the messages from the current mailbox.
You can fetch the unique identifier for a specific message by
providing the $msgNum parameter.
The unique identifier can be used to recognize mail from servers
between requests. In contrast to the message numbers the unique
numbers assigned to ... | [
"Returns",
"the",
"unique",
"identifiers",
"for",
"the",
"messages",
"from",
"the",
"current",
"mailbox",
"."
] | b0afc661105f0a2f65d49abac13956cc93c5188d | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/Mail/src/transports/imap/imap_transport.php#L1389-L1435 |
23,390 | Eresus/EresusCMS | src/core/framework/core/3rdparty/ezcomponents/Mail/src/transports/imap/imap_transport.php | ezcMailImapTransport.countByFlag | public function countByFlag( $flag )
{
$flag = $this->normalizeFlag( $flag );
$messages = $this->searchByFlag( $flag );
return count( $messages );
} | php | public function countByFlag( $flag )
{
$flag = $this->normalizeFlag( $flag );
$messages = $this->searchByFlag( $flag );
return count( $messages );
} | [
"public",
"function",
"countByFlag",
"(",
"$",
"flag",
")",
"{",
"$",
"flag",
"=",
"$",
"this",
"->",
"normalizeFlag",
"(",
"$",
"flag",
")",
";",
"$",
"messages",
"=",
"$",
"this",
"->",
"searchByFlag",
"(",
"$",
"flag",
")",
";",
"return",
"count",... | Wrapper function to fetch count of messages by a certain flag.
$flag can be one of:
Basic flags:
- ANSWERED - message has been answered
- DELETED - message is marked to be deleted by later EXPUNGE
- DRAFT - message is marked as a draft
- FLAGGED - message is "flagged" for urgent/special attention
- RECEN... | [
"Wrapper",
"function",
"to",
"fetch",
"count",
"of",
"messages",
"by",
"a",
"certain",
"flag",
"."
] | b0afc661105f0a2f65d49abac13956cc93c5188d | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/Mail/src/transports/imap/imap_transport.php#L1960-L1965 |
23,391 | Eresus/EresusCMS | src/core/framework/core/3rdparty/ezcomponents/Mail/src/transports/imap/imap_transport.php | ezcMailImapTransport.searchByFlag | protected function searchByFlag( $flag )
{
$uid = ( $this->options->uidReferencing ) ? self::UID : self::NO_UID;
if ( $this->state != self::STATE_SELECTED &&
$this->state != self::STATE_SELECTED_READONLY )
{
throw new ezcMailTransportException( "Can't call searchByF... | php | protected function searchByFlag( $flag )
{
$uid = ( $this->options->uidReferencing ) ? self::UID : self::NO_UID;
if ( $this->state != self::STATE_SELECTED &&
$this->state != self::STATE_SELECTED_READONLY )
{
throw new ezcMailTransportException( "Can't call searchByF... | [
"protected",
"function",
"searchByFlag",
"(",
"$",
"flag",
")",
"{",
"$",
"uid",
"=",
"(",
"$",
"this",
"->",
"options",
"->",
"uidReferencing",
")",
"?",
"self",
"::",
"UID",
":",
"self",
"::",
"NO_UID",
";",
"if",
"(",
"$",
"this",
"->",
"state",
... | Returns an array of message numbers from the selected mailbox which have a
certain flag set.
This method supports unique IDs instead of message numbers. See
{@link ezcMailImapTransportOptions} for how to enable unique IDs
referencing.
$flag can be one of:
Basic flags:
- ANSWERED - message has been answered
- DELET... | [
"Returns",
"an",
"array",
"of",
"message",
"numbers",
"from",
"the",
"selected",
"mailbox",
"which",
"have",
"a",
"certain",
"flag",
"set",
"."
] | b0afc661105f0a2f65d49abac13956cc93c5188d | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/Mail/src/transports/imap/imap_transport.php#L2241-L2278 |
23,392 | Eresus/EresusCMS | src/core/framework/core/3rdparty/ezcomponents/Mail/src/transports/imap/imap_transport.php | ezcMailImapTransport.capability | public function capability()
{
if ( $this->state != self::STATE_NOT_AUTHENTICATED &&
$this->state != self::STATE_AUTHENTICATED &&
$this->state != self::STATE_SELECTED &&
$this->state != self::STATE_SELECTED_READONLY )
{
throw new ezcMailTransportExc... | php | public function capability()
{
if ( $this->state != self::STATE_NOT_AUTHENTICATED &&
$this->state != self::STATE_AUTHENTICATED &&
$this->state != self::STATE_SELECTED &&
$this->state != self::STATE_SELECTED_READONLY )
{
throw new ezcMailTransportExc... | [
"public",
"function",
"capability",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"state",
"!=",
"self",
"::",
"STATE_NOT_AUTHENTICATED",
"&&",
"$",
"this",
"->",
"state",
"!=",
"self",
"::",
"STATE_AUTHENTICATED",
"&&",
"$",
"this",
"->",
"state",
"!=",
... | Returns an array with the capabilities of the IMAP server.
The returned array will be something like this:
<code>
array( 'IMAP4rev1', 'SASL-IR SORT', 'THREAD=REFERENCES', 'MULTIAPPEND',
'UNSELECT', 'LITERAL+', 'IDLE', 'CHILDREN', 'NAMESPACE',
'LOGIN-REFERRALS'
);
</code>
Before calling this method, a connection to th... | [
"Returns",
"an",
"array",
"with",
"the",
"capabilities",
"of",
"the",
"IMAP",
"server",
"."
] | b0afc661105f0a2f65d49abac13956cc93c5188d | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/Mail/src/transports/imap/imap_transport.php#L2328-L2356 |
23,393 | Eresus/EresusCMS | src/core/framework/core/3rdparty/ezcomponents/Mail/src/transports/imap/imap_transport.php | ezcMailImapTransport.expunge | public function expunge()
{
if ( $this->state != self::STATE_SELECTED )
{
throw new ezcMailTransportException( "Can not issue EXPUNGE command if a mailbox is not selected." );
}
$tag = $this->getNextTag();
$this->connection->sendData( "{$tag} EXPUNGE" );
... | php | public function expunge()
{
if ( $this->state != self::STATE_SELECTED )
{
throw new ezcMailTransportException( "Can not issue EXPUNGE command if a mailbox is not selected." );
}
$tag = $this->getNextTag();
$this->connection->sendData( "{$tag} EXPUNGE" );
... | [
"public",
"function",
"expunge",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"state",
"!=",
"self",
"::",
"STATE_SELECTED",
")",
"{",
"throw",
"new",
"ezcMailTransportException",
"(",
"\"Can not issue EXPUNGE command if a mailbox is not selected.\"",
")",
";",
"}",... | Sends an EXPUNGE command to the server.
This method permanently deletes the messages marked for deletion by
the method {@link delete()}.
Before calling this method, a connection to the IMAP server must be
established and a user must be authenticated successfully, and a mailbox
must be selected.
@throws ezcMailTransp... | [
"Sends",
"an",
"EXPUNGE",
"command",
"to",
"the",
"server",
"."
] | b0afc661105f0a2f65d49abac13956cc93c5188d | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/Mail/src/transports/imap/imap_transport.php#L2372-L2386 |
23,394 | Eresus/EresusCMS | src/core/framework/core/3rdparty/ezcomponents/Mail/src/transports/imap/imap_transport.php | ezcMailImapTransport.getNextTag | protected function getNextTag()
{
$tagLetter = substr( $this->currentTag, 0, 1 );
$tagNumber = intval( substr( $this->currentTag, 1 ) );
$tagNumber++;
if ( $tagLetter == 'Z' && $tagNumber == 10000 )
{
$tagLetter = 'A';
$tagNumber = 1;
}
... | php | protected function getNextTag()
{
$tagLetter = substr( $this->currentTag, 0, 1 );
$tagNumber = intval( substr( $this->currentTag, 1 ) );
$tagNumber++;
if ( $tagLetter == 'Z' && $tagNumber == 10000 )
{
$tagLetter = 'A';
$tagNumber = 1;
}
... | [
"protected",
"function",
"getNextTag",
"(",
")",
"{",
"$",
"tagLetter",
"=",
"substr",
"(",
"$",
"this",
"->",
"currentTag",
",",
"0",
",",
"1",
")",
";",
"$",
"tagNumber",
"=",
"intval",
"(",
"substr",
"(",
"$",
"this",
"->",
"currentTag",
",",
"1",... | Generates the next IMAP tag to prepend to client commands.
The structure of the IMAP tag is Axxxx, where:
- A is a letter (uppercase for conformity)
- x is a digit from 0 to 9
example of generated tag: T5439
It uses the class variable $this->currentTag.
Everytime it is called, the tag increases by 1.
If it reaches... | [
"Generates",
"the",
"next",
"IMAP",
"tag",
"to",
"prepend",
"to",
"client",
"commands",
"."
] | b0afc661105f0a2f65d49abac13956cc93c5188d | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/Mail/src/transports/imap/imap_transport.php#L2688-L2705 |
23,395 | Eresus/EresusCMS | src/core/framework/core/3rdparty/ezcomponents/Mail/src/transports/imap/imap_transport.php | ezcMailImapTransport.getMessageSectionSize | protected function getMessageSectionSize( $response )
{
$size = 0;
preg_match( '/\{(.*)\}/', $response, $matches );
if ( count( $matches ) > 0 )
{
$size = (int) $matches[1];
}
return $size;
} | php | protected function getMessageSectionSize( $response )
{
$size = 0;
preg_match( '/\{(.*)\}/', $response, $matches );
if ( count( $matches ) > 0 )
{
$size = (int) $matches[1];
}
return $size;
} | [
"protected",
"function",
"getMessageSectionSize",
"(",
"$",
"response",
")",
"{",
"$",
"size",
"=",
"0",
";",
"preg_match",
"(",
"'/\\{(.*)\\}/'",
",",
"$",
"response",
",",
"$",
"matches",
")",
";",
"if",
"(",
"count",
"(",
"$",
"matches",
")",
">",
"... | Returns the size of a FETCH section in bytes.
The section header looks like: * id FETCH (BODY[TEXT] {size}
where size is the size in bytes and id is the message number or ID.
Example: for " * 2 FETCH (BODY[TEXT] {377}" this function returns 377.
@return int | [
"Returns",
"the",
"size",
"of",
"a",
"FETCH",
"section",
"in",
"bytes",
"."
] | b0afc661105f0a2f65d49abac13956cc93c5188d | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/Mail/src/transports/imap/imap_transport.php#L2717-L2726 |
23,396 | caffeinated/beverage | src/Traits/EventDispatcher.php | EventDispatcher.registerEvent | protected function registerEvent($name, Closure $callback)
{
if (! isset(static::$dispatcher)) {
$this->initEventDispatcher();
}
static::$dispatcher->listen($name, $callback);
} | php | protected function registerEvent($name, Closure $callback)
{
if (! isset(static::$dispatcher)) {
$this->initEventDispatcher();
}
static::$dispatcher->listen($name, $callback);
} | [
"protected",
"function",
"registerEvent",
"(",
"$",
"name",
",",
"Closure",
"$",
"callback",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"static",
"::",
"$",
"dispatcher",
")",
")",
"{",
"$",
"this",
"->",
"initEventDispatcher",
"(",
")",
";",
"}",
"static... | Register an event for the dispatcher to listen for.
@param string $name
@param Closure $callback
@return void | [
"Register",
"an",
"event",
"for",
"the",
"dispatcher",
"to",
"listen",
"for",
"."
] | c7d612a1d3bc1baddc97fec60ab17224550efaf3 | https://github.com/caffeinated/beverage/blob/c7d612a1d3bc1baddc97fec60ab17224550efaf3/src/Traits/EventDispatcher.php#L55-L62 |
23,397 | caffeinated/beverage | src/Traits/EventDispatcher.php | EventDispatcher.fireEvent | protected function fireEvent($name, $payload = null)
{
if (! isset(static::$dispatcher)) {
$this->initEventDispatcher();
}
static::$dispatcher->fire($name, $payload);
} | php | protected function fireEvent($name, $payload = null)
{
if (! isset(static::$dispatcher)) {
$this->initEventDispatcher();
}
static::$dispatcher->fire($name, $payload);
} | [
"protected",
"function",
"fireEvent",
"(",
"$",
"name",
",",
"$",
"payload",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"static",
"::",
"$",
"dispatcher",
")",
")",
"{",
"$",
"this",
"->",
"initEventDispatcher",
"(",
")",
";",
"}",
"static"... | Fire off an event.
@param string $name
@param mixed $payload
@return mixed | [
"Fire",
"off",
"an",
"event",
"."
] | c7d612a1d3bc1baddc97fec60ab17224550efaf3 | https://github.com/caffeinated/beverage/blob/c7d612a1d3bc1baddc97fec60ab17224550efaf3/src/Traits/EventDispatcher.php#L71-L78 |
23,398 | CupOfTea696/WordPress-Composer | src/WordPressInstallationCleaner.php | WordPressInstallationCleaner.clean | public function clean(Composer $composer)
{
$rootPkg = $composer->getPackage();
$extra = $rootPkg->getExtra();
if (! isset($extra['wordpress-install-dir'])) {
return;
}
$filesystem = new Filesystem();
$filesystem->remove($extra['wordpress... | php | public function clean(Composer $composer)
{
$rootPkg = $composer->getPackage();
$extra = $rootPkg->getExtra();
if (! isset($extra['wordpress-install-dir'])) {
return;
}
$filesystem = new Filesystem();
$filesystem->remove($extra['wordpress... | [
"public",
"function",
"clean",
"(",
"Composer",
"$",
"composer",
")",
"{",
"$",
"rootPkg",
"=",
"$",
"composer",
"->",
"getPackage",
"(",
")",
";",
"$",
"extra",
"=",
"$",
"rootPkg",
"->",
"getExtra",
"(",
")",
";",
"if",
"(",
"!",
"isset",
"(",
"$... | Clean up the WordPress installation directory.
@param \Composer\Composer $composer
@return void | [
"Clean",
"up",
"the",
"WordPress",
"installation",
"directory",
"."
] | 8c0abc10f82b8ce1db5354f6a041c7587ad3fb90 | https://github.com/CupOfTea696/WordPress-Composer/blob/8c0abc10f82b8ce1db5354f6a041c7587ad3fb90/src/WordPressInstallationCleaner.php#L35-L46 |
23,399 | ekuiter/feature-php | FeaturePhp/File/TextFileContent.php | TextFileContent.copy | public function copy($target) {
if (!parent::copy($target))
return false;
return file_put_contents($target, $this->content) !== false;
} | php | public function copy($target) {
if (!parent::copy($target))
return false;
return file_put_contents($target, $this->content) !== false;
} | [
"public",
"function",
"copy",
"(",
"$",
"target",
")",
"{",
"if",
"(",
"!",
"parent",
"::",
"copy",
"(",
"$",
"target",
")",
")",
"return",
"false",
";",
"return",
"file_put_contents",
"(",
"$",
"target",
",",
"$",
"this",
"->",
"content",
")",
"!=="... | Copies the text file's content to the local filesystem.
@param string $target the file target in the filesystem | [
"Copies",
"the",
"text",
"file",
"s",
"content",
"to",
"the",
"local",
"filesystem",
"."
] | daf4a59098802fedcfd1f1a1d07847fcf2fea7bf | https://github.com/ekuiter/feature-php/blob/daf4a59098802fedcfd1f1a1d07847fcf2fea7bf/FeaturePhp/File/TextFileContent.php#L50-L54 |
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.