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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
204,200 | cymapgt/logger | src/Logger.php | Logger._getLoggerSecurity | private static function _getLoggerSecurity($loggerParams) {
if (!isset(self::$loggerSecurity)) {
/*create notifier object for africas talking. If you are behind a proxy, the
*second parameter should be true, and your configuration array should contain
... | php | private static function _getLoggerSecurity($loggerParams) {
if (!isset(self::$loggerSecurity)) {
/*create notifier object for africas talking. If you are behind a proxy, the
*second parameter should be true, and your configuration array should contain
... | [
"private",
"static",
"function",
"_getLoggerSecurity",
"(",
"$",
"loggerParams",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"self",
"::",
"$",
"loggerSecurity",
")",
")",
"{",
"/*create notifier object for africas talking. If you are behind a proxy, the\n ... | return the security logger
@param array $loggerParams - Array of parameters to configure the security logger
@return object
@private
@static | [
"return",
"the",
"security",
"logger"
] | 8d042b21a9e13a3597c99084229781ab6151d78f | https://github.com/cymapgt/logger/blob/8d042b21a9e13a3597c99084229781ab6151d78f/src/Logger.php#L273-L295 |
204,201 | IStranger/yii2-resource-smart-load | base/BaseObject.php | BaseObject.setProperties | public function setProperties($propValues)
{
foreach ($propValues as $propName => $propValue) {
if (property_exists($this, $propName)) {
$this->{$propName} = $propValue;
} else {
$this->throwException('Property "%propName%" does not exist in class "%cl... | php | public function setProperties($propValues)
{
foreach ($propValues as $propName => $propValue) {
if (property_exists($this, $propName)) {
$this->{$propName} = $propValue;
} else {
$this->throwException('Property "%propName%" does not exist in class "%cl... | [
"public",
"function",
"setProperties",
"(",
"$",
"propValues",
")",
"{",
"foreach",
"(",
"$",
"propValues",
"as",
"$",
"propName",
"=>",
"$",
"propValue",
")",
"{",
"if",
"(",
"property_exists",
"(",
"$",
"this",
",",
"$",
"propName",
")",
")",
"{",
"$... | Sets properties values
@param array $propValues Array of properties values in format: ['propName' => 'propValue'] | [
"Sets",
"properties",
"values"
] | a4f203745d9a02fd97853b49c55b287aea6d7e6d | https://github.com/IStranger/yii2-resource-smart-load/blob/a4f203745d9a02fd97853b49c55b287aea6d7e6d/base/BaseObject.php#L28-L40 |
204,202 | akumar2-velsof/guzzlehttp | src/Pool.php | Pool.batch | public static function batch(
ClientInterface $client,
$requests,
array $options = []
) {
$hash = new \SplObjectStorage();
foreach ($requests as $request) {
$hash->attach($request);
}
// In addition to the normally run events when requests complet... | php | public static function batch(
ClientInterface $client,
$requests,
array $options = []
) {
$hash = new \SplObjectStorage();
foreach ($requests as $request) {
$hash->attach($request);
}
// In addition to the normally run events when requests complet... | [
"public",
"static",
"function",
"batch",
"(",
"ClientInterface",
"$",
"client",
",",
"$",
"requests",
",",
"array",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"$",
"hash",
"=",
"new",
"\\",
"SplObjectStorage",
"(",
")",
";",
"foreach",
"(",
"$",
"request... | Sends multiple requests in parallel and returns an array of responses
and exceptions that uses the same ordering as the provided requests.
IMPORTANT: This method keeps every request and response in memory, and
as such, is NOT recommended when sending a large number or an
indeterminate number of requests concurrently.
... | [
"Sends",
"multiple",
"requests",
"in",
"parallel",
"and",
"returns",
"an",
"array",
"of",
"responses",
"and",
"exceptions",
"that",
"uses",
"the",
"same",
"ordering",
"as",
"the",
"provided",
"requests",
"."
] | 9588a489c52b27e2d4047f146ddacffc3e111b7e | https://github.com/akumar2-velsof/guzzlehttp/blob/9588a489c52b27e2d4047f146ddacffc3e111b7e/src/Pool.php#L109-L135 |
204,203 | akumar2-velsof/guzzlehttp | src/Pool.php | Pool.send | public static function send(
ClientInterface $client,
$requests,
array $options = []
) {
$pool = new self($client, $requests, $options);
$pool->wait();
} | php | public static function send(
ClientInterface $client,
$requests,
array $options = []
) {
$pool = new self($client, $requests, $options);
$pool->wait();
} | [
"public",
"static",
"function",
"send",
"(",
"ClientInterface",
"$",
"client",
",",
"$",
"requests",
",",
"array",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"$",
"pool",
"=",
"new",
"self",
"(",
"$",
"client",
",",
"$",
"requests",
",",
"$",
"options"... | Creates a Pool and immediately sends the requests.
@param ClientInterface $client Client used to send the requests
@param array|\Iterator $requests Requests to send in parallel
@param array $options Passes through the options available in
{@see GuzzleHttp1\Pool::__construct} | [
"Creates",
"a",
"Pool",
"and",
"immediately",
"sends",
"the",
"requests",
"."
] | 9588a489c52b27e2d4047f146ddacffc3e111b7e | https://github.com/akumar2-velsof/guzzlehttp/blob/9588a489c52b27e2d4047f146ddacffc3e111b7e/src/Pool.php#L145-L152 |
204,204 | akumar2-velsof/guzzlehttp | src/Pool.php | Pool.addNextRequests | private function addNextRequests()
{
$limit = max($this->getPoolSize() - count($this->waitQueue), 0);
while ($limit--) {
if (!$this->addNextRequest()) {
break;
}
}
} | php | private function addNextRequests()
{
$limit = max($this->getPoolSize() - count($this->waitQueue), 0);
while ($limit--) {
if (!$this->addNextRequest()) {
break;
}
}
} | [
"private",
"function",
"addNextRequests",
"(",
")",
"{",
"$",
"limit",
"=",
"max",
"(",
"$",
"this",
"->",
"getPoolSize",
"(",
")",
"-",
"count",
"(",
"$",
"this",
"->",
"waitQueue",
")",
",",
"0",
")",
";",
"while",
"(",
"$",
"limit",
"--",
")",
... | Add as many requests as possible up to the current pool limit. | [
"Add",
"as",
"many",
"requests",
"as",
"possible",
"up",
"to",
"the",
"current",
"pool",
"limit",
"."
] | 9588a489c52b27e2d4047f146ddacffc3e111b7e | https://github.com/akumar2-velsof/guzzlehttp/blob/9588a489c52b27e2d4047f146ddacffc3e111b7e/src/Pool.php#L164-L172 |
204,205 | akumar2-velsof/guzzlehttp | src/Pool.php | Pool.addNextRequest | private function addNextRequest()
{
add_next:
if ($this->isRealized || !$this->iter || !$this->iter->valid()) {
return false;
}
$request = $this->iter->current();
$this->iter->next();
if (!($request instanceof RequestInterface)) {
throw new ... | php | private function addNextRequest()
{
add_next:
if ($this->isRealized || !$this->iter || !$this->iter->valid()) {
return false;
}
$request = $this->iter->current();
$this->iter->next();
if (!($request instanceof RequestInterface)) {
throw new ... | [
"private",
"function",
"addNextRequest",
"(",
")",
"{",
"add_next",
":",
"if",
"(",
"$",
"this",
"->",
"isRealized",
"||",
"!",
"$",
"this",
"->",
"iter",
"||",
"!",
"$",
"this",
"->",
"iter",
"->",
"valid",
"(",
")",
")",
"{",
"return",
"false",
"... | Adds the next request to pool and tracks what requests need to be
dereferenced when completing the pool. | [
"Adds",
"the",
"next",
"request",
"to",
"pool",
"and",
"tracks",
"what",
"requests",
"need",
"to",
"be",
"dereferenced",
"when",
"completing",
"the",
"pool",
"."
] | 9588a489c52b27e2d4047f146ddacffc3e111b7e | https://github.com/akumar2-velsof/guzzlehttp/blob/9588a489c52b27e2d4047f146ddacffc3e111b7e/src/Pool.php#L267-L318 |
204,206 | ellipsephp/handlers-adr | src/ActionRequestHandler.php | ActionRequestHandler.handle | public function handle(ServerRequestInterface $request): ResponseInterface
{
$input = $this->input($request);
$payload = $this->domain->payload($input);
return $this->responder->response($request, $payload);
} | php | public function handle(ServerRequestInterface $request): ResponseInterface
{
$input = $this->input($request);
$payload = $this->domain->payload($input);
return $this->responder->response($request, $payload);
} | [
"public",
"function",
"handle",
"(",
"ServerRequestInterface",
"$",
"request",
")",
":",
"ResponseInterface",
"{",
"$",
"input",
"=",
"$",
"this",
"->",
"input",
"(",
"$",
"request",
")",
";",
"$",
"payload",
"=",
"$",
"this",
"->",
"domain",
"->",
"payl... | Return a response by following the action domain responder pattern.
@param \Psr\Http\Message\ServerRequestInterface $request
@return \Psr\Http\Message\ResponseInterface | [
"Return",
"a",
"response",
"by",
"following",
"the",
"action",
"domain",
"responder",
"pattern",
"."
] | 1c0879494a8b7718f7e157d0cd41b4c5ec19b5c5 | https://github.com/ellipsephp/handlers-adr/blob/1c0879494a8b7718f7e157d0cd41b4c5ec19b5c5/src/ActionRequestHandler.php#L57-L64 |
204,207 | ellipsephp/handlers-adr | src/ActionRequestHandler.php | ActionRequestHandler.input | private function input(ServerRequestInterface $request): array
{
if (! is_null($this->parser)) {
$input = ($this->parser)($request);
if (is_array($input)) {
return $input;
}
throw new InputTypeException($input);
}
return ... | php | private function input(ServerRequestInterface $request): array
{
if (! is_null($this->parser)) {
$input = ($this->parser)($request);
if (is_array($input)) {
return $input;
}
throw new InputTypeException($input);
}
return ... | [
"private",
"function",
"input",
"(",
"ServerRequestInterface",
"$",
"request",
")",
":",
"array",
"{",
"if",
"(",
"!",
"is_null",
"(",
"$",
"this",
"->",
"parser",
")",
")",
"{",
"$",
"input",
"=",
"(",
"$",
"this",
"->",
"parser",
")",
"(",
"$",
"... | Return an input array from the given request using the request parser.
@param \Psr\Http\Message\ServerRequestInterface $request
@return array
@throws \Ellipse\Handlers\Exceptions\InputTypeException | [
"Return",
"an",
"input",
"array",
"from",
"the",
"given",
"request",
"using",
"the",
"request",
"parser",
"."
] | 1c0879494a8b7718f7e157d0cd41b4c5ec19b5c5 | https://github.com/ellipsephp/handlers-adr/blob/1c0879494a8b7718f7e157d0cd41b4c5ec19b5c5/src/ActionRequestHandler.php#L73-L95 |
204,208 | RadialCorp/magento-core | src/app/code/community/Radial/Core/Helper/Languages.php | Radial_Core_Helper_Languages.getStores | public function getStores($langCode = null)
{
$stores = array();
foreach (Mage::app()->getWebsites() as $website) {
$stores = array_replace($stores, $this->getWebsiteStores($website, $langCode));
}
return $stores;
} | php | public function getStores($langCode = null)
{
$stores = array();
foreach (Mage::app()->getWebsites() as $website) {
$stores = array_replace($stores, $this->getWebsiteStores($website, $langCode));
}
return $stores;
} | [
"public",
"function",
"getStores",
"(",
"$",
"langCode",
"=",
"null",
")",
"{",
"$",
"stores",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"Mage",
"::",
"app",
"(",
")",
"->",
"getWebsites",
"(",
")",
"as",
"$",
"website",
")",
"{",
"$",
"stores",... | Return an array of stores and attach a language code to them, Varien_Object style
@param string $langCode (optional) if passed, only stores using that langCode are returned.
@return array of Mage_Core_Model_Store, keyed by StoreId. Each store has a new magic getter 'getLanguageCode()' | [
"Return",
"an",
"array",
"of",
"stores",
"and",
"attach",
"a",
"language",
"code",
"to",
"them",
"Varien_Object",
"style"
] | 9bb5f218d9caf79eab8598f4f8447037a0cc6355 | https://github.com/RadialCorp/magento-core/blob/9bb5f218d9caf79eab8598f4f8447037a0cc6355/src/app/code/community/Radial/Core/Helper/Languages.php#L61-L68 |
204,209 | RadialCorp/magento-core | src/app/code/community/Radial/Core/Helper/Languages.php | Radial_Core_Helper_Languages.getWebsiteStores | public function getWebsiteStores($website, $langCode = null)
{
$stores = array();
$config = Mage::helper('radial_core')->getConfigModel();
$website = Mage::app()->getWebsite($website);
foreach ($website->getGroups() as $group) {
foreach ($group->getStores() as $store) {
... | php | public function getWebsiteStores($website, $langCode = null)
{
$stores = array();
$config = Mage::helper('radial_core')->getConfigModel();
$website = Mage::app()->getWebsite($website);
foreach ($website->getGroups() as $group) {
foreach ($group->getStores() as $store) {
... | [
"public",
"function",
"getWebsiteStores",
"(",
"$",
"website",
",",
"$",
"langCode",
"=",
"null",
")",
"{",
"$",
"stores",
"=",
"array",
"(",
")",
";",
"$",
"config",
"=",
"Mage",
"::",
"helper",
"(",
"'radial_core'",
")",
"->",
"getConfigModel",
"(",
... | Return an array of stores for the given website and attach a language code to them, Varien_Object style
@param mixed $website the website to get stores from.
@param string $langCode (optional) if passed, only stores using that langCode are returned.
@return array of Mage_Core_Model_Store, keyed by StoreId. Each store... | [
"Return",
"an",
"array",
"of",
"stores",
"for",
"the",
"given",
"website",
"and",
"attach",
"a",
"language",
"code",
"to",
"them",
"Varien_Object",
"style"
] | 9bb5f218d9caf79eab8598f4f8447037a0cc6355 | https://github.com/RadialCorp/magento-core/blob/9bb5f218d9caf79eab8598f4f8447037a0cc6355/src/app/code/community/Radial/Core/Helper/Languages.php#L75-L91 |
204,210 | RadialCorp/magento-core | src/app/code/community/Radial/Core/Helper/Languages.php | Radial_Core_Helper_Languages.getLanguageCodesList | public function getLanguageCodesList()
{
$languages = array();
foreach ($this->getStores() as $store) {
$languages[] = $store->getLanguageCode();
}
return array_unique($languages);
} | php | public function getLanguageCodesList()
{
$languages = array();
foreach ($this->getStores() as $store) {
$languages[] = $store->getLanguageCode();
}
return array_unique($languages);
} | [
"public",
"function",
"getLanguageCodesList",
"(",
")",
"{",
"$",
"languages",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"getStores",
"(",
")",
"as",
"$",
"store",
")",
"{",
"$",
"languages",
"[",
"]",
"=",
"$",
"store",
"->",
... | Get a simple array of all language codes used in this installation
@return array | [
"Get",
"a",
"simple",
"array",
"of",
"all",
"language",
"codes",
"used",
"in",
"this",
"installation"
] | 9bb5f218d9caf79eab8598f4f8447037a0cc6355 | https://github.com/RadialCorp/magento-core/blob/9bb5f218d9caf79eab8598f4f8447037a0cc6355/src/app/code/community/Radial/Core/Helper/Languages.php#L96-L103 |
204,211 | rkeet/zf-doctrine-mvc | src/Controller/AbstractActionController.php | AbstractActionController.redirectToRoute | public function redirectToRoute()
{
if ($this->getRequest()
->isXmlHttpRequest()) {
return [
'redirect' => call_user_func_array(
[
$this->url(),
'fromRoute',
],
... | php | public function redirectToRoute()
{
if ($this->getRequest()
->isXmlHttpRequest()) {
return [
'redirect' => call_user_func_array(
[
$this->url(),
'fromRoute',
],
... | [
"public",
"function",
"redirectToRoute",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"getRequest",
"(",
")",
"->",
"isXmlHttpRequest",
"(",
")",
")",
"{",
"return",
"[",
"'redirect'",
"=>",
"call_user_func_array",
"(",
"[",
"$",
"this",
"->",
"url",
"("... | Redirect to a route, or pass the url to the view for a javascript redirect
@return mixed|\Zend\Http\Response | [
"Redirect",
"to",
"a",
"route",
"or",
"pass",
"the",
"url",
"to",
"the",
"view",
"for",
"a",
"javascript",
"redirect"
] | ec5fb19e453824383b39570d15bd77b85cec3ca1 | https://github.com/rkeet/zf-doctrine-mvc/blob/ec5fb19e453824383b39570d15bd77b85cec3ca1/src/Controller/AbstractActionController.php#L14-L36 |
204,212 | dark-prospect-games/obsidian-moon-engine | src/Modules/Input.php | Input.fetchFromArray | protected function fetchFromArray(
array $array,
string $index = '',
$xss_clean = false
) {
if (!array_key_exists($index, $array)) {
return false;
}
// Checks to see if the variable is set, since 0 returns as false.
if ($xss_clean === 'isset') {
... | php | protected function fetchFromArray(
array $array,
string $index = '',
$xss_clean = false
) {
if (!array_key_exists($index, $array)) {
return false;
}
// Checks to see if the variable is set, since 0 returns as false.
if ($xss_clean === 'isset') {
... | [
"protected",
"function",
"fetchFromArray",
"(",
"array",
"$",
"array",
",",
"string",
"$",
"index",
"=",
"''",
",",
"$",
"xss_clean",
"=",
"false",
")",
"{",
"if",
"(",
"!",
"array_key_exists",
"(",
"$",
"index",
",",
"$",
"array",
")",
")",
"{",
"re... | The function that will handle getting the data from the arrays.
@param mixed $array The array that will pulled from.
@param string $index What we are looking for.
@param boolean $xss_clean Whether to clean it or not or not. Incomplete.
@since 1.0.0
@return mixed | [
"The",
"function",
"that",
"will",
"handle",
"getting",
"the",
"data",
"from",
"the",
"arrays",
"."
] | 83b82990bdea79960a93b52f963cc81b6fa009ba | https://github.com/dark-prospect-games/obsidian-moon-engine/blob/83b82990bdea79960a93b52f963cc81b6fa009ba/src/Modules/Input.php#L60-L75 |
204,213 | acacha/forge-publish | src/Console/Commands/PublishKeyGenerate.php | PublishKeyGenerate.keyIsAlreadyInstalled | protected function keyIsAlreadyInstalled()
{
$key = 'APP_KEY=base64:';
$output = $this->execSSH("cd $this->domain;cat .env");
if (str_contains($output, $key)) {
return true;
}
return false;
} | php | protected function keyIsAlreadyInstalled()
{
$key = 'APP_KEY=base64:';
$output = $this->execSSH("cd $this->domain;cat .env");
if (str_contains($output, $key)) {
return true;
}
return false;
} | [
"protected",
"function",
"keyIsAlreadyInstalled",
"(",
")",
"{",
"$",
"key",
"=",
"'APP_KEY=base64:'",
";",
"$",
"output",
"=",
"$",
"this",
"->",
"execSSH",
"(",
"\"cd $this->domain;cat .env\"",
")",
";",
"if",
"(",
"str_contains",
"(",
"$",
"output",
",",
... | Key is already installed on production?
@return bool | [
"Key",
"is",
"already",
"installed",
"on",
"production?"
] | 010779e3d2297c763b82dc3fbde992edffb3a6c6 | https://github.com/acacha/forge-publish/blob/010779e3d2297c763b82dc3fbde992edffb3a6c6/src/Console/Commands/PublishKeyGenerate.php#L88-L96 |
204,214 | luoxiaojun1992/lb_framework | Lb.php | Lb.getRouteInfo | public function getRouteInfo()
{
if ($this->isSingle()) {
if (isset($this->containers['route_info']) && ($controller = $this->containers['route_info']->get('controller'))
&& ($action = $this->containers['route_info']->get('action'))
) {
return ['contr... | php | public function getRouteInfo()
{
if ($this->isSingle()) {
if (isset($this->containers['route_info']) && ($controller = $this->containers['route_info']->get('controller'))
&& ($action = $this->containers['route_info']->get('action'))
) {
return ['contr... | [
"public",
"function",
"getRouteInfo",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"isSingle",
"(",
")",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"containers",
"[",
"'route_info'",
"]",
")",
"&&",
"(",
"$",
"controller",
"=",
"$",
"thi... | Get Route Info
@return array | [
"Get",
"Route",
"Info"
] | 12a865729e7738d7d1e07371ad7203243c4571fa | https://github.com/luoxiaojun1992/lb_framework/blob/12a865729e7738d7d1e07371ad7203243c4571fa/Lb.php#L197-L207 |
204,215 | luoxiaojun1992/lb_framework | Lb.php | Lb.isHome | public function isHome()
{
if ($this->isSingle()) {
if (isset($this->containers['route_info'])) {
$home_controller = 'index';
$home_action = 'index';
$home = $this->getHome();
if ($home && isset($home['controller']) && isset($home['... | php | public function isHome()
{
if ($this->isSingle()) {
if (isset($this->containers['route_info'])) {
$home_controller = 'index';
$home_action = 'index';
$home = $this->getHome();
if ($home && isset($home['controller']) && isset($home['... | [
"public",
"function",
"isHome",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"isSingle",
"(",
")",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"containers",
"[",
"'route_info'",
"]",
")",
")",
"{",
"$",
"home_controller",
"=",
"'index'",
... | If is home | [
"If",
"is",
"home"
] | 12a865729e7738d7d1e07371ad7203243c4571fa | https://github.com/luoxiaojun1992/lb_framework/blob/12a865729e7738d7d1e07371ad7203243c4571fa/Lb.php#L210-L227 |
204,216 | luoxiaojun1992/lb_framework | Lb.php | Lb.getHomeUri | public function getHomeUri()
{
$homeUri = '';
if ($this->isSingle()) {
$controller = 'index';
$action = 'index';
$home = $this->getHome();
if (isset($home['controller']) && isset($home['action']) && $home['controller'] && $home['action']) {
... | php | public function getHomeUri()
{
$homeUri = '';
if ($this->isSingle()) {
$controller = 'index';
$action = 'index';
$home = $this->getHome();
if (isset($home['controller']) && isset($home['action']) && $home['controller'] && $home['action']) {
... | [
"public",
"function",
"getHomeUri",
"(",
")",
"{",
"$",
"homeUri",
"=",
"''",
";",
"if",
"(",
"$",
"this",
"->",
"isSingle",
"(",
")",
")",
"{",
"$",
"controller",
"=",
"'index'",
";",
"$",
"action",
"=",
"'index'",
";",
"$",
"home",
"=",
"$",
"t... | Get Home Uri | [
"Get",
"Home",
"Uri"
] | 12a865729e7738d7d1e07371ad7203243c4571fa | https://github.com/luoxiaojun1992/lb_framework/blob/12a865729e7738d7d1e07371ad7203243c4571fa/Lb.php#L230-L248 |
204,217 | luoxiaojun1992/lb_framework | Lb.php | Lb.getDb | public function getDb($db_type, $node_type)
{
if ($this->isSingle()) {
switch ($db_type) {
case Connection::DB_TYPE:
switch ($node_type) {
case 'master':
return Connection::component()->write_conn;
case 'slave':
... | php | public function getDb($db_type, $node_type)
{
if ($this->isSingle()) {
switch ($db_type) {
case Connection::DB_TYPE:
switch ($node_type) {
case 'master':
return Connection::component()->write_conn;
case 'slave':
... | [
"public",
"function",
"getDb",
"(",
"$",
"db_type",
",",
"$",
"node_type",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"isSingle",
"(",
")",
")",
"{",
"switch",
"(",
"$",
"db_type",
")",
"{",
"case",
"Connection",
"::",
"DB_TYPE",
":",
"switch",
"(",
"... | Get Db Connection | [
"Get",
"Db",
"Connection"
] | 12a865729e7738d7d1e07371ad7203243c4571fa | https://github.com/luoxiaojun1992/lb_framework/blob/12a865729e7738d7d1e07371ad7203243c4571fa/Lb.php#L282-L302 |
204,218 | luoxiaojun1992/lb_framework | Lb.php | Lb.createAbsoluteUrl | public function createAbsoluteUrl($uri, $query_params = [], $ssl = false, $port = 80, $request = null)
{
if ($this->isSingle()) {
return UrlManager::createAbsoluteUrl($uri, $query_params, $ssl, $port, $request);
}
return '';
} | php | public function createAbsoluteUrl($uri, $query_params = [], $ssl = false, $port = 80, $request = null)
{
if ($this->isSingle()) {
return UrlManager::createAbsoluteUrl($uri, $query_params, $ssl, $port, $request);
}
return '';
} | [
"public",
"function",
"createAbsoluteUrl",
"(",
"$",
"uri",
",",
"$",
"query_params",
"=",
"[",
"]",
",",
"$",
"ssl",
"=",
"false",
",",
"$",
"port",
"=",
"80",
",",
"$",
"request",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"isSingle",
... | Create Absolute Url | [
"Create",
"Absolute",
"Url"
] | 12a865729e7738d7d1e07371ad7203243c4571fa | https://github.com/luoxiaojun1992/lb_framework/blob/12a865729e7738d7d1e07371ad7203243c4571fa/Lb.php#L313-L319 |
204,219 | luoxiaojun1992/lb_framework | Lb.php | Lb.getParam | public function getParam($param_name, $default_value = null)
{
if ($this->isSingle()) {
return RequestKit::getParam($param_name, $default_value);
}
return false;
} | php | public function getParam($param_name, $default_value = null)
{
if ($this->isSingle()) {
return RequestKit::getParam($param_name, $default_value);
}
return false;
} | [
"public",
"function",
"getParam",
"(",
"$",
"param_name",
",",
"$",
"default_value",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"isSingle",
"(",
")",
")",
"{",
"return",
"RequestKit",
"::",
"getParam",
"(",
"$",
"param_name",
",",
"$",
"defau... | Get Http Request Param Value | [
"Get",
"Http",
"Request",
"Param",
"Value"
] | 12a865729e7738d7d1e07371ad7203243c4571fa | https://github.com/luoxiaojun1992/lb_framework/blob/12a865729e7738d7d1e07371ad7203243c4571fa/Lb.php#L331-L337 |
204,220 | luoxiaojun1992/lb_framework | Lb.php | Lb.import | public function import($path)
{
if ($this->isSingle()) {
if (file_exists($path) && strtolower(FileHelper::getExtensionName($path)) == 'php') {
include_once str_replace(Security::INSECURE_CODES, '', $path);
}
}
} | php | public function import($path)
{
if ($this->isSingle()) {
if (file_exists($path) && strtolower(FileHelper::getExtensionName($path)) == 'php') {
include_once str_replace(Security::INSECURE_CODES, '', $path);
}
}
} | [
"public",
"function",
"import",
"(",
"$",
"path",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"isSingle",
"(",
")",
")",
"{",
"if",
"(",
"file_exists",
"(",
"$",
"path",
")",
"&&",
"strtolower",
"(",
"FileHelper",
"::",
"getExtensionName",
"(",
"$",
"pat... | Import PHP File | [
"Import",
"PHP",
"File"
] | 12a865729e7738d7d1e07371ad7203243c4571fa | https://github.com/luoxiaojun1992/lb_framework/blob/12a865729e7738d7d1e07371ad7203243c4571fa/Lb.php#L367-L374 |
204,221 | luoxiaojun1992/lb_framework | Lb.php | Lb.swiftSend | public function swiftSend(
$from_name,
$receivers,
&$successfulRecipients,
&$failedRecipients,
$subject = '',
$body = '',
$content_type = 'text/html',
$charset = 'UTF-8'
) {
if ($this->isSingle()) {
Swift::component()->send(
... | php | public function swiftSend(
$from_name,
$receivers,
&$successfulRecipients,
&$failedRecipients,
$subject = '',
$body = '',
$content_type = 'text/html',
$charset = 'UTF-8'
) {
if ($this->isSingle()) {
Swift::component()->send(
... | [
"public",
"function",
"swiftSend",
"(",
"$",
"from_name",
",",
"$",
"receivers",
",",
"&",
"$",
"successfulRecipients",
",",
"&",
"$",
"failedRecipients",
",",
"$",
"subject",
"=",
"''",
",",
"$",
"body",
"=",
"''",
",",
"$",
"content_type",
"=",
"'text/... | Send Swift Mail | [
"Send",
"Swift",
"Mail"
] | 12a865729e7738d7d1e07371ad7203243c4571fa | https://github.com/luoxiaojun1992/lb_framework/blob/12a865729e7738d7d1e07371ad7203243c4571fa/Lb.php#L386-L409 |
204,222 | luoxiaojun1992/lb_framework | Lb.php | Lb.loginRequired | public function loginRequired($redirect_url, $request = null, $response = null)
{
if ($this->isSingle()) {
User::loginRequired($redirect_url, $request, $response);
}
} | php | public function loginRequired($redirect_url, $request = null, $response = null)
{
if ($this->isSingle()) {
User::loginRequired($redirect_url, $request, $response);
}
} | [
"public",
"function",
"loginRequired",
"(",
"$",
"redirect_url",
",",
"$",
"request",
"=",
"null",
",",
"$",
"response",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"isSingle",
"(",
")",
")",
"{",
"User",
"::",
"loginRequired",
"(",
"$",
"re... | Check If Logged In
@param $redirect_url
@param RequestContract $request
@param ResponseContract $response | [
"Check",
"If",
"Logged",
"In"
] | 12a865729e7738d7d1e07371ad7203243c4571fa | https://github.com/luoxiaojun1992/lb_framework/blob/12a865729e7738d7d1e07371ad7203243c4571fa/Lb.php#L418-L423 |
204,223 | luoxiaojun1992/lb_framework | Lb.php | Lb.isAction | public function isAction($request = null)
{
$is_action = false;
if ($this->isSingle()) {
$queryString = $request ? $request->getQueryString() : Lb::app()->getQueryString();
$requestUri = $request ? $request->getUri() : Lb::app()->getUri();
if (Lb::app()->isPrettyU... | php | public function isAction($request = null)
{
$is_action = false;
if ($this->isSingle()) {
$queryString = $request ? $request->getQueryString() : Lb::app()->getQueryString();
$requestUri = $request ? $request->getUri() : Lb::app()->getUri();
if (Lb::app()->isPrettyU... | [
"public",
"function",
"isAction",
"(",
"$",
"request",
"=",
"null",
")",
"{",
"$",
"is_action",
"=",
"false",
";",
"if",
"(",
"$",
"this",
"->",
"isSingle",
"(",
")",
")",
"{",
"$",
"queryString",
"=",
"$",
"request",
"?",
"$",
"request",
"->",
"ge... | Detect Action Exists
@param RequestContract $request
@return bool | [
"Detect",
"Action",
"Exists"
] | 12a865729e7738d7d1e07371ad7203243c4571fa | https://github.com/luoxiaojun1992/lb_framework/blob/12a865729e7738d7d1e07371ad7203243c4571fa/Lb.php#L478-L496 |
204,224 | luoxiaojun1992/lb_framework | Lb.php | Lb.get_rpc_client | public function get_rpc_client($url)
{
if ($this->isSingle()) {
include_once Lb::app()->getRootDir() . DIRECTORY_SEPARATOR . 'vendor' . DIRECTORY_SEPARATOR . 'hprose' .
DIRECTORY_SEPARATOR . 'hprose' . DIRECTORY_SEPARATOR . 'src' . DIRECTORY_SEPARATOR . 'Hprose.php';
retu... | php | public function get_rpc_client($url)
{
if ($this->isSingle()) {
include_once Lb::app()->getRootDir() . DIRECTORY_SEPARATOR . 'vendor' . DIRECTORY_SEPARATOR . 'hprose' .
DIRECTORY_SEPARATOR . 'hprose' . DIRECTORY_SEPARATOR . 'src' . DIRECTORY_SEPARATOR . 'Hprose.php';
retu... | [
"public",
"function",
"get_rpc_client",
"(",
"$",
"url",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"isSingle",
"(",
")",
")",
"{",
"include_once",
"Lb",
"::",
"app",
"(",
")",
"->",
"getRootDir",
"(",
")",
".",
"DIRECTORY_SEPARATOR",
".",
"'vendor'",
"."... | Get RPC Client | [
"Get",
"RPC",
"Client"
] | 12a865729e7738d7d1e07371ad7203243c4571fa | https://github.com/luoxiaojun1992/lb_framework/blob/12a865729e7738d7d1e07371ad7203243c4571fa/Lb.php#L551-L559 |
204,225 | luoxiaojun1992/lb_framework | Lb.php | Lb.on | public function on($event_name, $listener, $data = null)
{
if ($this->isSingle()) {
BaseObserver::on($event_name, $listener, $data);
}
} | php | public function on($event_name, $listener, $data = null)
{
if ($this->isSingle()) {
BaseObserver::on($event_name, $listener, $data);
}
} | [
"public",
"function",
"on",
"(",
"$",
"event_name",
",",
"$",
"listener",
",",
"$",
"data",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"isSingle",
"(",
")",
")",
"{",
"BaseObserver",
"::",
"on",
"(",
"$",
"event_name",
",",
"$",
"listener... | Register Event Listener | [
"Register",
"Event",
"Listener"
] | 12a865729e7738d7d1e07371ad7203243c4571fa | https://github.com/luoxiaojun1992/lb_framework/blob/12a865729e7738d7d1e07371ad7203243c4571fa/Lb.php#L571-L576 |
204,226 | luoxiaojun1992/lb_framework | Lb.php | Lb.dispatchJob | public function dispatchJob($job, $data = [], $handler = 'handler')
{
if ($this->isSingle()) {
if (!is_object($job)) {
$job = new $job;
}
return call_user_func_array([$job, $handler], ['data' => $data]);
}
return null;
} | php | public function dispatchJob($job, $data = [], $handler = 'handler')
{
if ($this->isSingle()) {
if (!is_object($job)) {
$job = new $job;
}
return call_user_func_array([$job, $handler], ['data' => $data]);
}
return null;
} | [
"public",
"function",
"dispatchJob",
"(",
"$",
"job",
",",
"$",
"data",
"=",
"[",
"]",
",",
"$",
"handler",
"=",
"'handler'",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"isSingle",
"(",
")",
")",
"{",
"if",
"(",
"!",
"is_object",
"(",
"$",
"job",
... | Dispatch a job
@param $job
@param array $data
@param string $handler
@return mixed | [
"Dispatch",
"a",
"job"
] | 12a865729e7738d7d1e07371ad7203243c4571fa | https://github.com/luoxiaojun1992/lb_framework/blob/12a865729e7738d7d1e07371ad7203243c4571fa/Lb.php#L609-L619 |
204,227 | luoxiaojun1992/lb_framework | Lb.php | Lb.loadEnv | protected function loadEnv()
{
if (defined('ENV_DIR') && file_exists(ENV_DIR)) {
if (defined('ENV_FILE') && file_exists(ENV_FILE)) {
$dotenv = new \Dotenv\Dotenv(ENV_DIR, ENV_FILE);
} else {
$dotenv = new \Dotenv\Dotenv(ENV_DIR);
}
... | php | protected function loadEnv()
{
if (defined('ENV_DIR') && file_exists(ENV_DIR)) {
if (defined('ENV_FILE') && file_exists(ENV_FILE)) {
$dotenv = new \Dotenv\Dotenv(ENV_DIR, ENV_FILE);
} else {
$dotenv = new \Dotenv\Dotenv(ENV_DIR);
}
... | [
"protected",
"function",
"loadEnv",
"(",
")",
"{",
"if",
"(",
"defined",
"(",
"'ENV_DIR'",
")",
"&&",
"file_exists",
"(",
"ENV_DIR",
")",
")",
"{",
"if",
"(",
"defined",
"(",
"'ENV_FILE'",
")",
"&&",
"file_exists",
"(",
"ENV_FILE",
")",
")",
"{",
"$",
... | Load Environment Variables | [
"Load",
"Environment",
"Variables"
] | 12a865729e7738d7d1e07371ad7203243c4571fa | https://github.com/luoxiaojun1992/lb_framework/blob/12a865729e7738d7d1e07371ad7203243c4571fa/Lb.php#L667-L677 |
204,228 | luoxiaojun1992/lb_framework | Lb.php | Lb.getPageCache | protected function getPageCache($cache_type)
{
$route_info = Lb::app()->getRouteInfo();
$page_cache_key = implode('_', ['page_cache', $route_info['controller'], $route_info['action']]);
return Lb::app()->getCache($page_cache_key, $cache_type);
} | php | protected function getPageCache($cache_type)
{
$route_info = Lb::app()->getRouteInfo();
$page_cache_key = implode('_', ['page_cache', $route_info['controller'], $route_info['action']]);
return Lb::app()->getCache($page_cache_key, $cache_type);
} | [
"protected",
"function",
"getPageCache",
"(",
"$",
"cache_type",
")",
"{",
"$",
"route_info",
"=",
"Lb",
"::",
"app",
"(",
")",
"->",
"getRouteInfo",
"(",
")",
";",
"$",
"page_cache_key",
"=",
"implode",
"(",
"'_'",
",",
"[",
"'page_cache'",
",",
"$",
... | Get Page Cache
@param $cache_type
@return string | [
"Get",
"Page",
"Cache"
] | 12a865729e7738d7d1e07371ad7203243c4571fa | https://github.com/luoxiaojun1992/lb_framework/blob/12a865729e7738d7d1e07371ad7203243c4571fa/Lb.php#L928-L933 |
204,229 | luoxiaojun1992/lb_framework | Lb.php | Lb.setPageCache | protected function setPageCache($cache_type, $page_cache, $expire = 60)
{
$route_info = Lb::app()->getRouteInfo();
$page_cache_key = implode('_', ['page_cache', $route_info['controller'], $route_info['action']]);
Lb::app()->setCache($page_cache_key, $page_cache, $cache_type, $expire);
} | php | protected function setPageCache($cache_type, $page_cache, $expire = 60)
{
$route_info = Lb::app()->getRouteInfo();
$page_cache_key = implode('_', ['page_cache', $route_info['controller'], $route_info['action']]);
Lb::app()->setCache($page_cache_key, $page_cache, $cache_type, $expire);
} | [
"protected",
"function",
"setPageCache",
"(",
"$",
"cache_type",
",",
"$",
"page_cache",
",",
"$",
"expire",
"=",
"60",
")",
"{",
"$",
"route_info",
"=",
"Lb",
"::",
"app",
"(",
")",
"->",
"getRouteInfo",
"(",
")",
";",
"$",
"page_cache_key",
"=",
"imp... | Set Page Cache
@param $cache_type
@param $page_cache
@param int $expire | [
"Set",
"Page",
"Cache"
] | 12a865729e7738d7d1e07371ad7203243c4571fa | https://github.com/luoxiaojun1992/lb_framework/blob/12a865729e7738d7d1e07371ad7203243c4571fa/Lb.php#L942-L947 |
204,230 | luoxiaojun1992/lb_framework | Lb.php | Lb.setHttpCache | protected function setHttpCache($response = null)
{
$http_cache_config = Lb::app()->getHttpCacheConfig();
if (isset($http_cache_config['cache_control']) && isset($http_cache_config['offset'])) {
HttpHelper::setCache($http_cache_config['cache_control'], $http_cache_config['offset'], $resp... | php | protected function setHttpCache($response = null)
{
$http_cache_config = Lb::app()->getHttpCacheConfig();
if (isset($http_cache_config['cache_control']) && isset($http_cache_config['offset'])) {
HttpHelper::setCache($http_cache_config['cache_control'], $http_cache_config['offset'], $resp... | [
"protected",
"function",
"setHttpCache",
"(",
"$",
"response",
"=",
"null",
")",
"{",
"$",
"http_cache_config",
"=",
"Lb",
"::",
"app",
"(",
")",
"->",
"getHttpCacheConfig",
"(",
")",
";",
"if",
"(",
"isset",
"(",
"$",
"http_cache_config",
"[",
"'cache_con... | Set Http Cache
@param $response ResponseContract | [
"Set",
"Http",
"Cache"
] | 12a865729e7738d7d1e07371ad7203243c4571fa | https://github.com/luoxiaojun1992/lb_framework/blob/12a865729e7738d7d1e07371ad7203243c4571fa/Lb.php#L954-L960 |
204,231 | infusephp/auth | src/Libs/Storage/SymfonySessionStorage.php | SymfonySessionStorage.createSession | private function createSession($sid, $userId, Request $req)
{
$sessionCookie = session_get_cookie_params();
$expires = time() + $sessionCookie['lifetime'];
$session = new ActiveSession();
$session->id = $sid;
$session->user_id = $userId;
$session->ip = $req->ip();
... | php | private function createSession($sid, $userId, Request $req)
{
$sessionCookie = session_get_cookie_params();
$expires = time() + $sessionCookie['lifetime'];
$session = new ActiveSession();
$session->id = $sid;
$session->user_id = $userId;
$session->ip = $req->ip();
... | [
"private",
"function",
"createSession",
"(",
"$",
"sid",
",",
"$",
"userId",
",",
"Request",
"$",
"req",
")",
"{",
"$",
"sessionCookie",
"=",
"session_get_cookie_params",
"(",
")",
";",
"$",
"expires",
"=",
"time",
"(",
")",
"+",
"$",
"sessionCookie",
"[... | Creates an active session for a user.
@param string $sid session ID
@param int $userId
@param Request $req
@return ActiveSession | [
"Creates",
"an",
"active",
"session",
"for",
"a",
"user",
"."
] | 720280b4b2635572f331afe8d082e3e88cf54eb7 | https://github.com/infusephp/auth/blob/720280b4b2635572f331afe8d082e3e88cf54eb7/src/Libs/Storage/SymfonySessionStorage.php#L218-L232 |
204,232 | infusephp/auth | src/Libs/Storage/SymfonySessionStorage.php | SymfonySessionStorage.refreshSession | private function refreshSession($sid)
{
$sessionCookie = session_get_cookie_params();
$expires = time() + $sessionCookie['lifetime'];
$this->getDatabase()
->update('ActiveSessions')
->where('id', $sid)
->values([
'expires' => $expires,
... | php | private function refreshSession($sid)
{
$sessionCookie = session_get_cookie_params();
$expires = time() + $sessionCookie['lifetime'];
$this->getDatabase()
->update('ActiveSessions')
->where('id', $sid)
->values([
'expires' => $expires,
... | [
"private",
"function",
"refreshSession",
"(",
"$",
"sid",
")",
"{",
"$",
"sessionCookie",
"=",
"session_get_cookie_params",
"(",
")",
";",
"$",
"expires",
"=",
"time",
"(",
")",
"+",
"$",
"sessionCookie",
"[",
"'lifetime'",
"]",
";",
"$",
"this",
"->",
"... | Refreshes the expiration on an active session.
@param string $sid session ID
@return bool | [
"Refreshes",
"the",
"expiration",
"on",
"an",
"active",
"session",
"."
] | 720280b4b2635572f331afe8d082e3e88cf54eb7 | https://github.com/infusephp/auth/blob/720280b4b2635572f331afe8d082e3e88cf54eb7/src/Libs/Storage/SymfonySessionStorage.php#L255-L270 |
204,233 | infusephp/auth | src/Libs/Storage/SymfonySessionStorage.php | SymfonySessionStorage.getUserRememberMe | private function getUserRememberMe(Request $req, Response $res)
{
// retrieve and verify the remember me cookie
$cookie = $this->getRememberMeCookie($req);
if (!$cookie) {
return false;
}
$user = $cookie->verify($req, $this->auth);
if (!$user) {
... | php | private function getUserRememberMe(Request $req, Response $res)
{
// retrieve and verify the remember me cookie
$cookie = $this->getRememberMeCookie($req);
if (!$cookie) {
return false;
}
$user = $cookie->verify($req, $this->auth);
if (!$user) {
... | [
"private",
"function",
"getUserRememberMe",
"(",
"Request",
"$",
"req",
",",
"Response",
"$",
"res",
")",
"{",
"// retrieve and verify the remember me cookie",
"$",
"cookie",
"=",
"$",
"this",
"->",
"getRememberMeCookie",
"(",
"$",
"req",
")",
";",
"if",
"(",
... | Tries to get an authenticated user via remember me.
@param Request $req
@param Response $res
@return UserInterface|false | [
"Tries",
"to",
"get",
"an",
"authenticated",
"user",
"via",
"remember",
"me",
"."
] | 720280b4b2635572f331afe8d082e3e88cf54eb7 | https://github.com/infusephp/auth/blob/720280b4b2635572f331afe8d082e3e88cf54eb7/src/Libs/Storage/SymfonySessionStorage.php#L313-L342 |
204,234 | infusephp/auth | src/Libs/Storage/SymfonySessionStorage.php | SymfonySessionStorage.getRememberMeCookie | private function getRememberMeCookie(Request $req)
{
$encoded = $req->cookies($this->rememberMeCookieName());
if (!$encoded) {
return false;
}
return RememberMeCookie::decode($encoded);
} | php | private function getRememberMeCookie(Request $req)
{
$encoded = $req->cookies($this->rememberMeCookieName());
if (!$encoded) {
return false;
}
return RememberMeCookie::decode($encoded);
} | [
"private",
"function",
"getRememberMeCookie",
"(",
"Request",
"$",
"req",
")",
"{",
"$",
"encoded",
"=",
"$",
"req",
"->",
"cookies",
"(",
"$",
"this",
"->",
"rememberMeCookieName",
"(",
")",
")",
";",
"if",
"(",
"!",
"$",
"encoded",
")",
"{",
"return"... | Gets the decoded remember me cookie from the request.
@param Request $req
@return RememberMeCookie|false | [
"Gets",
"the",
"decoded",
"remember",
"me",
"cookie",
"from",
"the",
"request",
"."
] | 720280b4b2635572f331afe8d082e3e88cf54eb7 | https://github.com/infusephp/auth/blob/720280b4b2635572f331afe8d082e3e88cf54eb7/src/Libs/Storage/SymfonySessionStorage.php#L351-L359 |
204,235 | infusephp/auth | src/Libs/Storage/SymfonySessionStorage.php | SymfonySessionStorage.sendRememberMeCookie | private function sendRememberMeCookie(UserInterface $user, RememberMeCookie $cookie, Response $res)
{
// send the cookie with the same properties as the session cookie
$sessionCookie = session_get_cookie_params();
$res->setCookie($this->rememberMeCookieName(),
$cookie->encode(),
... | php | private function sendRememberMeCookie(UserInterface $user, RememberMeCookie $cookie, Response $res)
{
// send the cookie with the same properties as the session cookie
$sessionCookie = session_get_cookie_params();
$res->setCookie($this->rememberMeCookieName(),
$cookie->encode(),
... | [
"private",
"function",
"sendRememberMeCookie",
"(",
"UserInterface",
"$",
"user",
",",
"RememberMeCookie",
"$",
"cookie",
",",
"Response",
"$",
"res",
")",
"{",
"// send the cookie with the same properties as the session cookie",
"$",
"sessionCookie",
"=",
"session_get_cook... | Stores a remember me session cookie on the response.
@param UserInterface $user
@param RememberMeCookie $cookie
@param Response $res | [
"Stores",
"a",
"remember",
"me",
"session",
"cookie",
"on",
"the",
"response",
"."
] | 720280b4b2635572f331afe8d082e3e88cf54eb7 | https://github.com/infusephp/auth/blob/720280b4b2635572f331afe8d082e3e88cf54eb7/src/Libs/Storage/SymfonySessionStorage.php#L368-L382 |
204,236 | infusephp/auth | src/Libs/Storage/SymfonySessionStorage.php | SymfonySessionStorage.destroyRememberMeCookie | private function destroyRememberMeCookie(Request $req, Response $res)
{
$cookie = $this->getRememberMeCookie($req);
if ($cookie) {
$cookie->destroy();
}
$sessionCookie = session_get_cookie_params();
$res->setCookie($this->rememberMeCookieName(),
'',
... | php | private function destroyRememberMeCookie(Request $req, Response $res)
{
$cookie = $this->getRememberMeCookie($req);
if ($cookie) {
$cookie->destroy();
}
$sessionCookie = session_get_cookie_params();
$res->setCookie($this->rememberMeCookieName(),
'',
... | [
"private",
"function",
"destroyRememberMeCookie",
"(",
"Request",
"$",
"req",
",",
"Response",
"$",
"res",
")",
"{",
"$",
"cookie",
"=",
"$",
"this",
"->",
"getRememberMeCookie",
"(",
"$",
"req",
")",
";",
"if",
"(",
"$",
"cookie",
")",
"{",
"$",
"cook... | Destroys the remember me cookie.
@param Request $req
@param Response $res
@return self | [
"Destroys",
"the",
"remember",
"me",
"cookie",
"."
] | 720280b4b2635572f331afe8d082e3e88cf54eb7 | https://github.com/infusephp/auth/blob/720280b4b2635572f331afe8d082e3e88cf54eb7/src/Libs/Storage/SymfonySessionStorage.php#L392-L409 |
204,237 | luoxiaojun1992/lb_framework | components/traits/lb/Cookie.php | Cookie.setCookie | public function setCookie($cookie_key, $cookie_value, $expire = null, $path = null, $domain = null, $secure = null, $httpOnly = null)
{
if ($this->isSingle()) {
ResponseKit::setCookie($cookie_key, $cookie_value, $expire, $path, $domain, $secure, $httpOnly);
}
} | php | public function setCookie($cookie_key, $cookie_value, $expire = null, $path = null, $domain = null, $secure = null, $httpOnly = null)
{
if ($this->isSingle()) {
ResponseKit::setCookie($cookie_key, $cookie_value, $expire, $path, $domain, $secure, $httpOnly);
}
} | [
"public",
"function",
"setCookie",
"(",
"$",
"cookie_key",
",",
"$",
"cookie_value",
",",
"$",
"expire",
"=",
"null",
",",
"$",
"path",
"=",
"null",
",",
"$",
"domain",
"=",
"null",
",",
"$",
"secure",
"=",
"null",
",",
"$",
"httpOnly",
"=",
"null",
... | Set Cookie Value
@param $cookie_key
@param $cookie_value
@param null $expire
@param null $path
@param null $domain
@param null $secure
@param null $httpOnly | [
"Set",
"Cookie",
"Value"
] | 12a865729e7738d7d1e07371ad7203243c4571fa | https://github.com/luoxiaojun1992/lb_framework/blob/12a865729e7738d7d1e07371ad7203243c4571fa/components/traits/lb/Cookie.php#L35-L40 |
204,238 | luoxiaojun1992/lb_framework | components/traits/lb/Cookie.php | Cookie.delCookies | public function delCookies($cookie_keys)
{
if ($this->isSingle()) {
foreach ($cookie_keys as $cookie_key) {
$this->delCookie($cookie_key);
}
}
} | php | public function delCookies($cookie_keys)
{
if ($this->isSingle()) {
foreach ($cookie_keys as $cookie_key) {
$this->delCookie($cookie_key);
}
}
} | [
"public",
"function",
"delCookies",
"(",
"$",
"cookie_keys",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"isSingle",
"(",
")",
")",
"{",
"foreach",
"(",
"$",
"cookie_keys",
"as",
"$",
"cookie_key",
")",
"{",
"$",
"this",
"->",
"delCookie",
"(",
"$",
"coo... | Delete Multi Cookies
@param $cookie_keys | [
"Delete",
"Multi",
"Cookies"
] | 12a865729e7738d7d1e07371ad7203243c4571fa | https://github.com/luoxiaojun1992/lb_framework/blob/12a865729e7738d7d1e07371ad7203243c4571fa/components/traits/lb/Cookie.php#L61-L68 |
204,239 | tidal/phpspec-console | spec/Command/InlineConfiguratorSpec.php | InlineConfiguratorSpec.createCommandProphecy | private function createCommandProphecy()
{
$prophet = new Prophet;
$prophecy = $prophet->prophesize()->willImplement(InlineConfigCommandInterface::class);
$prophecy
->setName('foo')
->shouldBeCalled();
$prophecy
->getConfig()
->willRetu... | php | private function createCommandProphecy()
{
$prophet = new Prophet;
$prophecy = $prophet->prophesize()->willImplement(InlineConfigCommandInterface::class);
$prophecy
->setName('foo')
->shouldBeCalled();
$prophecy
->getConfig()
->willRetu... | [
"private",
"function",
"createCommandProphecy",
"(",
")",
"{",
"$",
"prophet",
"=",
"new",
"Prophet",
";",
"$",
"prophecy",
"=",
"$",
"prophet",
"->",
"prophesize",
"(",
")",
"->",
"willImplement",
"(",
"InlineConfigCommandInterface",
"::",
"class",
")",
";",
... | override prophecy creation
@return ObjectProphecy | [
"override",
"prophecy",
"creation"
] | 5946f1dfdc30c4af5605a889a407b6113ee16d59 | https://github.com/tidal/phpspec-console/blob/5946f1dfdc30c4af5605a889a407b6113ee16d59/spec/Command/InlineConfiguratorSpec.php#L35-L47 |
204,240 | Synapse-Cmf/synapse-cmf | src/Synapse/Cmf/Bundle/Distribution/Theme/Bundle/Configuration.php | Configuration.validateComponentKeys | private function validateComponentKeys(array $v)
{
$diff = array_diff_key($v, array_flip($this->enabledComponentTypes));
if (!empty($diff)) {
throw new InvalidConfigurationException(sprintf(
'Only "%s" component types are supported for configuration, "%s" more given.',
... | php | private function validateComponentKeys(array $v)
{
$diff = array_diff_key($v, array_flip($this->enabledComponentTypes));
if (!empty($diff)) {
throw new InvalidConfigurationException(sprintf(
'Only "%s" component types are supported for configuration, "%s" more given.',
... | [
"private",
"function",
"validateComponentKeys",
"(",
"array",
"$",
"v",
")",
"{",
"$",
"diff",
"=",
"array_diff_key",
"(",
"$",
"v",
",",
"array_flip",
"(",
"$",
"this",
"->",
"enabledComponentTypes",
")",
")",
";",
"if",
"(",
"!",
"empty",
"(",
"$",
"... | Validate given array keys are all registered components.
@param array $v
@return array | [
"Validate",
"given",
"array",
"keys",
"are",
"all",
"registered",
"components",
"."
] | d8122a4150a83d5607289724425cf35c56a5e880 | https://github.com/Synapse-Cmf/synapse-cmf/blob/d8122a4150a83d5607289724425cf35c56a5e880/src/Synapse/Cmf/Bundle/Distribution/Theme/Bundle/Configuration.php#L44-L56 |
204,241 | Synapse-Cmf/synapse-cmf | src/Synapse/Cmf/Bundle/Distribution/Theme/Bundle/Configuration.php | Configuration.hydrateTemplatesNode | private function hydrateTemplatesNode(NodeBuilder $node)
{
$node
->booleanNode('default')
->defaultFalse()
->end()
->scalarNode('path')
->cannotBeEmpty()
->end()
->arrayNode('contents')
->prototype('s... | php | private function hydrateTemplatesNode(NodeBuilder $node)
{
$node
->booleanNode('default')
->defaultFalse()
->end()
->scalarNode('path')
->cannotBeEmpty()
->end()
->arrayNode('contents')
->prototype('s... | [
"private",
"function",
"hydrateTemplatesNode",
"(",
"NodeBuilder",
"$",
"node",
")",
"{",
"$",
"node",
"->",
"booleanNode",
"(",
"'default'",
")",
"->",
"defaultFalse",
"(",
")",
"->",
"end",
"(",
")",
"->",
"scalarNode",
"(",
"'path'",
")",
"->",
"cannotB... | Hydrate given node with templates configuration nodes.
@param NodeBuilder $node
@return NodeBuilder | [
"Hydrate",
"given",
"node",
"with",
"templates",
"configuration",
"nodes",
"."
] | d8122a4150a83d5607289724425cf35c56a5e880 | https://github.com/Synapse-Cmf/synapse-cmf/blob/d8122a4150a83d5607289724425cf35c56a5e880/src/Synapse/Cmf/Bundle/Distribution/Theme/Bundle/Configuration.php#L188-L205 |
204,242 | Synapse-Cmf/synapse-cmf | src/Synapse/Cmf/Bundle/Distribution/Theme/Bundle/Configuration.php | Configuration.hydrateZonesNode | private function hydrateZonesNode(NodeBuilder $node)
{
$node
->booleanNode('main')
->defaultFalse()
->end()
->booleanNode('virtual')
->defaultFalse()
->end()
->arrayNode('aggregation')
->addDefaultsIf... | php | private function hydrateZonesNode(NodeBuilder $node)
{
$node
->booleanNode('main')
->defaultFalse()
->end()
->booleanNode('virtual')
->defaultFalse()
->end()
->arrayNode('aggregation')
->addDefaultsIf... | [
"private",
"function",
"hydrateZonesNode",
"(",
"NodeBuilder",
"$",
"node",
")",
"{",
"$",
"node",
"->",
"booleanNode",
"(",
"'main'",
")",
"->",
"defaultFalse",
"(",
")",
"->",
"end",
"(",
")",
"->",
"booleanNode",
"(",
"'virtual'",
")",
"->",
"defaultFal... | Hydrate given node with zones configuration nodes.
@param NodeBuilder $node
@return NodeBuilder | [
"Hydrate",
"given",
"node",
"with",
"zones",
"configuration",
"nodes",
"."
] | d8122a4150a83d5607289724425cf35c56a5e880 | https://github.com/Synapse-Cmf/synapse-cmf/blob/d8122a4150a83d5607289724425cf35c56a5e880/src/Synapse/Cmf/Bundle/Distribution/Theme/Bundle/Configuration.php#L214-L248 |
204,243 | Synapse-Cmf/synapse-cmf | src/Synapse/Cmf/Bundle/Distribution/Theme/Bundle/Configuration.php | Configuration.hydrateComponentsNode | private function hydrateComponentsNode(NodeBuilder $node)
{
$node
->scalarNode('path')->end()
->scalarNode('controller')->end()
->arrayNode('config')
->useAttributeAsKey('name')
->prototype('array')
->useAttributeAsKey('... | php | private function hydrateComponentsNode(NodeBuilder $node)
{
$node
->scalarNode('path')->end()
->scalarNode('controller')->end()
->arrayNode('config')
->useAttributeAsKey('name')
->prototype('array')
->useAttributeAsKey('... | [
"private",
"function",
"hydrateComponentsNode",
"(",
"NodeBuilder",
"$",
"node",
")",
"{",
"$",
"node",
"->",
"scalarNode",
"(",
"'path'",
")",
"->",
"end",
"(",
")",
"->",
"scalarNode",
"(",
"'controller'",
")",
"->",
"end",
"(",
")",
"->",
"arrayNode",
... | Hydrate given node with components configuration nodes.
@param NodeBuilder $node
@return NodeBuilder | [
"Hydrate",
"given",
"node",
"with",
"components",
"configuration",
"nodes",
"."
] | d8122a4150a83d5607289724425cf35c56a5e880 | https://github.com/Synapse-Cmf/synapse-cmf/blob/d8122a4150a83d5607289724425cf35c56a5e880/src/Synapse/Cmf/Bundle/Distribution/Theme/Bundle/Configuration.php#L257-L281 |
204,244 | temp/media-converter | src/Binary/MP4Box.php | MP4Box.process | public function process($inputFile, $outputFile = null)
{
if (!file_exists($inputFile) || !is_readable($inputFile)) {
throw new InvalidFileArgumentException(sprintf('File %s does not exist or is not readable', $inputFile));
}
$arguments = array(
'-quiet',
... | php | public function process($inputFile, $outputFile = null)
{
if (!file_exists($inputFile) || !is_readable($inputFile)) {
throw new InvalidFileArgumentException(sprintf('File %s does not exist or is not readable', $inputFile));
}
$arguments = array(
'-quiet',
... | [
"public",
"function",
"process",
"(",
"$",
"inputFile",
",",
"$",
"outputFile",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"file_exists",
"(",
"$",
"inputFile",
")",
"||",
"!",
"is_readable",
"(",
"$",
"inputFile",
")",
")",
"{",
"throw",
"new",
"InvalidFi... | Processes a file
@param string $inputFile The file to process.
@param null|string $outputFile The output file to write. If not provided, processes the file in place.
@return MP4Box
@throws InvalidFileArgumentException In case the input file is not readable
@throws RuntimeException In case the proce... | [
"Processes",
"a",
"file"
] | a6e8768c583aa461be568f13e592ae49294e5e33 | https://github.com/temp/media-converter/blob/a6e8768c583aa461be568f13e592ae49294e5e33/src/Binary/MP4Box.php#L43-L72 |
204,245 | temp/media-converter | src/Binary/MP4Box.php | MP4Box.create | public static function create($conf = array(), LoggerInterface $logger = null)
{
if (!$conf instanceof ConfigurationInterface) {
$conf = new Configuration($conf);
}
$binaries = $conf->get('mp4box.binaries', array('MP4Box'));
return static::load($binaries, $logger, $conf... | php | public static function create($conf = array(), LoggerInterface $logger = null)
{
if (!$conf instanceof ConfigurationInterface) {
$conf = new Configuration($conf);
}
$binaries = $conf->get('mp4box.binaries', array('MP4Box'));
return static::load($binaries, $logger, $conf... | [
"public",
"static",
"function",
"create",
"(",
"$",
"conf",
"=",
"array",
"(",
")",
",",
"LoggerInterface",
"$",
"logger",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"$",
"conf",
"instanceof",
"ConfigurationInterface",
")",
"{",
"$",
"conf",
"=",
"new",
"C... | Creates an MP4Box binary adapter.
@param null|LoggerInterface $logger
@param array|ConfigurationInterface $conf
@return MP4Box | [
"Creates",
"an",
"MP4Box",
"binary",
"adapter",
"."
] | a6e8768c583aa461be568f13e592ae49294e5e33 | https://github.com/temp/media-converter/blob/a6e8768c583aa461be568f13e592ae49294e5e33/src/Binary/MP4Box.php#L82-L91 |
204,246 | YiMAproject/yimaWidgetator | src/yimaWidgetator/Service/WidgetManager.php | WidgetManager.injectWidgetDependencies | public function injectWidgetDependencies(WidgetInterface $widget, ServiceLocatorInterface $serviceLocator)
{
/** @var $serviceLocator \yimaWidgetator\Service\WidgetManager */
$sm = $serviceLocator->getServiceLocator();
if (!$sm)
throw new \Exception('Service Manager can`t found.'... | php | public function injectWidgetDependencies(WidgetInterface $widget, ServiceLocatorInterface $serviceLocator)
{
/** @var $serviceLocator \yimaWidgetator\Service\WidgetManager */
$sm = $serviceLocator->getServiceLocator();
if (!$sm)
throw new \Exception('Service Manager can`t found.'... | [
"public",
"function",
"injectWidgetDependencies",
"(",
"WidgetInterface",
"$",
"widget",
",",
"ServiceLocatorInterface",
"$",
"serviceLocator",
")",
"{",
"/** @var $serviceLocator \\yimaWidgetator\\Service\\WidgetManager */",
"$",
"sm",
"=",
"$",
"serviceLocator",
"->",
"getS... | Inject required dependencies into the widget.
@param WidgetInterface $widget
@param ServiceLocatorInterface $serviceLocator
@throws \Exception
@return void | [
"Inject",
"required",
"dependencies",
"into",
"the",
"widget",
"."
] | 332bc9318e6ceaec918147b30317da2f5b3d2636 | https://github.com/YiMAproject/yimaWidgetator/blob/332bc9318e6ceaec918147b30317da2f5b3d2636/src/yimaWidgetator/Service/WidgetManager.php#L98-L125 |
204,247 | bluetree-service/data | src/Data/Xml.php | Xml.loadXmlFile | public function loadXmlFile($path, $parse = false)
{
$this->preserveWhiteSpace = false;
$bool = file_exists($path);
if (!$bool) {
$this->error = 'file_not_exists';
return false;
}
$bool = @$this->load($path);
if (!$bool) {
$this->... | php | public function loadXmlFile($path, $parse = false)
{
$this->preserveWhiteSpace = false;
$bool = file_exists($path);
if (!$bool) {
$this->error = 'file_not_exists';
return false;
}
$bool = @$this->load($path);
if (!$bool) {
$this->... | [
"public",
"function",
"loadXmlFile",
"(",
"$",
"path",
",",
"$",
"parse",
"=",
"false",
")",
"{",
"$",
"this",
"->",
"preserveWhiteSpace",
"=",
"false",
";",
"$",
"bool",
"=",
"file_exists",
"(",
"$",
"path",
")",
";",
"if",
"(",
"!",
"$",
"bool",
... | load xml file, optionally check file DTD
@param string $path xml file path
@param boolean $parse if true will check file DTD
@return boolean
@example loadXmlFile('cfg/config.xml', true) | [
"load",
"xml",
"file",
"optionally",
"check",
"file",
"DTD"
] | a8df78ee4f7b97b862f989d3effc75f022fd75cb | https://github.com/bluetree-service/data/blob/a8df78ee4f7b97b862f989d3effc75f022fd75cb/src/Data/Xml.php#L78-L100 |
204,248 | bluetree-service/data | src/Data/Xml.php | Xml.saveXmlFile | public function saveXmlFile($path = '')
{
$this->formatOutput = true;
if ($path) {
$bool = @$this->save($path);
if (!$bool) {
$this->error = 'save_file_error';
return false;
}
return true;
}
return $th... | php | public function saveXmlFile($path = '')
{
$this->formatOutput = true;
if ($path) {
$bool = @$this->save($path);
if (!$bool) {
$this->error = 'save_file_error';
return false;
}
return true;
}
return $th... | [
"public",
"function",
"saveXmlFile",
"(",
"$",
"path",
"=",
"''",
")",
"{",
"$",
"this",
"->",
"formatOutput",
"=",
"true",
";",
"if",
"(",
"$",
"path",
")",
"{",
"$",
"bool",
"=",
"@",
"$",
"this",
"->",
"save",
"(",
"$",
"path",
")",
";",
"if... | save xml file, optionally will return as string
@param string $path xml file path
@return string|boolean
@example saveXmlFile('path/filename.xml'); save to file
@example saveXmlFile() will return as simple text | [
"save",
"xml",
"file",
"optionally",
"will",
"return",
"as",
"string"
] | a8df78ee4f7b97b862f989d3effc75f022fd75cb | https://github.com/bluetree-service/data/blob/a8df78ee4f7b97b862f989d3effc75f022fd75cb/src/Data/Xml.php#L111-L126 |
204,249 | bluetree-service/data | src/Data/Xml.php | Xml.searchByAttributeRecurrent | protected function searchByAttributeRecurrent(
DOMNodeList $node,
$value,
array $list = []
) {
/** @var DomElement $child */
foreach ($node as $child) {
if ($child->nodeType === 1) {
if ($child->hasChildNodes()) {
$list = $this-... | php | protected function searchByAttributeRecurrent(
DOMNodeList $node,
$value,
array $list = []
) {
/** @var DomElement $child */
foreach ($node as $child) {
if ($child->nodeType === 1) {
if ($child->hasChildNodes()) {
$list = $this-... | [
"protected",
"function",
"searchByAttributeRecurrent",
"(",
"DOMNodeList",
"$",
"node",
",",
"$",
"value",
",",
"array",
"$",
"list",
"=",
"[",
"]",
")",
"{",
"/** @var DomElement $child */",
"foreach",
"(",
"$",
"node",
"as",
"$",
"child",
")",
"{",
"if",
... | search for all nodes with given attribute
return list of nodes with attribute value as key
@param DOMNodeList $node
@param string $value attribute value to search
@param array|boolean $list list of find nodes for recurrence
@return array | [
"search",
"for",
"all",
"nodes",
"with",
"given",
"attribute",
"return",
"list",
"of",
"nodes",
"with",
"attribute",
"value",
"as",
"key"
] | a8df78ee4f7b97b862f989d3effc75f022fd75cb | https://github.com/bluetree-service/data/blob/a8df78ee4f7b97b862f989d3effc75f022fd75cb/src/Data/Xml.php#L137-L161 |
204,250 | iron-bound-designs/wp-notifications | src/Notification.php | Notification.generate_rendered_tags | final protected function generate_rendered_tags() {
$data_sources = $this->data_sources;
$data_sources[] = $this->recipient;
$tags = $this->manager->render_tags( $data_sources );
$rendered = array();
foreach ( $tags as $tag => $value ) {
$rendered[ '{' . $tag . '}' ] = $value;
}
$this->regene... | php | final protected function generate_rendered_tags() {
$data_sources = $this->data_sources;
$data_sources[] = $this->recipient;
$tags = $this->manager->render_tags( $data_sources );
$rendered = array();
foreach ( $tags as $tag => $value ) {
$rendered[ '{' . $tag . '}' ] = $value;
}
$this->regene... | [
"final",
"protected",
"function",
"generate_rendered_tags",
"(",
")",
"{",
"$",
"data_sources",
"=",
"$",
"this",
"->",
"data_sources",
";",
"$",
"data_sources",
"[",
"]",
"=",
"$",
"this",
"->",
"recipient",
";",
"$",
"tags",
"=",
"$",
"this",
"->",
"ma... | Generate the rendered forms of the tags.
@since 1.0
@return array | [
"Generate",
"the",
"rendered",
"forms",
"of",
"the",
"tags",
"."
] | 4fdf67d28d194576d35f86245b2f539c4815cde2 | https://github.com/iron-bound-designs/wp-notifications/blob/4fdf67d28d194576d35f86245b2f539c4815cde2/src/Notification.php#L88-L103 |
204,251 | iron-bound-designs/wp-notifications | src/Notification.php | Notification.add_data_source | public function add_data_source( \Serializable $source, $name = '' ) {
if ( $name ) {
$this->data_sources[ $name ] = $source;
} else {
$this->data_sources[] = $source;
}
$this->regenerate();
return $this;
} | php | public function add_data_source( \Serializable $source, $name = '' ) {
if ( $name ) {
$this->data_sources[ $name ] = $source;
} else {
$this->data_sources[] = $source;
}
$this->regenerate();
return $this;
} | [
"public",
"function",
"add_data_source",
"(",
"\\",
"Serializable",
"$",
"source",
",",
"$",
"name",
"=",
"''",
")",
"{",
"if",
"(",
"$",
"name",
")",
"{",
"$",
"this",
"->",
"data_sources",
"[",
"$",
"name",
"]",
"=",
"$",
"source",
";",
"}",
"els... | Add a data source.
@since 1.0
@param \Serializable $source
@param string $name If passed, listeners specifying that function
argument name will receive this data source.
@return self | [
"Add",
"a",
"data",
"source",
"."
] | 4fdf67d28d194576d35f86245b2f539c4815cde2 | https://github.com/iron-bound-designs/wp-notifications/blob/4fdf67d28d194576d35f86245b2f539c4815cde2/src/Notification.php#L125-L136 |
204,252 | iron-bound-designs/wp-notifications | src/Notification.php | Notification.get_data_to_serialize | protected function get_data_to_serialize() {
return array(
'recipient' => $this->recipient->ID,
'message' => $this->message,
'subject' => $this->subject,
'strategy' => $this->strategy,
'manager' => $this->manager->get_type(),
'data_sources' => $this->data_sources
);
} | php | protected function get_data_to_serialize() {
return array(
'recipient' => $this->recipient->ID,
'message' => $this->message,
'subject' => $this->subject,
'strategy' => $this->strategy,
'manager' => $this->manager->get_type(),
'data_sources' => $this->data_sources
);
} | [
"protected",
"function",
"get_data_to_serialize",
"(",
")",
"{",
"return",
"array",
"(",
"'recipient'",
"=>",
"$",
"this",
"->",
"recipient",
"->",
"ID",
",",
"'message'",
"=>",
"$",
"this",
"->",
"message",
",",
"'subject'",
"=>",
"$",
"this",
"->",
"subj... | Get the data to serialize.
Child classes should override this method, and add their own data.
This can be exploited to override the base class's data - don't.
@since 1.0
@return array | [
"Get",
"the",
"data",
"to",
"serialize",
"."
] | 4fdf67d28d194576d35f86245b2f539c4815cde2 | https://github.com/iron-bound-designs/wp-notifications/blob/4fdf67d28d194576d35f86245b2f539c4815cde2/src/Notification.php#L263-L272 |
204,253 | iron-bound-designs/wp-notifications | src/Notification.php | Notification.do_unserialize | protected function do_unserialize( array $data ) {
$this->recipient = get_user_by( 'id', $data['recipient'] );
$this->message = $data['message'];
$this->subject = $data['subject'];
$this->manager = Factory::make( $data['manager'] );
$this->strategy = $data['strategy'];
$this->data_sources = $data['d... | php | protected function do_unserialize( array $data ) {
$this->recipient = get_user_by( 'id', $data['recipient'] );
$this->message = $data['message'];
$this->subject = $data['subject'];
$this->manager = Factory::make( $data['manager'] );
$this->strategy = $data['strategy'];
$this->data_sources = $data['d... | [
"protected",
"function",
"do_unserialize",
"(",
"array",
"$",
"data",
")",
"{",
"$",
"this",
"->",
"recipient",
"=",
"get_user_by",
"(",
"'id'",
",",
"$",
"data",
"[",
"'recipient'",
"]",
")",
";",
"$",
"this",
"->",
"message",
"=",
"$",
"data",
"[",
... | Do the actual unserialization.
Assign the data to class properties.
@since 1.0
@param array $data | [
"Do",
"the",
"actual",
"unserialization",
"."
] | 4fdf67d28d194576d35f86245b2f539c4815cde2 | https://github.com/iron-bound-designs/wp-notifications/blob/4fdf67d28d194576d35f86245b2f539c4815cde2/src/Notification.php#L301-L310 |
204,254 | umbrella-code/umbrella | src/Umbrella/Validation/Validator.php | Validator.hasFailed | public function hasFailed()
{
if($this->failed == false || $this->passed == true)
{
$this->failed = true;
$this->passed = false;
}
} | php | public function hasFailed()
{
if($this->failed == false || $this->passed == true)
{
$this->failed = true;
$this->passed = false;
}
} | [
"public",
"function",
"hasFailed",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"failed",
"==",
"false",
"||",
"$",
"this",
"->",
"passed",
"==",
"true",
")",
"{",
"$",
"this",
"->",
"failed",
"=",
"true",
";",
"$",
"this",
"->",
"passed",
"=",
"... | Set booleans if validator failed
@return void | [
"Set",
"booleans",
"if",
"validator",
"failed"
] | e23d8d367047113933ec22346eb9f002a555bd52 | https://github.com/umbrella-code/umbrella/blob/e23d8d367047113933ec22346eb9f002a555bd52/src/Umbrella/Validation/Validator.php#L73-L80 |
204,255 | umbrella-code/umbrella | src/Umbrella/Validation/Validator.php | Validator.hasPassed | public function hasPassed()
{
if($this->passed == false || $this->failed == true)
{
$this->passed = true;
$this->failed = false;
}
} | php | public function hasPassed()
{
if($this->passed == false || $this->failed == true)
{
$this->passed = true;
$this->failed = false;
}
} | [
"public",
"function",
"hasPassed",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"passed",
"==",
"false",
"||",
"$",
"this",
"->",
"failed",
"==",
"true",
")",
"{",
"$",
"this",
"->",
"passed",
"=",
"true",
";",
"$",
"this",
"->",
"failed",
"=",
"... | Set booleans if validator passed
@return void | [
"Set",
"booleans",
"if",
"validator",
"passed"
] | e23d8d367047113933ec22346eb9f002a555bd52 | https://github.com/umbrella-code/umbrella/blob/e23d8d367047113933ec22346eb9f002a555bd52/src/Umbrella/Validation/Validator.php#L87-L94 |
204,256 | SpoonX/SxBootstrap | src/SxBootstrap/View/Helper/Bootstrap/Form/Form.php | Form.renderFormActions | protected function renderFormActions()
{
$rowPlugin = $this->getRowPlugin();
if (!empty($this->formActionElements)) {
$this->getElement()->addChild($rowPlugin($this->formActionElements, true)->getElement());
}
return $this;
} | php | protected function renderFormActions()
{
$rowPlugin = $this->getRowPlugin();
if (!empty($this->formActionElements)) {
$this->getElement()->addChild($rowPlugin($this->formActionElements, true)->getElement());
}
return $this;
} | [
"protected",
"function",
"renderFormActions",
"(",
")",
"{",
"$",
"rowPlugin",
"=",
"$",
"this",
"->",
"getRowPlugin",
"(",
")",
";",
"if",
"(",
"!",
"empty",
"(",
"$",
"this",
"->",
"formActionElements",
")",
")",
"{",
"$",
"this",
"->",
"getElement",
... | Render the form action elements, when needed.
@return $this | [
"Render",
"the",
"form",
"action",
"elements",
"when",
"needed",
"."
] | 768b02e3b65f7dfe560e821cb0ff41ad3f86b3b6 | https://github.com/SpoonX/SxBootstrap/blob/768b02e3b65f7dfe560e821cb0ff41ad3f86b3b6/src/SxBootstrap/View/Helper/Bootstrap/Form/Form.php#L146-L155 |
204,257 | bantuXorg/php-ini-get-wrapper | src/IniGetWrapper.php | IniGetWrapper.getString | public function getString($varname)
{
$value = $this->get($varname);
return $value === null ? null : trim($value);
} | php | public function getString($varname)
{
$value = $this->get($varname);
return $value === null ? null : trim($value);
} | [
"public",
"function",
"getString",
"(",
"$",
"varname",
")",
"{",
"$",
"value",
"=",
"$",
"this",
"->",
"get",
"(",
"$",
"varname",
")",
";",
"return",
"$",
"value",
"===",
"null",
"?",
"null",
":",
"trim",
"(",
"$",
"value",
")",
";",
"}"
] | Gets the configuration option value as a trimmed string.
@param string $varname The configuration option name.
@return null|string Null if configuration option does not exist.
The configuration option value (string) otherwise. | [
"Gets",
"the",
"configuration",
"option",
"value",
"as",
"a",
"trimmed",
"string",
"."
] | 789ef63472cb2a8d6f49324485bc3b057ff56d50 | https://github.com/bantuXorg/php-ini-get-wrapper/blob/789ef63472cb2a8d6f49324485bc3b057ff56d50/src/IniGetWrapper.php#L40-L44 |
204,258 | bantuXorg/php-ini-get-wrapper | src/IniGetWrapper.php | IniGetWrapper.getBool | public function getBool($varname)
{
$value = $this->getString($varname);
return $value === null ? null : $value && strtolower($value) !== 'off';
} | php | public function getBool($varname)
{
$value = $this->getString($varname);
return $value === null ? null : $value && strtolower($value) !== 'off';
} | [
"public",
"function",
"getBool",
"(",
"$",
"varname",
")",
"{",
"$",
"value",
"=",
"$",
"this",
"->",
"getString",
"(",
"$",
"varname",
")",
";",
"return",
"$",
"value",
"===",
"null",
"?",
"null",
":",
"$",
"value",
"&&",
"strtolower",
"(",
"$",
"... | Gets configuration option value as a boolean.
Interprets the string value 'off' as false.
@param string $varname The configuration option name.
@return null|bool Null if configuration option does not exist.
False if configuration option is disabled.
True otherwise. | [
"Gets",
"configuration",
"option",
"value",
"as",
"a",
"boolean",
".",
"Interprets",
"the",
"string",
"value",
"off",
"as",
"false",
"."
] | 789ef63472cb2a8d6f49324485bc3b057ff56d50 | https://github.com/bantuXorg/php-ini-get-wrapper/blob/789ef63472cb2a8d6f49324485bc3b057ff56d50/src/IniGetWrapper.php#L55-L59 |
204,259 | bantuXorg/php-ini-get-wrapper | src/IniGetWrapper.php | IniGetWrapper.getNumeric | public function getNumeric($varname)
{
$value = $this->getString($varname);
return is_numeric($value) ? $value + 0 : null;
} | php | public function getNumeric($varname)
{
$value = $this->getString($varname);
return is_numeric($value) ? $value + 0 : null;
} | [
"public",
"function",
"getNumeric",
"(",
"$",
"varname",
")",
"{",
"$",
"value",
"=",
"$",
"this",
"->",
"getString",
"(",
"$",
"varname",
")",
";",
"return",
"is_numeric",
"(",
"$",
"value",
")",
"?",
"$",
"value",
"+",
"0",
":",
"null",
";",
"}"
... | Gets configuration option value as an integer.
@param string $varname The configuration option name.
@return null|int|float Null if configuration option does not exist or is not numeric.
The configuration option value (integer or float) otherwise. | [
"Gets",
"configuration",
"option",
"value",
"as",
"an",
"integer",
"."
] | 789ef63472cb2a8d6f49324485bc3b057ff56d50 | https://github.com/bantuXorg/php-ini-get-wrapper/blob/789ef63472cb2a8d6f49324485bc3b057ff56d50/src/IniGetWrapper.php#L68-L72 |
204,260 | RowlandOti/ooglee-blogmodule | src/OoGlee/Application/Entities/Post/PostResolver.php | PostResolver.resolve | public function resolve()
{
$url = $this->request->url();
$tmp = explode('/', $url);
$last_seg = end($tmp);
return $this->repository->findBySlug($last_seg);
} | php | public function resolve()
{
$url = $this->request->url();
$tmp = explode('/', $url);
$last_seg = end($tmp);
return $this->repository->findBySlug($last_seg);
} | [
"public",
"function",
"resolve",
"(",
")",
"{",
"$",
"url",
"=",
"$",
"this",
"->",
"request",
"->",
"url",
"(",
")",
";",
"$",
"tmp",
"=",
"explode",
"(",
"'/'",
",",
"$",
"url",
")",
";",
"$",
"last_seg",
"=",
"end",
"(",
"$",
"tmp",
")",
"... | Resolve the post.
@return PostInterface|null | [
"Resolve",
"the",
"post",
"."
] | d9c0fe4745bb09f8b94047b0cda4fd7438cde16a | https://github.com/RowlandOti/ooglee-blogmodule/blob/d9c0fe4745bb09f8b94047b0cda4fd7438cde16a/src/OoGlee/Application/Entities/Post/PostResolver.php#L51-L58 |
204,261 | slickframework/form | src/Element/FieldSet.php | FieldSet.isValid | public function isValid()
{
$valid = true;
$this->validate();
foreach ($this->getIterator() as $element) {
if ($element instanceof ValidationAwareInterface) {
$valid = $element->isValid()
? $valid
: false;
}
... | php | public function isValid()
{
$valid = true;
$this->validate();
foreach ($this->getIterator() as $element) {
if ($element instanceof ValidationAwareInterface) {
$valid = $element->isValid()
? $valid
: false;
}
... | [
"public",
"function",
"isValid",
"(",
")",
"{",
"$",
"valid",
"=",
"true",
";",
"$",
"this",
"->",
"validate",
"(",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"getIterator",
"(",
")",
"as",
"$",
"element",
")",
"{",
"if",
"(",
"$",
"element",
"... | Checks if all elements are valid
@return mixed | [
"Checks",
"if",
"all",
"elements",
"are",
"valid"
] | e7d536b3bad49194e246ff93587da2589e31a003 | https://github.com/slickframework/form/blob/e7d536b3bad49194e246ff93587da2589e31a003/src/Element/FieldSet.php#L62-L74 |
204,262 | slickframework/form | src/Element/FieldSet.php | FieldSet.get | public function get($name)
{
$selected = null;
/** @var ElementInterface|ContainerInterface $element */
foreach ($this as $element) {
if ($element->getName() == $name) {
$selected = $element;
break;
}
if ($element instanceo... | php | public function get($name)
{
$selected = null;
/** @var ElementInterface|ContainerInterface $element */
foreach ($this as $element) {
if ($element->getName() == $name) {
$selected = $element;
break;
}
if ($element instanceo... | [
"public",
"function",
"get",
"(",
"$",
"name",
")",
"{",
"$",
"selected",
"=",
"null",
";",
"/** @var ElementInterface|ContainerInterface $element */",
"foreach",
"(",
"$",
"this",
"as",
"$",
"element",
")",
"{",
"if",
"(",
"$",
"element",
"->",
"getName",
"... | Gets element by name
@param string $name
@return null|ElementInterface|InputInterface | [
"Gets",
"element",
"by",
"name"
] | e7d536b3bad49194e246ff93587da2589e31a003 | https://github.com/slickframework/form/blob/e7d536b3bad49194e246ff93587da2589e31a003/src/Element/FieldSet.php#L100-L119 |
204,263 | slickframework/form | src/Element/FieldSet.php | FieldSet.setValues | public function setValues(array $values)
{
foreach ($values as $name => $value) {
if ($element = $this->get($name)) {
$element->setValue($value);
}
}
return $this;
} | php | public function setValues(array $values)
{
foreach ($values as $name => $value) {
if ($element = $this->get($name)) {
$element->setValue($value);
}
}
return $this;
} | [
"public",
"function",
"setValues",
"(",
"array",
"$",
"values",
")",
"{",
"foreach",
"(",
"$",
"values",
"as",
"$",
"name",
"=>",
"$",
"value",
")",
"{",
"if",
"(",
"$",
"element",
"=",
"$",
"this",
"->",
"get",
"(",
"$",
"name",
")",
")",
"{",
... | Sets the values form matched elements
The passed array is a key/value array where keys are used to
match against element names. It will only assign the value to
the marched element only.
@param array $values
@return self|$this|ContainerInterface | [
"Sets",
"the",
"values",
"form",
"matched",
"elements"
] | e7d536b3bad49194e246ff93587da2589e31a003 | https://github.com/slickframework/form/blob/e7d536b3bad49194e246ff93587da2589e31a003/src/Element/FieldSet.php#L132-L140 |
204,264 | slickframework/form | src/Element/FieldSet.php | FieldSet.validate | public function validate()
{
foreach ($this as $element) {
if (
$element instanceof ValidationAwareInterface ||
$element instanceof ContainerInterface
) {
$element->validate();
}
}
return $this;
} | php | public function validate()
{
foreach ($this as $element) {
if (
$element instanceof ValidationAwareInterface ||
$element instanceof ContainerInterface
) {
$element->validate();
}
}
return $this;
} | [
"public",
"function",
"validate",
"(",
")",
"{",
"foreach",
"(",
"$",
"this",
"as",
"$",
"element",
")",
"{",
"if",
"(",
"$",
"element",
"instanceof",
"ValidationAwareInterface",
"||",
"$",
"element",
"instanceof",
"ContainerInterface",
")",
"{",
"$",
"eleme... | Runs validation chain in all its elements
@return self|$this|ElementInterface | [
"Runs",
"validation",
"chain",
"in",
"all",
"its",
"elements"
] | e7d536b3bad49194e246ff93587da2589e31a003 | https://github.com/slickframework/form/blob/e7d536b3bad49194e246ff93587da2589e31a003/src/Element/FieldSet.php#L219-L231 |
204,265 | jelix/file-utilities | lib/Path.php | Path.isAbsolute | public static function isAbsolute($path)
{
list($prefix, $path, $absolute) = self::_startNormalize($path);
return $absolute;
} | php | public static function isAbsolute($path)
{
list($prefix, $path, $absolute) = self::_startNormalize($path);
return $absolute;
} | [
"public",
"static",
"function",
"isAbsolute",
"(",
"$",
"path",
")",
"{",
"list",
"(",
"$",
"prefix",
",",
"$",
"path",
",",
"$",
"absolute",
")",
"=",
"self",
"::",
"_startNormalize",
"(",
"$",
"path",
")",
";",
"return",
"$",
"absolute",
";",
"}"
] | says if the given path is an absolute one or not.
@param string $path
@return bool true if the path is absolute | [
"says",
"if",
"the",
"given",
"path",
"is",
"an",
"absolute",
"one",
"or",
"not",
"."
] | 05fd364860ed147e6367de9db3dc544f58c5a05c | https://github.com/jelix/file-utilities/blob/05fd364860ed147e6367de9db3dc544f58c5a05c/lib/Path.php#L50-L55 |
204,266 | jelix/file-utilities | lib/Path.php | Path._normalizePath | protected static function _normalizePath($originalPath, $alwaysArray, $basePath = '')
{
list($prefix, $path, $absolute) = self::_startNormalize($originalPath);
if (!$absolute && $basePath) {
list($prefix, $path, $absolute) = self::_startNormalize($basePath.'/'.$originalPath);
}
... | php | protected static function _normalizePath($originalPath, $alwaysArray, $basePath = '')
{
list($prefix, $path, $absolute) = self::_startNormalize($originalPath);
if (!$absolute && $basePath) {
list($prefix, $path, $absolute) = self::_startNormalize($basePath.'/'.$originalPath);
}
... | [
"protected",
"static",
"function",
"_normalizePath",
"(",
"$",
"originalPath",
",",
"$",
"alwaysArray",
",",
"$",
"basePath",
"=",
"''",
")",
"{",
"list",
"(",
"$",
"prefix",
",",
"$",
"path",
",",
"$",
"absolute",
")",
"=",
"self",
"::",
"_startNormaliz... | it returns components of a path after normalization, in an array.
- first element: for windows path, the drive part "C:", "C:" etc... always in uppercase
- second element: the normalized path. as string or array depending of $alwaysArray
when as string: no trailing slash.
- third element: indicate if the given path is... | [
"it",
"returns",
"components",
"of",
"a",
"path",
"after",
"normalization",
"in",
"an",
"array",
"."
] | 05fd364860ed147e6367de9db3dc544f58c5a05c | https://github.com/jelix/file-utilities/blob/05fd364860ed147e6367de9db3dc544f58c5a05c/lib/Path.php#L112-L165 |
204,267 | phPoirot/Client-OAuth2 | src/Client.php | Client.attainAuthorizationUrl | function attainAuthorizationUrl(iGrantAuthorizeRequest $grant)
{
# Build Authorize Url
$grantParams = $grant->assertAuthorizeParams();
$response = $this->call( new GetAuthorizeUrl($grantParams) );
if ( $ex = $response->hasException() )
throw $ex;
return $res... | php | function attainAuthorizationUrl(iGrantAuthorizeRequest $grant)
{
# Build Authorize Url
$grantParams = $grant->assertAuthorizeParams();
$response = $this->call( new GetAuthorizeUrl($grantParams) );
if ( $ex = $response->hasException() )
throw $ex;
return $res... | [
"function",
"attainAuthorizationUrl",
"(",
"iGrantAuthorizeRequest",
"$",
"grant",
")",
"{",
"# Build Authorize Url",
"$",
"grantParams",
"=",
"$",
"grant",
"->",
"assertAuthorizeParams",
"(",
")",
";",
"$",
"response",
"=",
"$",
"this",
"->",
"call",
"(",
"new"... | Builds the authorization URL
- look in grants available with response_type code
- make url from grant parameters
@param iGrantAuthorizeRequest $grant Using specific grant
@return string Authorization URL
@throws \Exception | [
"Builds",
"the",
"authorization",
"URL"
] | 8745fd54afbbb185669b9e38b1241ecc8ffc7268 | https://github.com/phPoirot/Client-OAuth2/blob/8745fd54afbbb185669b9e38b1241ecc8ffc7268/src/Client.php#L65-L76 |
204,268 | phPoirot/Client-OAuth2 | src/Client.php | Client.attainAccessToken | function attainAccessToken(iGrantTokenRequest $grant)
{
// client_id, secret_key can send as Authorization Header Or Post Request Body
$grantParams = $grant->assertTokenParams();
$response = $this->call( new Token($grantParams) );
if ( $ex = $response->hasException() )
t... | php | function attainAccessToken(iGrantTokenRequest $grant)
{
// client_id, secret_key can send as Authorization Header Or Post Request Body
$grantParams = $grant->assertTokenParams();
$response = $this->call( new Token($grantParams) );
if ( $ex = $response->hasException() )
t... | [
"function",
"attainAccessToken",
"(",
"iGrantTokenRequest",
"$",
"grant",
")",
"{",
"// client_id, secret_key can send as Authorization Header Or Post Request Body",
"$",
"grantParams",
"=",
"$",
"grant",
"->",
"assertTokenParams",
"(",
")",
";",
"$",
"response",
"=",
"$"... | Requests an access token using a specified grant.
@param iGrantTokenRequest $grant
@return iAccessTokenObject|DataEntity
@throws \Exception | [
"Requests",
"an",
"access",
"token",
"using",
"a",
"specified",
"grant",
"."
] | 8745fd54afbbb185669b9e38b1241ecc8ffc7268 | https://github.com/phPoirot/Client-OAuth2/blob/8745fd54afbbb185669b9e38b1241ecc8ffc7268/src/Client.php#L86-L104 |
204,269 | phPoirot/Client-OAuth2 | src/Client.php | Client.withGrant | function withGrant($grantTypeName, array $overrideOptions = [])
{
$options = [
'scopes' => $this->defaultScopes,
'client_id' => $this->clientId,
'client_secret' => $this->clientSecret,
];
if (! empty($overrideOptions) )
$options = a... | php | function withGrant($grantTypeName, array $overrideOptions = [])
{
$options = [
'scopes' => $this->defaultScopes,
'client_id' => $this->clientId,
'client_secret' => $this->clientSecret,
];
if (! empty($overrideOptions) )
$options = a... | [
"function",
"withGrant",
"(",
"$",
"grantTypeName",
",",
"array",
"$",
"overrideOptions",
"=",
"[",
"]",
")",
"{",
"$",
"options",
"=",
"[",
"'scopes'",
"=>",
"$",
"this",
"->",
"defaultScopes",
",",
"'client_id'",
"=>",
"$",
"this",
"->",
"clientId",
",... | Retrieve Specific Grant Type
- inject default client configuration within grant object
example code:
$auth->withGrant(
GrantPlugins::AUTHORIZATION_CODE
, ['state' => 'custom_state'] )
@param string|ipGrantRequest $grantTypeName
@param array $overrideOptions
@return aGrantRequest | [
"Retrieve",
"Specific",
"Grant",
"Type"
] | 8745fd54afbbb185669b9e38b1241ecc8ffc7268 | https://github.com/phPoirot/Client-OAuth2/blob/8745fd54afbbb185669b9e38b1241ecc8ffc7268/src/Client.php#L122-L142 |
204,270 | phPoirot/Client-OAuth2 | src/Client.php | Client.platform | protected function platform()
{
if (! $this->platform )
$this->platform = new PlatformRest;
# Default Options Overriding
$this->platform->setServerUrl( $this->serverUrl );
return $this->platform;
} | php | protected function platform()
{
if (! $this->platform )
$this->platform = new PlatformRest;
# Default Options Overriding
$this->platform->setServerUrl( $this->serverUrl );
return $this->platform;
} | [
"protected",
"function",
"platform",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"platform",
")",
"$",
"this",
"->",
"platform",
"=",
"new",
"PlatformRest",
";",
"# Default Options Overriding",
"$",
"this",
"->",
"platform",
"->",
"setServerUrl",
"(",
... | Get Client Platform
- used by request to build params for
server execution call and response
@return iPlatform | [
"Get",
"Client",
"Platform"
] | 8745fd54afbbb185669b9e38b1241ecc8ffc7268 | https://github.com/phPoirot/Client-OAuth2/blob/8745fd54afbbb185669b9e38b1241ecc8ffc7268/src/Client.php#L166-L176 |
204,271 | 3ev/wordpress-core | src/Tev/View/Renderer.php | Renderer.render | public function render($filename, $vars = array())
{
$localTemplate = $this->templateDir . '/' . $filename;
$themeTemplate = locate_template($filename);
if (!file_exists($localTemplate) && !file_exists($themeTemplate)) {
throw new NotFoundException("View at $localTemplate or $th... | php | public function render($filename, $vars = array())
{
$localTemplate = $this->templateDir . '/' . $filename;
$themeTemplate = locate_template($filename);
if (!file_exists($localTemplate) && !file_exists($themeTemplate)) {
throw new NotFoundException("View at $localTemplate or $th... | [
"public",
"function",
"render",
"(",
"$",
"filename",
",",
"$",
"vars",
"=",
"array",
"(",
")",
")",
"{",
"$",
"localTemplate",
"=",
"$",
"this",
"->",
"templateDir",
".",
"'/'",
".",
"$",
"filename",
";",
"$",
"themeTemplate",
"=",
"locate_template",
... | Renders a template file.
Assigns all $var keys to $this->$key for us in template.
@param string $filename Full-filename
@param array $vars View variables
@return string Rendered view
@throws \Tev\View\Exception\NotFoundException If view file not found | [
"Renders",
"a",
"template",
"file",
"."
] | da674fbec5bf3d5bd2a2141680a4c141113eb6b0 | https://github.com/3ev/wordpress-core/blob/da674fbec5bf3d5bd2a2141680a4c141113eb6b0/src/Tev/View/Renderer.php#L51-L70 |
204,272 | ekyna/AdminBundle | Helper/ResourceHelper.php | ResourceHelper.isGranted | public function isGranted($resource, $action = 'view')
{
return $this->aclOperator->isAccessGranted($resource, $this->getPermission($action));
} | php | public function isGranted($resource, $action = 'view')
{
return $this->aclOperator->isAccessGranted($resource, $this->getPermission($action));
} | [
"public",
"function",
"isGranted",
"(",
"$",
"resource",
",",
"$",
"action",
"=",
"'view'",
")",
"{",
"return",
"$",
"this",
"->",
"aclOperator",
"->",
"isAccessGranted",
"(",
"$",
"resource",
",",
"$",
"this",
"->",
"getPermission",
"(",
"$",
"action",
... | Returns whether the user has access granted or not on the given resource for the given action.
@param mixed $resource
@param string $action
@return boolean | [
"Returns",
"whether",
"the",
"user",
"has",
"access",
"granted",
"or",
"not",
"on",
"the",
"given",
"resource",
"for",
"the",
"given",
"action",
"."
] | 3f58e253ae9cf651add7f3d587caec80eaea459a | https://github.com/ekyna/AdminBundle/blob/3f58e253ae9cf651add7f3d587caec80eaea459a/Helper/ResourceHelper.php#L87-L90 |
204,273 | ekyna/AdminBundle | Helper/ResourceHelper.php | ResourceHelper.generateResourcePath | public function generateResourcePath($resource, $action = 'show')
{
$configuration = $this->registry->findConfiguration($resource);
$routeName = $configuration->getRoute($action);
$route = $this->findRoute($routeName);
$requirements = $route->getRequirements();
$accessor = ... | php | public function generateResourcePath($resource, $action = 'show')
{
$configuration = $this->registry->findConfiguration($resource);
$routeName = $configuration->getRoute($action);
$route = $this->findRoute($routeName);
$requirements = $route->getRequirements();
$accessor = ... | [
"public",
"function",
"generateResourcePath",
"(",
"$",
"resource",
",",
"$",
"action",
"=",
"'show'",
")",
"{",
"$",
"configuration",
"=",
"$",
"this",
"->",
"registry",
"->",
"findConfiguration",
"(",
"$",
"resource",
")",
";",
"$",
"routeName",
"=",
"$"... | Generates an admin path for the given resource and action.
@param object $resource
@param string $action
@throws \RuntimeException
@return string | [
"Generates",
"an",
"admin",
"path",
"for",
"the",
"given",
"resource",
"and",
"action",
"."
] | 3f58e253ae9cf651add7f3d587caec80eaea459a | https://github.com/ekyna/AdminBundle/blob/3f58e253ae9cf651add7f3d587caec80eaea459a/Helper/ResourceHelper.php#L102-L131 |
204,274 | ekyna/AdminBundle | Helper/ResourceHelper.php | ResourceHelper.getPermission | public function getPermission($action)
{
$action = strtoupper($action);
if ($action == 'LIST') {
return 'VIEW';
} elseif ($action == 'SHOW') {
return 'VIEW';
} elseif ($action == 'NEW') {
return 'CREATE';
} elseif ($action == 'EDIT') {
... | php | public function getPermission($action)
{
$action = strtoupper($action);
if ($action == 'LIST') {
return 'VIEW';
} elseif ($action == 'SHOW') {
return 'VIEW';
} elseif ($action == 'NEW') {
return 'CREATE';
} elseif ($action == 'EDIT') {
... | [
"public",
"function",
"getPermission",
"(",
"$",
"action",
")",
"{",
"$",
"action",
"=",
"strtoupper",
"(",
"$",
"action",
")",
";",
"if",
"(",
"$",
"action",
"==",
"'LIST'",
")",
"{",
"return",
"'VIEW'",
";",
"}",
"elseif",
"(",
"$",
"action",
"==",... | Returns the permission for the given action.
@param string $action
@return string | [
"Returns",
"the",
"permission",
"for",
"the",
"given",
"action",
"."
] | 3f58e253ae9cf651add7f3d587caec80eaea459a | https://github.com/ekyna/AdminBundle/blob/3f58e253ae9cf651add7f3d587caec80eaea459a/Helper/ResourceHelper.php#L140-L155 |
204,275 | ekyna/AdminBundle | Helper/ResourceHelper.php | ResourceHelper.findRoute | public function findRoute($routeName)
{
// TODO create a route finder ? (same in CmsBundle BreadcrumbBuilder)
$i18nRouterClass = 'JMS\I18nRoutingBundle\Router\I18nRouterInterface';
if (interface_exists($i18nRouterClass) && $this->router instanceof $i18nRouterClass) {
$route = $th... | php | public function findRoute($routeName)
{
// TODO create a route finder ? (same in CmsBundle BreadcrumbBuilder)
$i18nRouterClass = 'JMS\I18nRoutingBundle\Router\I18nRouterInterface';
if (interface_exists($i18nRouterClass) && $this->router instanceof $i18nRouterClass) {
$route = $th... | [
"public",
"function",
"findRoute",
"(",
"$",
"routeName",
")",
"{",
"// TODO create a route finder ? (same in CmsBundle BreadcrumbBuilder)",
"$",
"i18nRouterClass",
"=",
"'JMS\\I18nRoutingBundle\\Router\\I18nRouterInterface'",
";",
"if",
"(",
"interface_exists",
"(",
"$",
"i18n... | Finds the route definition.
@param string $routeName
@return null|\Symfony\Component\Routing\Route | [
"Finds",
"the",
"route",
"definition",
"."
] | 3f58e253ae9cf651add7f3d587caec80eaea459a | https://github.com/ekyna/AdminBundle/blob/3f58e253ae9cf651add7f3d587caec80eaea459a/Helper/ResourceHelper.php#L163-L176 |
204,276 | smalldb/libSmalldb | class/FlupdoCrudMachine.php | FlupdoCrudMachine.setupDefaultMachine | protected function setupDefaultMachine(array $config)
{
// Name of inputs and outputs with properties
$io_name = isset($config['io_name']) ? (string) $config['io_name'] : 'item';
// Create default transitions?
$no_default_transitions = !empty($config['crud_machine_no_default_transitions']); /// @deprecated
... | php | protected function setupDefaultMachine(array $config)
{
// Name of inputs and outputs with properties
$io_name = isset($config['io_name']) ? (string) $config['io_name'] : 'item';
// Create default transitions?
$no_default_transitions = !empty($config['crud_machine_no_default_transitions']); /// @deprecated
... | [
"protected",
"function",
"setupDefaultMachine",
"(",
"array",
"$",
"config",
")",
"{",
"// Name of inputs and outputs with properties",
"$",
"io_name",
"=",
"isset",
"(",
"$",
"config",
"[",
"'io_name'",
"]",
")",
"?",
"(",
"string",
")",
"$",
"config",
"[",
"... | Setup basic CRUD machine. | [
"Setup",
"basic",
"CRUD",
"machine",
"."
] | b94d22af5014e8060d0530fc7043768cdc57b01a | https://github.com/smalldb/libSmalldb/blob/b94d22af5014e8060d0530fc7043768cdc57b01a/class/FlupdoCrudMachine.php#L95-L181 |
204,277 | smalldb/libSmalldb | class/FlupdoCrudMachine.php | FlupdoCrudMachine.recalculateTree | protected function recalculateTree()
{
if (!$this->nested_sets_enabled) {
throw new \RuntimeException('Nested sets are disabled for this entity.');
}
$q_table = $this->flupdo->quoteIdent($this->table);
$cols = $this->nested_sets_table_columns;
$c_order_by = $this->nested_sets_order_by;
$c_i... | php | protected function recalculateTree()
{
if (!$this->nested_sets_enabled) {
throw new \RuntimeException('Nested sets are disabled for this entity.');
}
$q_table = $this->flupdo->quoteIdent($this->table);
$cols = $this->nested_sets_table_columns;
$c_order_by = $this->nested_sets_order_by;
$c_i... | [
"protected",
"function",
"recalculateTree",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"nested_sets_enabled",
")",
"{",
"throw",
"new",
"\\",
"RuntimeException",
"(",
"'Nested sets are disabled for this entity.'",
")",
";",
"}",
"$",
"q_table",
"=",
"$",
... | Recalculate nested-sets tree indices
To use this feature a parent, left, right and depth columns must be specified.
Composed primary keys are not supported yet.
Three extra columns are required: tree_left, tree_right, tree_depth
(ints, all nullable). This function will update them according to id
and parent_id colum... | [
"Recalculate",
"nested",
"-",
"sets",
"tree",
"indices"
] | b94d22af5014e8060d0530fc7043768cdc57b01a | https://github.com/smalldb/libSmalldb/blob/b94d22af5014e8060d0530fc7043768cdc57b01a/class/FlupdoCrudMachine.php#L350-L372 |
204,278 | smalldb/libSmalldb | class/FlupdoCrudMachine.php | FlupdoCrudMachine.recalculateSubTree | private function recalculateSubTree($set, $left, $depth, $q_table, $c_order_by, $c_id, $c_parent_id, $c_left, $c_right, $c_depth)
{
foreach($set as $row) {
$id = $row['id'];
$this->flupdo->update($q_table)
->set("$c_left = ?", $left)
->set("$c_depth = ?", $depth)
->where("$c_id = ?", $id)
-... | php | private function recalculateSubTree($set, $left, $depth, $q_table, $c_order_by, $c_id, $c_parent_id, $c_left, $c_right, $c_depth)
{
foreach($set as $row) {
$id = $row['id'];
$this->flupdo->update($q_table)
->set("$c_left = ?", $left)
->set("$c_depth = ?", $depth)
->where("$c_id = ?", $id)
-... | [
"private",
"function",
"recalculateSubTree",
"(",
"$",
"set",
",",
"$",
"left",
",",
"$",
"depth",
",",
"$",
"q_table",
",",
"$",
"c_order_by",
",",
"$",
"c_id",
",",
"$",
"c_parent_id",
",",
"$",
"c_left",
",",
"$",
"c_right",
",",
"$",
"c_depth",
"... | Recalculate given subtree.
@see recalculateTree() | [
"Recalculate",
"given",
"subtree",
"."
] | b94d22af5014e8060d0530fc7043768cdc57b01a | https://github.com/smalldb/libSmalldb/blob/b94d22af5014e8060d0530fc7043768cdc57b01a/class/FlupdoCrudMachine.php#L380-L408 |
204,279 | Etenil/assegai | src/assegai/modules/mustache/MustacheEngine.php | MustacheEngine._setOptions | protected function _setOptions(array $options) {
if (isset($options['escape'])) {
if (!is_callable($options['escape'])) {
throw new InvalidArgumentException('Mustache constructor "escape" option must be callable');
}
$this->_escape = $options['escape'];
}
if (isset($options['charset'])) {
$this->... | php | protected function _setOptions(array $options) {
if (isset($options['escape'])) {
if (!is_callable($options['escape'])) {
throw new InvalidArgumentException('Mustache constructor "escape" option must be callable');
}
$this->_escape = $options['escape'];
}
if (isset($options['charset'])) {
$this->... | [
"protected",
"function",
"_setOptions",
"(",
"array",
"$",
"options",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"options",
"[",
"'escape'",
"]",
")",
")",
"{",
"if",
"(",
"!",
"is_callable",
"(",
"$",
"options",
"[",
"'escape'",
"]",
")",
")",
"{",
"... | Helper function for setting options from constructor args.
@access protected
@param array $options
@return void | [
"Helper",
"function",
"for",
"setting",
"options",
"from",
"constructor",
"args",
"."
] | d43cce1a88f1c332f60dd0a4374b17764852af9e | https://github.com/Etenil/assegai/blob/d43cce1a88f1c332f60dd0a4374b17764852af9e/src/assegai/modules/mustache/MustacheEngine.php#L140-L175 |
204,280 | Etenil/assegai | src/assegai/modules/mustache/MustacheEngine.php | MustacheEngine.render | public function render($template = null, $view = null, $partials = null) {
if ($template === null) $template = $this->_template;
if ($partials !== null) $this->_partials = $partials;
$otag_orig = $this->_otag;
$ctag_orig = $this->_ctag;
// Including server properties in the view
//$view = arra... | php | public function render($template = null, $view = null, $partials = null) {
if ($template === null) $template = $this->_template;
if ($partials !== null) $this->_partials = $partials;
$otag_orig = $this->_otag;
$ctag_orig = $this->_ctag;
// Including server properties in the view
//$view = arra... | [
"public",
"function",
"render",
"(",
"$",
"template",
"=",
"null",
",",
"$",
"view",
"=",
"null",
",",
"$",
"partials",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"template",
"===",
"null",
")",
"$",
"template",
"=",
"$",
"this",
"->",
"_template",
";"... | Render the given template and view object.
Defaults to the template and view passed to the class constructor unless a new one is provided.
Optionally, pass an associative array of partials as well.
@access public
@param string $template (default: null)
@param mixed $view (default: null)
@param array $partials (defaul... | [
"Render",
"the",
"given",
"template",
"and",
"view",
"object",
"."
] | d43cce1a88f1c332f60dd0a4374b17764852af9e | https://github.com/Etenil/assegai/blob/d43cce1a88f1c332f60dd0a4374b17764852af9e/src/assegai/modules/mustache/MustacheEngine.php#L211-L235 |
204,281 | Etenil/assegai | src/assegai/modules/mustache/MustacheEngine.php | MustacheEngine._renderTemplate | protected function _renderTemplate($template) {
if ($section = $this->_findSection($template)) {
list($before, $type, $tag_name, $content, $after) = $section;
$rendered_before = $this->_renderTags($before);
$rendered_content = '';
$val = $this->_getVariable($tag_name);
switch($type) {
// inverted... | php | protected function _renderTemplate($template) {
if ($section = $this->_findSection($template)) {
list($before, $type, $tag_name, $content, $after) = $section;
$rendered_before = $this->_renderTags($before);
$rendered_content = '';
$val = $this->_getVariable($tag_name);
switch($type) {
// inverted... | [
"protected",
"function",
"_renderTemplate",
"(",
"$",
"template",
")",
"{",
"if",
"(",
"$",
"section",
"=",
"$",
"this",
"->",
"_findSection",
"(",
"$",
"template",
")",
")",
"{",
"list",
"(",
"$",
"before",
",",
"$",
"type",
",",
"$",
"tag_name",
",... | Internal render function, used for recursive calls.
@access protected
@param string $template
@return string Rendered Mustache template. | [
"Internal",
"render",
"function",
"used",
"for",
"recursive",
"calls",
"."
] | d43cce1a88f1c332f60dd0a4374b17764852af9e | https://github.com/Etenil/assegai/blob/d43cce1a88f1c332f60dd0a4374b17764852af9e/src/assegai/modules/mustache/MustacheEngine.php#L261-L304 |
204,282 | Etenil/assegai | src/assegai/modules/mustache/MustacheEngine.php | MustacheEngine._renderPragmas | protected function _renderPragmas($template) {
$this->_localPragmas = $this->_pragmas;
// no pragmas
if (strpos($template, $this->_otag . '%') === false) {
return $template;
}
$regEx = $this->_preparePragmaRegEx($this->_otag, $this->_ctag);
return preg_replace_callback($regEx, array($this, '_renderPrag... | php | protected function _renderPragmas($template) {
$this->_localPragmas = $this->_pragmas;
// no pragmas
if (strpos($template, $this->_otag . '%') === false) {
return $template;
}
$regEx = $this->_preparePragmaRegEx($this->_otag, $this->_ctag);
return preg_replace_callback($regEx, array($this, '_renderPrag... | [
"protected",
"function",
"_renderPragmas",
"(",
"$",
"template",
")",
"{",
"$",
"this",
"->",
"_localPragmas",
"=",
"$",
"this",
"->",
"_pragmas",
";",
"// no pragmas",
"if",
"(",
"strpos",
"(",
"$",
"template",
",",
"$",
"this",
"->",
"_otag",
".",
"'%'... | Initialize pragmas and remove all pragma tags.
@access protected
@param string $template
@return string | [
"Initialize",
"pragmas",
"and",
"remove",
"all",
"pragma",
"tags",
"."
] | d43cce1a88f1c332f60dd0a4374b17764852af9e | https://github.com/Etenil/assegai/blob/d43cce1a88f1c332f60dd0a4374b17764852af9e/src/assegai/modules/mustache/MustacheEngine.php#L417-L427 |
204,283 | Etenil/assegai | src/assegai/modules/mustache/MustacheEngine.php | MustacheEngine._hasPragma | protected function _hasPragma($pragma_name) {
if (array_key_exists($pragma_name, $this->_localPragmas) && $this->_localPragmas[$pragma_name]) {
return true;
} else {
return false;
}
} | php | protected function _hasPragma($pragma_name) {
if (array_key_exists($pragma_name, $this->_localPragmas) && $this->_localPragmas[$pragma_name]) {
return true;
} else {
return false;
}
} | [
"protected",
"function",
"_hasPragma",
"(",
"$",
"pragma_name",
")",
"{",
"if",
"(",
"array_key_exists",
"(",
"$",
"pragma_name",
",",
"$",
"this",
"->",
"_localPragmas",
")",
"&&",
"$",
"this",
"->",
"_localPragmas",
"[",
"$",
"pragma_name",
"]",
")",
"{"... | Check whether this Mustache has a specific pragma.
@access protected
@param string $pragma_name
@return bool | [
"Check",
"whether",
"this",
"Mustache",
"has",
"a",
"specific",
"pragma",
"."
] | d43cce1a88f1c332f60dd0a4374b17764852af9e | https://github.com/Etenil/assegai/blob/d43cce1a88f1c332f60dd0a4374b17764852af9e/src/assegai/modules/mustache/MustacheEngine.php#L474-L480 |
204,284 | Etenil/assegai | src/assegai/modules/mustache/MustacheEngine.php | MustacheEngine._getPragmaOptions | protected function _getPragmaOptions($pragma_name) {
if (!$this->_hasPragma($pragma_name)) {
if ($this->_throwsException(MustacheException::UNKNOWN_PRAGMA)) {
throw new MustacheException('Unknown pragma: ' . $pragma_name, MustacheException::UNKNOWN_PRAGMA);
}
}
return (is_array($this->_localPragmas[$pr... | php | protected function _getPragmaOptions($pragma_name) {
if (!$this->_hasPragma($pragma_name)) {
if ($this->_throwsException(MustacheException::UNKNOWN_PRAGMA)) {
throw new MustacheException('Unknown pragma: ' . $pragma_name, MustacheException::UNKNOWN_PRAGMA);
}
}
return (is_array($this->_localPragmas[$pr... | [
"protected",
"function",
"_getPragmaOptions",
"(",
"$",
"pragma_name",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"_hasPragma",
"(",
"$",
"pragma_name",
")",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"_throwsException",
"(",
"MustacheException",
"::",
"UNK... | Return pragma options, if any.
@access protected
@param string $pragma_name
@return mixed
@throws MustacheException Unknown pragma | [
"Return",
"pragma",
"options",
"if",
"any",
"."
] | d43cce1a88f1c332f60dd0a4374b17764852af9e | https://github.com/Etenil/assegai/blob/d43cce1a88f1c332f60dd0a4374b17764852af9e/src/assegai/modules/mustache/MustacheEngine.php#L490-L498 |
204,285 | Etenil/assegai | src/assegai/modules/mustache/MustacheEngine.php | MustacheEngine._renderTags | protected function _renderTags($template) {
if (strpos($template, $this->_otag) === false) {
return $template;
}
$first = true;
$this->_tagRegEx = $this->_prepareTagRegEx($this->_otag, $this->_ctag, true);
$html = '';
$matches = array();
while (preg_match($this->_tagRegEx, $template, $matches, PREG_O... | php | protected function _renderTags($template) {
if (strpos($template, $this->_otag) === false) {
return $template;
}
$first = true;
$this->_tagRegEx = $this->_prepareTagRegEx($this->_otag, $this->_ctag, true);
$html = '';
$matches = array();
while (preg_match($this->_tagRegEx, $template, $matches, PREG_O... | [
"protected",
"function",
"_renderTags",
"(",
"$",
"template",
")",
"{",
"if",
"(",
"strpos",
"(",
"$",
"template",
",",
"$",
"this",
"->",
"_otag",
")",
"===",
"false",
")",
"{",
"return",
"$",
"template",
";",
"}",
"$",
"first",
"=",
"true",
";",
... | Loop through and render individual Mustache tags.
@access protected
@param string $template
@return void | [
"Loop",
"through",
"and",
"render",
"individual",
"Mustache",
"tags",
"."
] | d43cce1a88f1c332f60dd0a4374b17764852af9e | https://github.com/Etenil/assegai/blob/d43cce1a88f1c332f60dd0a4374b17764852af9e/src/assegai/modules/mustache/MustacheEngine.php#L538-L583 |
204,286 | Etenil/assegai | src/assegai/modules/mustache/MustacheEngine.php | MustacheEngine._renderTag | protected function _renderTag($modifier, $tag_name, $leading, $trailing) {
switch ($modifier) {
case '=':
return $this->_changeDelimiter($tag_name, $leading, $trailing);
break;
case '!':
return $this->_renderComment($tag_name, $leading, $trailing);
break;
case '>':
case '<':
return $th... | php | protected function _renderTag($modifier, $tag_name, $leading, $trailing) {
switch ($modifier) {
case '=':
return $this->_changeDelimiter($tag_name, $leading, $trailing);
break;
case '!':
return $this->_renderComment($tag_name, $leading, $trailing);
break;
case '>':
case '<':
return $th... | [
"protected",
"function",
"_renderTag",
"(",
"$",
"modifier",
",",
"$",
"tag_name",
",",
"$",
"leading",
",",
"$",
"trailing",
")",
"{",
"switch",
"(",
"$",
"modifier",
")",
"{",
"case",
"'='",
":",
"return",
"$",
"this",
"->",
"_changeDelimiter",
"(",
... | Render the named tag, given the specified modifier.
Accepted modifiers are `=` (change delimiter), `!` (comment), `>` (partial)
`{` or `&` (don't escape output), or none (render escaped output).
@access protected
@param string $modifier
@param string $tag_name
@param string $leading Whitespace
@param string $trailing... | [
"Render",
"the",
"named",
"tag",
"given",
"the",
"specified",
"modifier",
"."
] | d43cce1a88f1c332f60dd0a4374b17764852af9e | https://github.com/Etenil/assegai/blob/d43cce1a88f1c332f60dd0a4374b17764852af9e/src/assegai/modules/mustache/MustacheEngine.php#L599-L640 |
204,287 | Etenil/assegai | src/assegai/modules/mustache/MustacheEngine.php | MustacheEngine._stringHasR | protected function _stringHasR($str) {
foreach (func_get_args() as $arg) {
if (strpos($arg, "\r") !== false) {
return true;
}
}
return false;
} | php | protected function _stringHasR($str) {
foreach (func_get_args() as $arg) {
if (strpos($arg, "\r") !== false) {
return true;
}
}
return false;
} | [
"protected",
"function",
"_stringHasR",
"(",
"$",
"str",
")",
"{",
"foreach",
"(",
"func_get_args",
"(",
")",
"as",
"$",
"arg",
")",
"{",
"if",
"(",
"strpos",
"(",
"$",
"arg",
",",
"\"\\r\"",
")",
"!==",
"false",
")",
"{",
"return",
"true",
";",
"}... | Returns true if any of its args contains the "\r" character.
@access protected
@param string $str
@return boolean | [
"Returns",
"true",
"if",
"any",
"of",
"its",
"args",
"contains",
"the",
"\\",
"r",
"character",
"."
] | d43cce1a88f1c332f60dd0a4374b17764852af9e | https://github.com/Etenil/assegai/blob/d43cce1a88f1c332f60dd0a4374b17764852af9e/src/assegai/modules/mustache/MustacheEngine.php#L649-L656 |
204,288 | Etenil/assegai | src/assegai/modules/mustache/MustacheEngine.php | MustacheEngine._renderEscaped | protected function _renderEscaped($tag_name, $leading, $trailing) {
$value = $this->_renderUnescaped($tag_name, '', '');
if (isset($this->_escape)) {
$rendered = call_user_func($this->_escape, $value);
} else {
$rendered = htmlentities($value, ENT_COMPAT, $this->_charset);
}
return $leading . $rendered... | php | protected function _renderEscaped($tag_name, $leading, $trailing) {
$value = $this->_renderUnescaped($tag_name, '', '');
if (isset($this->_escape)) {
$rendered = call_user_func($this->_escape, $value);
} else {
$rendered = htmlentities($value, ENT_COMPAT, $this->_charset);
}
return $leading . $rendered... | [
"protected",
"function",
"_renderEscaped",
"(",
"$",
"tag_name",
",",
"$",
"leading",
",",
"$",
"trailing",
")",
"{",
"$",
"value",
"=",
"$",
"this",
"->",
"_renderUnescaped",
"(",
"$",
"tag_name",
",",
"''",
",",
"''",
")",
";",
"if",
"(",
"isset",
... | Escape and return the requested tag.
@access protected
@param string $tag_name
@param string $leading Whitespace
@param string $trailing Whitespace
@return string | [
"Escape",
"and",
"return",
"the",
"requested",
"tag",
"."
] | d43cce1a88f1c332f60dd0a4374b17764852af9e | https://github.com/Etenil/assegai/blob/d43cce1a88f1c332f60dd0a4374b17764852af9e/src/assegai/modules/mustache/MustacheEngine.php#L667-L676 |
204,289 | Etenil/assegai | src/assegai/modules/mustache/MustacheEngine.php | MustacheEngine._renderUnescaped | protected function _renderUnescaped($tag_name, $leading, $trailing) {
$val = $this->_getVariable($tag_name);
if ($this->_varIsCallable($val)) {
$val = $this->_renderTemplate(call_user_func($val));
}
return $leading . $val . $trailing;
} | php | protected function _renderUnescaped($tag_name, $leading, $trailing) {
$val = $this->_getVariable($tag_name);
if ($this->_varIsCallable($val)) {
$val = $this->_renderTemplate(call_user_func($val));
}
return $leading . $val . $trailing;
} | [
"protected",
"function",
"_renderUnescaped",
"(",
"$",
"tag_name",
",",
"$",
"leading",
",",
"$",
"trailing",
")",
"{",
"$",
"val",
"=",
"$",
"this",
"->",
"_getVariable",
"(",
"$",
"tag_name",
")",
";",
"if",
"(",
"$",
"this",
"->",
"_varIsCallable",
... | Return the requested tag unescaped.
@access protected
@param string $tag_name
@param string $leading Whitespace
@param string $trailing Whitespace
@return string | [
"Return",
"the",
"requested",
"tag",
"unescaped",
"."
] | d43cce1a88f1c332f60dd0a4374b17764852af9e | https://github.com/Etenil/assegai/blob/d43cce1a88f1c332f60dd0a4374b17764852af9e/src/assegai/modules/mustache/MustacheEngine.php#L706-L714 |
204,290 | Etenil/assegai | src/assegai/modules/mustache/MustacheEngine.php | MustacheEngine._renderPartial | protected function _renderPartial($tag_name, $leading, $trailing) {
$partial = $this->_getPartial($tag_name);
if ($leading !== null && $trailing !== null) {
$whitespace = trim($leading, "\r\n");
$partial = preg_replace('/(\\r?\\n)(?!$)/s', "\\1" . $whitespace, $partial);
}
$view = clone($this);
if ($l... | php | protected function _renderPartial($tag_name, $leading, $trailing) {
$partial = $this->_getPartial($tag_name);
if ($leading !== null && $trailing !== null) {
$whitespace = trim($leading, "\r\n");
$partial = preg_replace('/(\\r?\\n)(?!$)/s', "\\1" . $whitespace, $partial);
}
$view = clone($this);
if ($l... | [
"protected",
"function",
"_renderPartial",
"(",
"$",
"tag_name",
",",
"$",
"leading",
",",
"$",
"trailing",
")",
"{",
"$",
"partial",
"=",
"$",
"this",
"->",
"_getPartial",
"(",
"$",
"tag_name",
")",
";",
"if",
"(",
"$",
"leading",
"!==",
"null",
"&&",... | Render the requested partial.
@access protected
@param string $tag_name
@param string $leading Whitespace
@param string $trailing Whitespace
@return string | [
"Render",
"the",
"requested",
"partial",
"."
] | d43cce1a88f1c332f60dd0a4374b17764852af9e | https://github.com/Etenil/assegai/blob/d43cce1a88f1c332f60dd0a4374b17764852af9e/src/assegai/modules/mustache/MustacheEngine.php#L725-L739 |
204,291 | Etenil/assegai | src/assegai/modules/mustache/MustacheEngine.php | MustacheEngine._changeDelimiter | protected function _changeDelimiter($tag_name, $leading, $trailing) {
list($otag, $ctag) = explode(' ', $tag_name);
$this->_otag = $otag;
$this->_ctag = $ctag;
$this->_tagRegEx = $this->_prepareTagRegEx($this->_otag, $this->_ctag);
if ($leading !== null && $trailing !== null) {
if (strpos($leading, "\n")... | php | protected function _changeDelimiter($tag_name, $leading, $trailing) {
list($otag, $ctag) = explode(' ', $tag_name);
$this->_otag = $otag;
$this->_ctag = $ctag;
$this->_tagRegEx = $this->_prepareTagRegEx($this->_otag, $this->_ctag);
if ($leading !== null && $trailing !== null) {
if (strpos($leading, "\n")... | [
"protected",
"function",
"_changeDelimiter",
"(",
"$",
"tag_name",
",",
"$",
"leading",
",",
"$",
"trailing",
")",
"{",
"list",
"(",
"$",
"otag",
",",
"$",
"ctag",
")",
"=",
"explode",
"(",
"' '",
",",
"$",
"tag_name",
")",
";",
"$",
"this",
"->",
... | Change the Mustache tag delimiter. This method also replaces this object's current
tag RegEx with one using the new delimiters.
@access protected
@param string $tag_name
@param string $leading Whitespace
@param string $trailing Whitespace
@return string | [
"Change",
"the",
"Mustache",
"tag",
"delimiter",
".",
"This",
"method",
"also",
"replaces",
"this",
"object",
"s",
"current",
"tag",
"RegEx",
"with",
"one",
"using",
"the",
"new",
"delimiters",
"."
] | d43cce1a88f1c332f60dd0a4374b17764852af9e | https://github.com/Etenil/assegai/blob/d43cce1a88f1c332f60dd0a4374b17764852af9e/src/assegai/modules/mustache/MustacheEngine.php#L751-L765 |
204,292 | Etenil/assegai | src/assegai/modules/mustache/MustacheEngine.php | MustacheEngine._pushContext | protected function _pushContext(&$local_context) {
$new = array();
$new[] =& $local_context;
foreach (array_keys($this->_context) as $key) {
$new[] =& $this->_context[$key];
}
$this->_context = $new;
} | php | protected function _pushContext(&$local_context) {
$new = array();
$new[] =& $local_context;
foreach (array_keys($this->_context) as $key) {
$new[] =& $this->_context[$key];
}
$this->_context = $new;
} | [
"protected",
"function",
"_pushContext",
"(",
"&",
"$",
"local_context",
")",
"{",
"$",
"new",
"=",
"array",
"(",
")",
";",
"$",
"new",
"[",
"]",
"=",
"&",
"$",
"local_context",
";",
"foreach",
"(",
"array_keys",
"(",
"$",
"this",
"->",
"_context",
"... | Push a local context onto the stack.
@access protected
@param array &$local_context
@return void | [
"Push",
"a",
"local",
"context",
"onto",
"the",
"stack",
"."
] | d43cce1a88f1c332f60dd0a4374b17764852af9e | https://github.com/Etenil/assegai/blob/d43cce1a88f1c332f60dd0a4374b17764852af9e/src/assegai/modules/mustache/MustacheEngine.php#L774-L781 |
204,293 | Etenil/assegai | src/assegai/modules/mustache/MustacheEngine.php | MustacheEngine._popContext | protected function _popContext() {
$new = array();
$keys = array_keys($this->_context);
array_shift($keys);
foreach ($keys as $key) {
$new[] =& $this->_context[$key];
}
$this->_context = $new;
} | php | protected function _popContext() {
$new = array();
$keys = array_keys($this->_context);
array_shift($keys);
foreach ($keys as $key) {
$new[] =& $this->_context[$key];
}
$this->_context = $new;
} | [
"protected",
"function",
"_popContext",
"(",
")",
"{",
"$",
"new",
"=",
"array",
"(",
")",
";",
"$",
"keys",
"=",
"array_keys",
"(",
"$",
"this",
"->",
"_context",
")",
";",
"array_shift",
"(",
"$",
"keys",
")",
";",
"foreach",
"(",
"$",
"keys",
"a... | Remove the latest context from the stack.
@access protected
@return void | [
"Remove",
"the",
"latest",
"context",
"from",
"the",
"stack",
"."
] | d43cce1a88f1c332f60dd0a4374b17764852af9e | https://github.com/Etenil/assegai/blob/d43cce1a88f1c332f60dd0a4374b17764852af9e/src/assegai/modules/mustache/MustacheEngine.php#L789-L798 |
204,294 | Etenil/assegai | src/assegai/modules/mustache/MustacheEngine.php | MustacheEngine._getVariable | protected function _getVariable($tag_name) {
if ($tag_name === '.') {
return $this->_context[0];
} else if (strpos($tag_name, '.') !== false) {
$chunks = explode('.', $tag_name);
$first = array_shift($chunks);
$ret = $this->_findVariableInContext($first, $this->_context);
foreach ($chunks as $next) ... | php | protected function _getVariable($tag_name) {
if ($tag_name === '.') {
return $this->_context[0];
} else if (strpos($tag_name, '.') !== false) {
$chunks = explode('.', $tag_name);
$first = array_shift($chunks);
$ret = $this->_findVariableInContext($first, $this->_context);
foreach ($chunks as $next) ... | [
"protected",
"function",
"_getVariable",
"(",
"$",
"tag_name",
")",
"{",
"if",
"(",
"$",
"tag_name",
"===",
"'.'",
")",
"{",
"return",
"$",
"this",
"->",
"_context",
"[",
"0",
"]",
";",
"}",
"else",
"if",
"(",
"strpos",
"(",
"$",
"tag_name",
",",
"... | Get a variable from the context array.
If the view is an array, returns the value with array key $tag_name.
If the view is an object, this will check for a public member variable
named $tag_name. If none is available, this method will execute and return
any class method named $tag_name. Failing all of the above, this ... | [
"Get",
"a",
"variable",
"from",
"the",
"context",
"array",
"."
] | d43cce1a88f1c332f60dd0a4374b17764852af9e | https://github.com/Etenil/assegai/blob/d43cce1a88f1c332f60dd0a4374b17764852af9e/src/assegai/modules/mustache/MustacheEngine.php#L814-L831 |
204,295 | Etenil/assegai | src/assegai/modules/mustache/MustacheEngine.php | MustacheEngine._getPartial | protected function _getPartial($tag_name) {
if ((is_array($this->_partials) || $this->_partials instanceof ArrayAccess) && isset($this->_partials[$tag_name])) {
return $this->_partials[$tag_name];
} else {
$partial_file = $this->server->getRelAppPath('views/' . $tag_name . '.tpl');
if(fil... | php | protected function _getPartial($tag_name) {
if ((is_array($this->_partials) || $this->_partials instanceof ArrayAccess) && isset($this->_partials[$tag_name])) {
return $this->_partials[$tag_name];
} else {
$partial_file = $this->server->getRelAppPath('views/' . $tag_name . '.tpl');
if(fil... | [
"protected",
"function",
"_getPartial",
"(",
"$",
"tag_name",
")",
"{",
"if",
"(",
"(",
"is_array",
"(",
"$",
"this",
"->",
"_partials",
")",
"||",
"$",
"this",
"->",
"_partials",
"instanceof",
"ArrayAccess",
")",
"&&",
"isset",
"(",
"$",
"this",
"->",
... | Retrieve the partial corresponding to the requested tag name.
Silently fails (i.e. returns '') when the requested partial is not found.
@access protected
@param string $tag_name
@throws MustacheException Unknown partial name.
@return string | [
"Retrieve",
"the",
"partial",
"corresponding",
"to",
"the",
"requested",
"tag",
"name",
"."
] | d43cce1a88f1c332f60dd0a4374b17764852af9e | https://github.com/Etenil/assegai/blob/d43cce1a88f1c332f60dd0a4374b17764852af9e/src/assegai/modules/mustache/MustacheEngine.php#L873-L888 |
204,296 | slickframework/form | src/Input/AbstractInput.php | AbstractInput.setName | public function setName($name)
{
$attrName = $this->isMultiple()
? "{$name}[]"
: $name;
$this->setAttribute('name', $attrName);
$this->name = $name;
if ($label = $this->getLabel()) {
$this->getLabel()->setAttribute('for', $this->generateId());
... | php | public function setName($name)
{
$attrName = $this->isMultiple()
? "{$name}[]"
: $name;
$this->setAttribute('name', $attrName);
$this->name = $name;
if ($label = $this->getLabel()) {
$this->getLabel()->setAttribute('for', $this->generateId());
... | [
"public",
"function",
"setName",
"(",
"$",
"name",
")",
"{",
"$",
"attrName",
"=",
"$",
"this",
"->",
"isMultiple",
"(",
")",
"?",
"\"{$name}[]\"",
":",
"$",
"name",
";",
"$",
"this",
"->",
"setAttribute",
"(",
"'name'",
",",
"$",
"attrName",
")",
";... | Sets input name
@param string $name
@return self|$this|InputInterface|AbstractInput | [
"Sets",
"input",
"name"
] | e7d536b3bad49194e246ff93587da2589e31a003 | https://github.com/slickframework/form/blob/e7d536b3bad49194e246ff93587da2589e31a003/src/Input/AbstractInput.php#L86-L97 |
204,297 | slickframework/form | src/Input/AbstractInput.php | AbstractInput.setLabel | public function setLabel($label)
{
$this->label = $this->checkLabel($label);
$class = $this->label->getAttribute('class');
$this->label->setAttribute('for', $this->generateId())
->setAttribute('class', trim("control-label {$class}"));
return $this;
} | php | public function setLabel($label)
{
$this->label = $this->checkLabel($label);
$class = $this->label->getAttribute('class');
$this->label->setAttribute('for', $this->generateId())
->setAttribute('class', trim("control-label {$class}"));
return $this;
} | [
"public",
"function",
"setLabel",
"(",
"$",
"label",
")",
"{",
"$",
"this",
"->",
"label",
"=",
"$",
"this",
"->",
"checkLabel",
"(",
"$",
"label",
")",
";",
"$",
"class",
"=",
"$",
"this",
"->",
"label",
"->",
"getAttribute",
"(",
"'class'",
")",
... | Sets the input label
Label parameter can be a string or a element interface.
If a string is provided then an ElementInterface MUST be created.
This element MUST result in a <label> HTML tag when rendering and
as you may define your own implementation it is advisable that you
use the Slick\Form\Element\Label object.
@... | [
"Sets",
"the",
"input",
"label"
] | e7d536b3bad49194e246ff93587da2589e31a003 | https://github.com/slickframework/form/blob/e7d536b3bad49194e246ff93587da2589e31a003/src/Input/AbstractInput.php#L115-L122 |
204,298 | slickframework/form | src/Input/AbstractInput.php | AbstractInput.generateId | protected function generateId()
{
$inputId = static::$idPrefix . $this->getName();
if ($this->isMultiple()) {
$inputId = "{$inputId}-{$this->instances}";
}
$this->setAttribute('id', $inputId);
return $inputId;
} | php | protected function generateId()
{
$inputId = static::$idPrefix . $this->getName();
if ($this->isMultiple()) {
$inputId = "{$inputId}-{$this->instances}";
}
$this->setAttribute('id', $inputId);
return $inputId;
} | [
"protected",
"function",
"generateId",
"(",
")",
"{",
"$",
"inputId",
"=",
"static",
"::",
"$",
"idPrefix",
".",
"$",
"this",
"->",
"getName",
"(",
")",
";",
"if",
"(",
"$",
"this",
"->",
"isMultiple",
"(",
")",
")",
"{",
"$",
"inputId",
"=",
"\"{$... | Generate input id based on provided name
@return string | [
"Generate",
"input",
"id",
"based",
"on",
"provided",
"name"
] | e7d536b3bad49194e246ff93587da2589e31a003 | https://github.com/slickframework/form/blob/e7d536b3bad49194e246ff93587da2589e31a003/src/Input/AbstractInput.php#L161-L169 |
204,299 | slickframework/form | src/Input/AbstractInput.php | AbstractInput.checkLabel | protected function checkLabel($label)
{
if ($label instanceof ElementInterface) {
return $label;
}
return $this->createLabel($this->translate($label));
} | php | protected function checkLabel($label)
{
if ($label instanceof ElementInterface) {
return $label;
}
return $this->createLabel($this->translate($label));
} | [
"protected",
"function",
"checkLabel",
"(",
"$",
"label",
")",
"{",
"if",
"(",
"$",
"label",
"instanceof",
"ElementInterface",
")",
"{",
"return",
"$",
"label",
";",
"}",
"return",
"$",
"this",
"->",
"createLabel",
"(",
"$",
"this",
"->",
"translate",
"(... | Check provided label
@param string|ElementInterface $label
@return ElementInterface|Label | [
"Check",
"provided",
"label"
] | e7d536b3bad49194e246ff93587da2589e31a003 | https://github.com/slickframework/form/blob/e7d536b3bad49194e246ff93587da2589e31a003/src/Input/AbstractInput.php#L178-L185 |
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.