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,100 | hal-platform/hal-core | src/Repository/ApplicationRepository.php | ApplicationRepository.getGroupedApplications | public function getGroupedApplications()
{
$organizations = $this->getEntityManager()
->getRepository(Organization::class)
->findAll();
$applications = $this->findAll();
usort($applications, $this->applicationSorter());
usort($organizations, $this->organizat... | php | public function getGroupedApplications()
{
$organizations = $this->getEntityManager()
->getRepository(Organization::class)
->findAll();
$applications = $this->findAll();
usort($applications, $this->applicationSorter());
usort($organizations, $this->organizat... | [
"public",
"function",
"getGroupedApplications",
"(",
")",
"{",
"$",
"organizations",
"=",
"$",
"this",
"->",
"getEntityManager",
"(",
")",
"->",
"getRepository",
"(",
"Organization",
"::",
"class",
")",
"->",
"findAll",
"(",
")",
";",
"$",
"applications",
"=... | Get all applications sorted into organizations.
@return array | [
"Get",
"all",
"applications",
"sorted",
"into",
"organizations",
"."
] | 30d456f8392fc873301ad4217d2ae90436c67090 | https://github.com/hal-platform/hal-core/blob/30d456f8392fc873301ad4217d2ae90436c67090/src/Repository/ApplicationRepository.php#L33-L55 |
204,101 | rujiali/acquia-site-factory-cli | src/AppBundle/Connector/ConnectorThemes.php | ConnectorThemes.sendNotification | public function sendNotification($scope, $event, $nid = null, $theme = null, $timestamp = null, $uid = null)
{
if ($this->connector->getURL() === null) {
return 'Cannot find site URL from configuration.';
}
$url = $this->connector->getURL().self::VERSION.'/notification';
... | php | public function sendNotification($scope, $event, $nid = null, $theme = null, $timestamp = null, $uid = null)
{
if ($this->connector->getURL() === null) {
return 'Cannot find site URL from configuration.';
}
$url = $this->connector->getURL().self::VERSION.'/notification';
... | [
"public",
"function",
"sendNotification",
"(",
"$",
"scope",
",",
"$",
"event",
",",
"$",
"nid",
"=",
"null",
",",
"$",
"theme",
"=",
"null",
",",
"$",
"timestamp",
"=",
"null",
",",
"$",
"uid",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"this",
"->"... | Send theme notification.
@param string $scope The scope.
@param string $event The event.
@param null $nid The node ID of the related entity (site or group).
@param null $theme The system name of the theme.
@param null $timestamp A Unix timestamp of when the event occurred.
@param null $uid ... | [
"Send",
"theme",
"notification",
"."
] | c9dbb9dfd71408adff0ea26db94678a61c584df6 | https://github.com/rujiali/acquia-site-factory-cli/blob/c9dbb9dfd71408adff0ea26db94678a61c584df6/src/AppBundle/Connector/ConnectorThemes.php#L40-L60 |
204,102 | rujiali/acquia-site-factory-cli | src/AppBundle/Connector/ConnectorThemes.php | ConnectorThemes.processModification | public function processModification($siteGroupId = null)
{
if ($this->connector->getURL() === null) {
return 'Cannot find site URL from configuration.';
}
$url = $this->connector->getURL().self::VERSION.'/process';
$params = [
'sitegroup_id' => $siteGroupId,
... | php | public function processModification($siteGroupId = null)
{
if ($this->connector->getURL() === null) {
return 'Cannot find site URL from configuration.';
}
$url = $this->connector->getURL().self::VERSION.'/process';
$params = [
'sitegroup_id' => $siteGroupId,
... | [
"public",
"function",
"processModification",
"(",
"$",
"siteGroupId",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"connector",
"->",
"getURL",
"(",
")",
"===",
"null",
")",
"{",
"return",
"'Cannot find site URL from configuration.'",
";",
"}",
"$",
... | Process theme modification.
@param string $siteGroupId Site group ID.
@return mixed|string | [
"Process",
"theme",
"modification",
"."
] | c9dbb9dfd71408adff0ea26db94678a61c584df6 | https://github.com/rujiali/acquia-site-factory-cli/blob/c9dbb9dfd71408adff0ea26db94678a61c584df6/src/AppBundle/Connector/ConnectorThemes.php#L69-L84 |
204,103 | matryoshka-model/matryoshka | library/ResultSet/ArrayObjectResultSet.php | ArrayObjectResultSet.setObjectPrototype | public function setObjectPrototype($objectPrototype)
{
if (!is_object($objectPrototype)
|| (!$objectPrototype instanceof ArrayObject && !method_exists($objectPrototype, 'exchangeArray'))
) {
throw new Exception\InvalidArgumentException(sprintf(
'Object must b... | php | public function setObjectPrototype($objectPrototype)
{
if (!is_object($objectPrototype)
|| (!$objectPrototype instanceof ArrayObject && !method_exists($objectPrototype, 'exchangeArray'))
) {
throw new Exception\InvalidArgumentException(sprintf(
'Object must b... | [
"public",
"function",
"setObjectPrototype",
"(",
"$",
"objectPrototype",
")",
"{",
"if",
"(",
"!",
"is_object",
"(",
"$",
"objectPrototype",
")",
"||",
"(",
"!",
"$",
"objectPrototype",
"instanceof",
"ArrayObject",
"&&",
"!",
"method_exists",
"(",
"$",
"object... | Set the item object prototype
@param object $objectPrototype
@throws Exception\InvalidArgumentException
@return ResultSetInterface | [
"Set",
"the",
"item",
"object",
"prototype"
] | 51792df00d9897f556d5a3c53193eed0974ff09d | https://github.com/matryoshka-model/matryoshka/blob/51792df00d9897f556d5a3c53193eed0974ff09d/library/ResultSet/ArrayObjectResultSet.php#L41-L55 |
204,104 | martinvium/seine | src/Seine/Parser/DOM/DOMFactory.php | DOMFactory.getConfiguredWriter | public function getConfiguredWriter($fp, Configuration $config = null)
{
if(! $config) {
$config = $this->config;
}
$writerName = $config->getOption(Configuration::OPT_WRITER);
if(! $writerName) {
throw new \Exception('Writer must be defined in config... | php | public function getConfiguredWriter($fp, Configuration $config = null)
{
if(! $config) {
$config = $this->config;
}
$writerName = $config->getOption(Configuration::OPT_WRITER);
if(! $writerName) {
throw new \Exception('Writer must be defined in config... | [
"public",
"function",
"getConfiguredWriter",
"(",
"$",
"fp",
",",
"Configuration",
"$",
"config",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"$",
"config",
")",
"{",
"$",
"config",
"=",
"$",
"this",
"->",
"config",
";",
"}",
"$",
"writerName",
"=",
"$",
... | Get a writer configured using the default configuration or the one passed in.
@param stream $fp
@param Configuration $config
@return Writer | [
"Get",
"a",
"writer",
"configured",
"using",
"the",
"default",
"configuration",
"or",
"the",
"one",
"passed",
"in",
"."
] | b361241c88bb73e81c66259f59193b175223c2eb | https://github.com/martinvium/seine/blob/b361241c88bb73e81c66259f59193b175223c2eb/src/Seine/Parser/DOM/DOMFactory.php#L142-L157 |
204,105 | martinvium/seine | src/Seine/Parser/DOM/DOMFactory.php | DOMFactory.getWriterByName | public function getWriterByName($fp, $writerName)
{
$method = 'get' . $writerName;
if(method_exists($this->getWriterFactory(), $method)) {
return $this->getWriterFactory()->$method($fp);
} else {
throw new \InvalidArgumentException('writer not found: ' . $writer... | php | public function getWriterByName($fp, $writerName)
{
$method = 'get' . $writerName;
if(method_exists($this->getWriterFactory(), $method)) {
return $this->getWriterFactory()->$method($fp);
} else {
throw new \InvalidArgumentException('writer not found: ' . $writer... | [
"public",
"function",
"getWriterByName",
"(",
"$",
"fp",
",",
"$",
"writerName",
")",
"{",
"$",
"method",
"=",
"'get'",
".",
"$",
"writerName",
";",
"if",
"(",
"method_exists",
"(",
"$",
"this",
"->",
"getWriterFactory",
"(",
")",
",",
"$",
"method",
"... | Get a writer by it's name. The name is looked up in the writer factory prefixed with "get".
@example $writer = $factory->getWriterByName($fp, 'OfficeOpenXML2003StreamWriter');
@param stream $fp
@param string $writerName
@return Writer | [
"Get",
"a",
"writer",
"by",
"it",
"s",
"name",
".",
"The",
"name",
"is",
"looked",
"up",
"in",
"the",
"writer",
"factory",
"prefixed",
"with",
"get",
"."
] | b361241c88bb73e81c66259f59193b175223c2eb | https://github.com/martinvium/seine/blob/b361241c88bb73e81c66259f59193b175223c2eb/src/Seine/Parser/DOM/DOMFactory.php#L167-L175 |
204,106 | Synapse-Cmf/synapse-cmf | src/Synapse/Admin/Bundle/Controller/ImageAdminController.php | ImageAdminController.editAction | public function editAction(Image $image, Request $request)
{
$form = $this->container->get('form.factory')->createNamed(
'image',
ImageType::class,
$image,
array(
'action' => $this->container->get('router')->generate(
'synap... | php | public function editAction(Image $image, Request $request)
{
$form = $this->container->get('form.factory')->createNamed(
'image',
ImageType::class,
$image,
array(
'action' => $this->container->get('router')->generate(
'synap... | [
"public",
"function",
"editAction",
"(",
"Image",
"$",
"image",
",",
"Request",
"$",
"request",
")",
"{",
"$",
"form",
"=",
"$",
"this",
"->",
"container",
"->",
"get",
"(",
"'form.factory'",
")",
"->",
"createNamed",
"(",
"'image'",
",",
"ImageType",
":... | Image edition action.
@param Request $request
@return Response | [
"Image",
"edition",
"action",
"."
] | d8122a4150a83d5607289724425cf35c56a5e880 | https://github.com/Synapse-Cmf/synapse-cmf/blob/d8122a4150a83d5607289724425cf35c56a5e880/src/Synapse/Admin/Bundle/Controller/ImageAdminController.php#L55-L92 |
204,107 | Synapse-Cmf/synapse-cmf | src/Synapse/Admin/Bundle/Controller/ImageAdminController.php | ImageAdminController.xhrFormatAction | public function xhrFormatAction(Image $image, $formatName, Request $request)
{
// retrieve format value object
if (!$format = $this->container->get('synapse.image_format.loader')
->retrieveOne(array('name' => $formatName))
) {
return new JsonResponse(
... | php | public function xhrFormatAction(Image $image, $formatName, Request $request)
{
// retrieve format value object
if (!$format = $this->container->get('synapse.image_format.loader')
->retrieveOne(array('name' => $formatName))
) {
return new JsonResponse(
... | [
"public",
"function",
"xhrFormatAction",
"(",
"Image",
"$",
"image",
",",
"$",
"formatName",
",",
"Request",
"$",
"request",
")",
"{",
"// retrieve format value object",
"if",
"(",
"!",
"$",
"format",
"=",
"$",
"this",
"->",
"container",
"->",
"get",
"(",
... | Image formating action through XmlHttpRequest.
@param Image $image
@param string $formatName
@param Request $request
@return JsonResponse | [
"Image",
"formating",
"action",
"through",
"XmlHttpRequest",
"."
] | d8122a4150a83d5607289724425cf35c56a5e880 | https://github.com/Synapse-Cmf/synapse-cmf/blob/d8122a4150a83d5607289724425cf35c56a5e880/src/Synapse/Admin/Bundle/Controller/ImageAdminController.php#L103-L147 |
204,108 | symfony2admingenerator/FormBundle | Twig/Extension/FormExtension.php | FormExtension.renderJavascript | public function renderJavascript(FormView $view, $prototype = false)
{
$block = $prototype ? 'js_prototype' : 'js';
return $this->renderer->searchAndRenderBlock($view, $block);
} | php | public function renderJavascript(FormView $view, $prototype = false)
{
$block = $prototype ? 'js_prototype' : 'js';
return $this->renderer->searchAndRenderBlock($view, $block);
} | [
"public",
"function",
"renderJavascript",
"(",
"FormView",
"$",
"view",
",",
"$",
"prototype",
"=",
"false",
")",
"{",
"$",
"block",
"=",
"$",
"prototype",
"?",
"'js_prototype'",
":",
"'js'",
";",
"return",
"$",
"this",
"->",
"renderer",
"->",
"searchAndRe... | Render Function Form Javascript
@param FormView $view
@param bool $prototype
@return string | [
"Render",
"Function",
"Form",
"Javascript"
] | 0f0dbf8f0aecc3332daa959771af611f00b35359 | https://github.com/symfony2admingenerator/FormBundle/blob/0f0dbf8f0aecc3332daa959771af611f00b35359/Twig/Extension/FormExtension.php#L57-L62 |
204,109 | Laralum/Tickets | src/Controllers/MessageController.php | MessageController.confirmDestroy | public function confirmDestroy(Message $message)
{
$this->authorize('delete', $message);
return view('laralum::pages.confirmation', [
'method' => 'DELETE',
'message' => __('laralum_tickets::general.sure_del_message', ['id' => $message->id]),
'action' => route('... | php | public function confirmDestroy(Message $message)
{
$this->authorize('delete', $message);
return view('laralum::pages.confirmation', [
'method' => 'DELETE',
'message' => __('laralum_tickets::general.sure_del_message', ['id' => $message->id]),
'action' => route('... | [
"public",
"function",
"confirmDestroy",
"(",
"Message",
"$",
"message",
")",
"{",
"$",
"this",
"->",
"authorize",
"(",
"'delete'",
",",
"$",
"message",
")",
";",
"return",
"view",
"(",
"'laralum::pages.confirmation'",
",",
"[",
"'method'",
"=>",
"'DELETE'",
... | View for cofirm delete message.
@param \Laralum\Tickets\Models\Message $message
@return \Illuminate\Http\Response | [
"View",
"for",
"cofirm",
"delete",
"message",
"."
] | 834b04e28cc3be285fc0eac1a673f6370079e6d2 | https://github.com/Laralum/Tickets/blob/834b04e28cc3be285fc0eac1a673f6370079e6d2/src/Controllers/MessageController.php#L98-L107 |
204,110 | IftekherSunny/Planet-Framework | src/Sun/Container/Container.php | Container.make | public function make($key, $params = [])
{
if($this->aliasExist($key)) {
return $this->make($this->aliases[$key], $params);
}
if(is_callable($key)) {
return call_user_func_array($key, $this->resolveCallback($key, $params));
}
return $this->... | php | public function make($key, $params = [])
{
if($this->aliasExist($key)) {
return $this->make($this->aliases[$key], $params);
}
if(is_callable($key)) {
return call_user_func_array($key, $this->resolveCallback($key, $params));
}
return $this->... | [
"public",
"function",
"make",
"(",
"$",
"key",
",",
"$",
"params",
"=",
"[",
"]",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"aliasExist",
"(",
"$",
"key",
")",
")",
"{",
"return",
"$",
"this",
"->",
"make",
"(",
"$",
"this",
"->",
"aliases",
"[",... | Resolved dependencies for a key.
@param string $key
@param array $params
@return object
@throws Exception | [
"Resolved",
"dependencies",
"for",
"a",
"key",
"."
] | 530e772fb97695c1c4e1af73f81675f189474d9f | https://github.com/IftekherSunny/Planet-Framework/blob/530e772fb97695c1c4e1af73f81675f189474d9f/src/Sun/Container/Container.php#L38-L49 |
204,111 | IftekherSunny/Planet-Framework | src/Sun/Container/Container.php | Container.need | public function need($key)
{
if(!isset($this->resolved[$key])) {
return $this->make($key);
}
return $this->resolved[$key];
} | php | public function need($key)
{
if(!isset($this->resolved[$key])) {
return $this->make($key);
}
return $this->resolved[$key];
} | [
"public",
"function",
"need",
"(",
"$",
"key",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"resolved",
"[",
"$",
"key",
"]",
")",
")",
"{",
"return",
"$",
"this",
"->",
"make",
"(",
"$",
"key",
")",
";",
"}",
"return",
"$",
"th... | Get the resolved type for a key that already resolved by the container.
If the key does not resolve, at first resolved it,
then returns the resolved type.
@param string $key
@return mixed | [
"Get",
"the",
"resolved",
"type",
"for",
"a",
"key",
"that",
"already",
"resolved",
"by",
"the",
"container",
".",
"If",
"the",
"key",
"does",
"not",
"resolve",
"at",
"first",
"resolved",
"it",
"then",
"returns",
"the",
"resolved",
"type",
"."
] | 530e772fb97695c1c4e1af73f81675f189474d9f | https://github.com/IftekherSunny/Planet-Framework/blob/530e772fb97695c1c4e1af73f81675f189474d9f/src/Sun/Container/Container.php#L60-L67 |
204,112 | IftekherSunny/Planet-Framework | src/Sun/Container/Container.php | Container.bind | public function bind($key, $value)
{
if(is_callable($value)) {
$this->aliases[$key] = $value;
} elseif(is_object($value)) {
$this->resolved[$key] = $value;
} else {
if(class_exists($value)) $this->aliases[$key] = $value;
else throw ne... | php | public function bind($key, $value)
{
if(is_callable($value)) {
$this->aliases[$key] = $value;
} elseif(is_object($value)) {
$this->resolved[$key] = $value;
} else {
if(class_exists($value)) $this->aliases[$key] = $value;
else throw ne... | [
"public",
"function",
"bind",
"(",
"$",
"key",
",",
"$",
"value",
")",
"{",
"if",
"(",
"is_callable",
"(",
"$",
"value",
")",
")",
"{",
"$",
"this",
"->",
"aliases",
"[",
"$",
"key",
"]",
"=",
"$",
"value",
";",
"}",
"elseif",
"(",
"is_object",
... | Bind a value for a key.
@param string $key
@param string|callback|object $value
@throws Exception | [
"Bind",
"a",
"value",
"for",
"a",
"key",
"."
] | 530e772fb97695c1c4e1af73f81675f189474d9f | https://github.com/IftekherSunny/Planet-Framework/blob/530e772fb97695c1c4e1af73f81675f189474d9f/src/Sun/Container/Container.php#L77-L87 |
204,113 | IftekherSunny/Planet-Framework | src/Sun/Container/Container.php | Container.resolveCallback | public function resolveCallback(Closure $callback, $params = [])
{
$reflectionParameter = new ReflectionFunction($callback);
$dependencies = $reflectionParameter->getParameters();
return $this->getDependencies($dependencies, $params);
} | php | public function resolveCallback(Closure $callback, $params = [])
{
$reflectionParameter = new ReflectionFunction($callback);
$dependencies = $reflectionParameter->getParameters();
return $this->getDependencies($dependencies, $params);
} | [
"public",
"function",
"resolveCallback",
"(",
"Closure",
"$",
"callback",
",",
"$",
"params",
"=",
"[",
"]",
")",
"{",
"$",
"reflectionParameter",
"=",
"new",
"ReflectionFunction",
"(",
"$",
"callback",
")",
";",
"$",
"dependencies",
"=",
"$",
"reflectionPar... | Resolve dependencies for a callback.
@param Closure $callback
@param array $params
@return array
@throws Exception | [
"Resolve",
"dependencies",
"for",
"a",
"callback",
"."
] | 530e772fb97695c1c4e1af73f81675f189474d9f | https://github.com/IftekherSunny/Planet-Framework/blob/530e772fb97695c1c4e1af73f81675f189474d9f/src/Sun/Container/Container.php#L99-L106 |
204,114 | IftekherSunny/Planet-Framework | src/Sun/Container/Container.php | Container.resolveMethod | public function resolveMethod($class, $method, $params = [], $isRoute = false)
{
$reflectionMethod = new ReflectionMethod($class, $method);
$dependencies = $reflectionMethod->getParameters();
return $this->getDependencies($dependencies, $params, $isRoute);
} | php | public function resolveMethod($class, $method, $params = [], $isRoute = false)
{
$reflectionMethod = new ReflectionMethod($class, $method);
$dependencies = $reflectionMethod->getParameters();
return $this->getDependencies($dependencies, $params, $isRoute);
} | [
"public",
"function",
"resolveMethod",
"(",
"$",
"class",
",",
"$",
"method",
",",
"$",
"params",
"=",
"[",
"]",
",",
"$",
"isRoute",
"=",
"false",
")",
"{",
"$",
"reflectionMethod",
"=",
"new",
"ReflectionMethod",
"(",
"$",
"class",
",",
"$",
"method"... | Resolve dependencies for a method.
@param string $class
@param string $method
@param array $params
@param bool $isRoute
@return array | [
"Resolve",
"dependencies",
"for",
"a",
"method",
"."
] | 530e772fb97695c1c4e1af73f81675f189474d9f | https://github.com/IftekherSunny/Planet-Framework/blob/530e772fb97695c1c4e1af73f81675f189474d9f/src/Sun/Container/Container.php#L118-L125 |
204,115 | IftekherSunny/Planet-Framework | src/Sun/Container/Container.php | Container.resolveClass | public function resolveClass($name, $params = [])
{
$reflectionClass = new ReflectionClass($name);
if (!$reflectionClass->isInstantiable()) {
throw new Exception("The [ {$name} ] is not instantiable.");
}
$constructor = $reflectionClass->getConstructor();
... | php | public function resolveClass($name, $params = [])
{
$reflectionClass = new ReflectionClass($name);
if (!$reflectionClass->isInstantiable()) {
throw new Exception("The [ {$name} ] is not instantiable.");
}
$constructor = $reflectionClass->getConstructor();
... | [
"public",
"function",
"resolveClass",
"(",
"$",
"name",
",",
"$",
"params",
"=",
"[",
"]",
")",
"{",
"$",
"reflectionClass",
"=",
"new",
"ReflectionClass",
"(",
"$",
"name",
")",
";",
"if",
"(",
"!",
"$",
"reflectionClass",
"->",
"isInstantiable",
"(",
... | Resolve dependencies for a class.
@param string $name
@param array $params
@return object
@throws Exception | [
"Resolve",
"dependencies",
"for",
"a",
"class",
"."
] | 530e772fb97695c1c4e1af73f81675f189474d9f | https://github.com/IftekherSunny/Planet-Framework/blob/530e772fb97695c1c4e1af73f81675f189474d9f/src/Sun/Container/Container.php#L136-L159 |
204,116 | IftekherSunny/Planet-Framework | src/Sun/Container/Container.php | Container.getDependencies | protected function getDependencies($dependencies, $params = [], $isRoute = false)
{
$resolving = [];
foreach ($dependencies as $dependency) {
if ($dependency->isDefaultValueAvailable()) {
$resolving = $this->getDependencyDefaultValue($dependency, $params, $resolvin... | php | protected function getDependencies($dependencies, $params = [], $isRoute = false)
{
$resolving = [];
foreach ($dependencies as $dependency) {
if ($dependency->isDefaultValueAvailable()) {
$resolving = $this->getDependencyDefaultValue($dependency, $params, $resolvin... | [
"protected",
"function",
"getDependencies",
"(",
"$",
"dependencies",
",",
"$",
"params",
"=",
"[",
"]",
",",
"$",
"isRoute",
"=",
"false",
")",
"{",
"$",
"resolving",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"dependencies",
"as",
"$",
"dependency",
")... | Get all required dependencies.
@param string $dependencies
@param array $params
@param bool $isRoute
@return array
@throws Exception | [
"Get",
"all",
"required",
"dependencies",
"."
] | 530e772fb97695c1c4e1af73f81675f189474d9f | https://github.com/IftekherSunny/Planet-Framework/blob/530e772fb97695c1c4e1af73f81675f189474d9f/src/Sun/Container/Container.php#L171-L197 |
204,117 | IftekherSunny/Planet-Framework | src/Sun/Container/Container.php | Container.has | public function has($key)
{
if(array_key_exists($key, $this->aliases) || array_key_exists($key, $this->resolved)) {
return true;
} else {
return false;
}
} | php | public function has($key)
{
if(array_key_exists($key, $this->aliases) || array_key_exists($key, $this->resolved)) {
return true;
} else {
return false;
}
} | [
"public",
"function",
"has",
"(",
"$",
"key",
")",
"{",
"if",
"(",
"array_key_exists",
"(",
"$",
"key",
",",
"$",
"this",
"->",
"aliases",
")",
"||",
"array_key_exists",
"(",
"$",
"key",
",",
"$",
"this",
"->",
"resolved",
")",
")",
"{",
"return",
... | Check a key is already exists.
@param string $key
@return bool | [
"Check",
"a",
"key",
"is",
"already",
"exists",
"."
] | 530e772fb97695c1c4e1af73f81675f189474d9f | https://github.com/IftekherSunny/Planet-Framework/blob/530e772fb97695c1c4e1af73f81675f189474d9f/src/Sun/Container/Container.php#L206-L213 |
204,118 | IftekherSunny/Planet-Framework | src/Sun/Container/Container.php | Container.getDependencyDefaultValue | protected function getDependencyDefaultValue($dependency, $params, $resolving, $isRoute)
{
if ($isRoute) {
if(isset($params[$dependency->name])) {
$resolving[] = $params[$dependency->name];
} else {
$resolving[] = $dependency->getDefaultValue();
... | php | protected function getDependencyDefaultValue($dependency, $params, $resolving, $isRoute)
{
if ($isRoute) {
if(isset($params[$dependency->name])) {
$resolving[] = $params[$dependency->name];
} else {
$resolving[] = $dependency->getDefaultValue();
... | [
"protected",
"function",
"getDependencyDefaultValue",
"(",
"$",
"dependency",
",",
"$",
"params",
",",
"$",
"resolving",
",",
"$",
"isRoute",
")",
"{",
"if",
"(",
"$",
"isRoute",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"params",
"[",
"$",
"dependency",
... | Get dependency default value.
@param $dependency
@param $params
@param $resolving
@param $isRoute
@return array | [
"Get",
"dependency",
"default",
"value",
"."
] | 530e772fb97695c1c4e1af73f81675f189474d9f | https://github.com/IftekherSunny/Planet-Framework/blob/530e772fb97695c1c4e1af73f81675f189474d9f/src/Sun/Container/Container.php#L309-L324 |
204,119 | schpill/thin | src/Html/Cell.php | Cell.cell | public function cell($value, array $attributes = null)
{
$cell = new self;
$cell->setValue($value);
if (null !== $attributes) {
$cell->setAttributes($attributes);
}
return $cell;
} | php | public function cell($value, array $attributes = null)
{
$cell = new self;
$cell->setValue($value);
if (null !== $attributes) {
$cell->setAttributes($attributes);
}
return $cell;
} | [
"public",
"function",
"cell",
"(",
"$",
"value",
",",
"array",
"$",
"attributes",
"=",
"null",
")",
"{",
"$",
"cell",
"=",
"new",
"self",
";",
"$",
"cell",
"->",
"setValue",
"(",
"$",
"value",
")",
";",
"if",
"(",
"null",
"!==",
"$",
"attributes",
... | Generates a new table cell
@param string $value
@param array $attributes
@return FTV_Html_Cell | [
"Generates",
"a",
"new",
"table",
"cell"
] | a9102d9d6f70e8b0f6be93153f70849f46489ee1 | https://github.com/schpill/thin/blob/a9102d9d6f70e8b0f6be93153f70849f46489ee1/src/Html/Cell.php#L77-L87 |
204,120 | Dhii/map | src/IteratorAwareTrait.php | IteratorAwareTrait._getIterator | protected function _getIterator()
{
if (is_null($this->iterator)) {
$this->iterator = $this->_resolveIterator($this->_getDataStore());
}
return $this->iterator;
} | php | protected function _getIterator()
{
if (is_null($this->iterator)) {
$this->iterator = $this->_resolveIterator($this->_getDataStore());
}
return $this->iterator;
} | [
"protected",
"function",
"_getIterator",
"(",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"this",
"->",
"iterator",
")",
")",
"{",
"$",
"this",
"->",
"iterator",
"=",
"$",
"this",
"->",
"_resolveIterator",
"(",
"$",
"this",
"->",
"_getDataStore",
"(",
")... | Retrieves the iterator of this instance's data store.
@since [*next-version*]
@return Iterator The iterator. | [
"Retrieves",
"the",
"iterator",
"of",
"this",
"instance",
"s",
"data",
"store",
"."
] | 9ec82af42b7cb33d3b0b70d753e8a2bc7451cedf | https://github.com/Dhii/map/blob/9ec82af42b7cb33d3b0b70d753e8a2bc7451cedf/src/IteratorAwareTrait.php#L35-L42 |
204,121 | lechimp-p/flightcontrol | src/FDirectory.php | FDirectory.fmap | public function fmap(\Closure $trans) {
return $this->flightcontrol()->newFDirectory($this, function() use ($trans) {
return array_map($trans, $this->fcontents());
});
} | php | public function fmap(\Closure $trans) {
return $this->flightcontrol()->newFDirectory($this, function() use ($trans) {
return array_map($trans, $this->fcontents());
});
} | [
"public",
"function",
"fmap",
"(",
"\\",
"Closure",
"$",
"trans",
")",
"{",
"return",
"$",
"this",
"->",
"flightcontrol",
"(",
")",
"->",
"newFDirectory",
"(",
"$",
"this",
",",
"function",
"(",
")",
"use",
"(",
"$",
"trans",
")",
"{",
"return",
"arr... | As this is as functor, we could map over it.
Turns an FDirectory a to an FDirectory b by using the provided $trans
function.
@param \Closure $trans a -> b
@return FDirectory | [
"As",
"this",
"is",
"as",
"functor",
"we",
"could",
"map",
"over",
"it",
"."
] | be7698183b44787f1b3d4a16d739655388e569ae | https://github.com/lechimp-p/flightcontrol/blob/be7698183b44787f1b3d4a16d739655388e569ae/src/FDirectory.php#L76-L80 |
204,122 | lechimp-p/flightcontrol | src/FDirectory.php | FDirectory.fold | public function fold($start_value, $iteration) {
return $this->outer_fmap(function($contents) use ($start_value, $iteration) {
$value = $start_value;
foreach($contents as $content) {
$value = $iteration($value, $content);
}
return $value;
}... | php | public function fold($start_value, $iteration) {
return $this->outer_fmap(function($contents) use ($start_value, $iteration) {
$value = $start_value;
foreach($contents as $content) {
$value = $iteration($value, $content);
}
return $value;
}... | [
"public",
"function",
"fold",
"(",
"$",
"start_value",
",",
"$",
"iteration",
")",
"{",
"return",
"$",
"this",
"->",
"outer_fmap",
"(",
"function",
"(",
"$",
"contents",
")",
"use",
"(",
"$",
"start_value",
",",
"$",
"iteration",
")",
"{",
"$",
"value"... | Define the function to be iterated with and close this level
of iteration.
@param \Closure $iteration a -> File|Directory -> a
@return Iterator|a | [
"Define",
"the",
"function",
"to",
"be",
"iterated",
"with",
"and",
"close",
"this",
"level",
"of",
"iteration",
"."
] | be7698183b44787f1b3d4a16d739655388e569ae | https://github.com/lechimp-p/flightcontrol/blob/be7698183b44787f1b3d4a16d739655388e569ae/src/FDirectory.php#L103-L111 |
204,123 | lechimp-p/flightcontrol | src/FDirectory.php | FDirectory.fcontents | public function fcontents() {
if ($this->contents === null) {
$cl = $this->contents_lazy;
$this->contents = $cl();
}
return $this->contents;
} | php | public function fcontents() {
if ($this->contents === null) {
$cl = $this->contents_lazy;
$this->contents = $cl();
}
return $this->contents;
} | [
"public",
"function",
"fcontents",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"contents",
"===",
"null",
")",
"{",
"$",
"cl",
"=",
"$",
"this",
"->",
"contents_lazy",
";",
"$",
"this",
"->",
"contents",
"=",
"$",
"cl",
"(",
")",
";",
"}",
"retu... | The contents of this directory.
It should really return type any[], as we do want to return an array
from things of the same type (but depend on the construction of this
object).
@return mixed[] for an FDirectory a | [
"The",
"contents",
"of",
"this",
"directory",
"."
] | be7698183b44787f1b3d4a16d739655388e569ae | https://github.com/lechimp-p/flightcontrol/blob/be7698183b44787f1b3d4a16d739655388e569ae/src/FDirectory.php#L135-L141 |
204,124 | smalldb/libSmalldb | class/Auth/CookieAuth.php | CookieAuth.checkSession | public function checkSession()
{
// Get session token
$session_token = isset($_COOKIE[$this->cookie_name]) ? $_COOKIE[$this->cookie_name]
: (isset($_SERVER['HTTP_AUTH_TOKEN']) ? $_SERVER['HTTP_AUTH_TOKEN'] : null);
// Get reference to session state machine
if ($session_token) {
// Get session machine re... | php | public function checkSession()
{
// Get session token
$session_token = isset($_COOKIE[$this->cookie_name]) ? $_COOKIE[$this->cookie_name]
: (isset($_SERVER['HTTP_AUTH_TOKEN']) ? $_SERVER['HTTP_AUTH_TOKEN'] : null);
// Get reference to session state machine
if ($session_token) {
// Get session machine re... | [
"public",
"function",
"checkSession",
"(",
")",
"{",
"// Get session token",
"$",
"session_token",
"=",
"isset",
"(",
"$",
"_COOKIE",
"[",
"$",
"this",
"->",
"cookie_name",
"]",
")",
"?",
"$",
"_COOKIE",
"[",
"$",
"this",
"->",
"cookie_name",
"]",
":",
"... | Check session - read & update cookies, setup session state machine and register callbacks.
This must be called before using any state machines. No transitions
are invoked at this point, only the session state machine reference
is created. | [
"Check",
"session",
"-",
"read",
"&",
"update",
"cookies",
"setup",
"session",
"state",
"machine",
"and",
"register",
"callbacks",
"."
] | b94d22af5014e8060d0530fc7043768cdc57b01a | https://github.com/smalldb/libSmalldb/blob/b94d22af5014e8060d0530fc7043768cdc57b01a/class/Auth/CookieAuth.php#L98-L145 |
204,125 | payapi/payapi-sdk-php | src/payapi/plugin/plugin.boc.php | plugin.consumerId | public function consumerId()
{
if (isset($this->session->data['customer_id']) === true) {
return $this->session->data['customer_id'];
}
return null;
} | php | public function consumerId()
{
if (isset($this->session->data['customer_id']) === true) {
return $this->session->data['customer_id'];
}
return null;
} | [
"public",
"function",
"consumerId",
"(",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"session",
"->",
"data",
"[",
"'customer_id'",
"]",
")",
"===",
"true",
")",
"{",
"return",
"$",
"this",
"->",
"session",
"->",
"data",
"[",
"'customer_id'",... | -> NEW | [
"-",
">",
"NEW"
] | 6a675749c88742b261178d7977f2436d540132b4 | https://github.com/payapi/payapi-sdk-php/blob/6a675749c88742b261178d7977f2436d540132b4/src/payapi/plugin/plugin.boc.php#L134-L140 |
204,126 | acacha/forge-publish | src/Console/Commands/PublishDomain.php | PublishDomain.defaultDomain | protected function defaultDomain()
{
if ($suffix = $this->parser->getDomainSuffix()) {
return strtolower(camel_case(basename(getcwd()))) . '.' . $suffix;
}
return '';
} | php | protected function defaultDomain()
{
if ($suffix = $this->parser->getDomainSuffix()) {
return strtolower(camel_case(basename(getcwd()))) . '.' . $suffix;
}
return '';
} | [
"protected",
"function",
"defaultDomain",
"(",
")",
"{",
"if",
"(",
"$",
"suffix",
"=",
"$",
"this",
"->",
"parser",
"->",
"getDomainSuffix",
"(",
")",
")",
"{",
"return",
"strtolower",
"(",
"camel_case",
"(",
"basename",
"(",
"getcwd",
"(",
")",
")",
... | Default domain.
@return string | [
"Default",
"domain",
"."
] | 010779e3d2297c763b82dc3fbde992edffb3a6c6 | https://github.com/acacha/forge-publish/blob/010779e3d2297c763b82dc3fbde992edffb3a6c6/src/Console/Commands/PublishDomain.php#L89-L95 |
204,127 | jails/li3_tree | extensions/data/behavior/Tree.php | Tree._init | public function _init() {
parent::_init();
if (!$model = $this->_model) {
throw new ConfigException("`'model'` option needs to be defined.");
}
$behavior = $this;
$model::applyFilter('save', function($self, $params, $chain) use ($behavior) {
if ($behavior->invokeMethod('_beforeSave', [$params])) {
r... | php | public function _init() {
parent::_init();
if (!$model = $this->_model) {
throw new ConfigException("`'model'` option needs to be defined.");
}
$behavior = $this;
$model::applyFilter('save', function($self, $params, $chain) use ($behavior) {
if ($behavior->invokeMethod('_beforeSave', [$params])) {
r... | [
"public",
"function",
"_init",
"(",
")",
"{",
"parent",
"::",
"_init",
"(",
")",
";",
"if",
"(",
"!",
"$",
"model",
"=",
"$",
"this",
"->",
"_model",
")",
"{",
"throw",
"new",
"ConfigException",
"(",
"\"`'model'` option needs to be defined.\"",
")",
";",
... | Initializer function called by the constructor unless the constructor `'init'` flag is set
to `false`.
@see lithium\core\Object
@throws ConfigException | [
"Initializer",
"function",
"called",
"by",
"the",
"constructor",
"unless",
"the",
"constructor",
"init",
"flag",
"is",
"set",
"to",
"false",
"."
] | 43fdbe9c621f1f712131c6a338bb5421da67fc17 | https://github.com/jails/li3_tree/blob/43fdbe9c621f1f712131c6a338bb5421da67fc17/extensions/data/behavior/Tree.php#L45-L62 |
204,128 | jails/li3_tree | extensions/data/behavior/Tree.php | Tree._scope | protected function _scope($entity) {
$scope = [];
foreach ($this->_config['scope'] as $key => $value) {
if (is_numeric($key)) {
if (isset($entity, $value)) {
$scope[$value] = $entity->$value;
} else {
$message = "The `{$value}` scope in not present in the entity.";
throw new UnexpectedValu... | php | protected function _scope($entity) {
$scope = [];
foreach ($this->_config['scope'] as $key => $value) {
if (is_numeric($key)) {
if (isset($entity, $value)) {
$scope[$value] = $entity->$value;
} else {
$message = "The `{$value}` scope in not present in the entity.";
throw new UnexpectedValu... | [
"protected",
"function",
"_scope",
"(",
"$",
"entity",
")",
"{",
"$",
"scope",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"this",
"->",
"_config",
"[",
"'scope'",
"]",
"as",
"$",
"key",
"=>",
"$",
"value",
")",
"{",
"if",
"(",
"is_numeric",
"(",
"$... | Setting a scope to an entity node.
@param object $entity
@return array The scope values
@throws UnexpectedValueException | [
"Setting",
"a",
"scope",
"to",
"an",
"entity",
"node",
"."
] | 43fdbe9c621f1f712131c6a338bb5421da67fc17 | https://github.com/jails/li3_tree/blob/43fdbe9c621f1f712131c6a338bb5421da67fc17/extensions/data/behavior/Tree.php#L71-L86 |
204,129 | jails/li3_tree | extensions/data/behavior/Tree.php | Tree._insertParent | protected function _insertParent($entity) {
extract($this->_config);
$parent = $this->_getById($entity->$parent);
if ($parent) {
$r = $parent->$right;
$this->_update($r, '+', 2, $this->_scope($entity));
$entity->set([
$left => $r,
$right => $r + 1
]);
}
} | php | protected function _insertParent($entity) {
extract($this->_config);
$parent = $this->_getById($entity->$parent);
if ($parent) {
$r = $parent->$right;
$this->_update($r, '+', 2, $this->_scope($entity));
$entity->set([
$left => $r,
$right => $r + 1
]);
}
} | [
"protected",
"function",
"_insertParent",
"(",
"$",
"entity",
")",
"{",
"extract",
"(",
"$",
"this",
"->",
"_config",
")",
";",
"$",
"parent",
"=",
"$",
"this",
"->",
"_getById",
"(",
"$",
"entity",
"->",
"$",
"parent",
")",
";",
"if",
"(",
"$",
"p... | Insert a parent
inserts a node at given last position of parent set in $entity
@param object $entity | [
"Insert",
"a",
"parent"
] | 43fdbe9c621f1f712131c6a338bb5421da67fc17 | https://github.com/jails/li3_tree/blob/43fdbe9c621f1f712131c6a338bb5421da67fc17/extensions/data/behavior/Tree.php#L244-L255 |
204,130 | jails/li3_tree | extensions/data/behavior/Tree.php | Tree._deleteFromTree | protected function _deleteFromTree($entity) {
extract($this->_config);
$span = 1;
if ($entity->$right - $entity->$left !== 1) {
$span = $entity->$right - $entity->$left;
$model::remove([$parent => $entity->data($model::key())]);
}
$this->_update($entity->$right, '-', $span + 1, $this->_scope($entity));... | php | protected function _deleteFromTree($entity) {
extract($this->_config);
$span = 1;
if ($entity->$right - $entity->$left !== 1) {
$span = $entity->$right - $entity->$left;
$model::remove([$parent => $entity->data($model::key())]);
}
$this->_update($entity->$right, '-', $span + 1, $this->_scope($entity));... | [
"protected",
"function",
"_deleteFromTree",
"(",
"$",
"entity",
")",
"{",
"extract",
"(",
"$",
"this",
"->",
"_config",
")",
";",
"$",
"span",
"=",
"1",
";",
"if",
"(",
"$",
"entity",
"->",
"$",
"right",
"-",
"$",
"entity",
"->",
"$",
"left",
"!=="... | Delete from tree
deletes a node (and its children) from the tree
@param object $entity updated tree element | [
"Delete",
"from",
"tree"
] | 43fdbe9c621f1f712131c6a338bb5421da67fc17 | https://github.com/jails/li3_tree/blob/43fdbe9c621f1f712131c6a338bb5421da67fc17/extensions/data/behavior/Tree.php#L342-L352 |
204,131 | jails/li3_tree | extensions/data/behavior/Tree.php | Tree._update | protected function _update($rght, $dir = '+', $span = 2, $scp = []) {
extract($this->_config);
$model::update([$right => (object) ($right . $dir . $span)], [
$right => ['>=' => $rght]
] + $scp);
$model::update([$left => (object) ($left . $dir . $span)], [
$left => ['>' => $rght]
] + $scp);
} | php | protected function _update($rght, $dir = '+', $span = 2, $scp = []) {
extract($this->_config);
$model::update([$right => (object) ($right . $dir . $span)], [
$right => ['>=' => $rght]
] + $scp);
$model::update([$left => (object) ($left . $dir . $span)], [
$left => ['>' => $rght]
] + $scp);
} | [
"protected",
"function",
"_update",
"(",
"$",
"rght",
",",
"$",
"dir",
"=",
"'+'",
",",
"$",
"span",
"=",
"2",
",",
"$",
"scp",
"=",
"[",
"]",
")",
"{",
"extract",
"(",
"$",
"this",
"->",
"_config",
")",
";",
"$",
"model",
"::",
"update",
"(",
... | Update node indices
Updates the Indices in greater than $rght with given value.
@param integer $rght the right index border to start indexing
@param string $dir Direction +/- (defaults to +)
@param integer $span value to be added/subtracted (defaults to 2)
@param array $scp The scope to apply updates on | [
"Update",
"node",
"indices"
] | 43fdbe9c621f1f712131c6a338bb5421da67fc17 | https://github.com/jails/li3_tree/blob/43fdbe9c621f1f712131c6a338bb5421da67fc17/extensions/data/behavior/Tree.php#L376-L386 |
204,132 | jails/li3_tree | extensions/data/behavior/Tree.php | Tree._updateBetween | protected function _updateBetween($range, $dir = '+', $span = 2, $scp = [], $data = []) {
extract($this->_config);
$model::update([$right => (object) ($right . $dir . $span)], [
$right => [
'>=' => $range['floor'],
'<=' => $range['ceiling']
]] + $scp);
$model::update([$left => (object) ($left . $di... | php | protected function _updateBetween($range, $dir = '+', $span = 2, $scp = [], $data = []) {
extract($this->_config);
$model::update([$right => (object) ($right . $dir . $span)], [
$right => [
'>=' => $range['floor'],
'<=' => $range['ceiling']
]] + $scp);
$model::update([$left => (object) ($left . $di... | [
"protected",
"function",
"_updateBetween",
"(",
"$",
"range",
",",
"$",
"dir",
"=",
"'+'",
",",
"$",
"span",
"=",
"2",
",",
"$",
"scp",
"=",
"[",
"]",
",",
"$",
"data",
"=",
"[",
"]",
")",
"{",
"extract",
"(",
"$",
"this",
"->",
"_config",
")",... | Update node indices between
Updates the Indices in given range with given value.
@param array $range the range to be updated
@param string $dir Direction +/- (defaults to +)
@param integer $span Value to be added/subtracted (defaults to 2)
@param array $scp The scope to apply updates on
@param array $data Additionnal... | [
"Update",
"node",
"indices",
"between"
] | 43fdbe9c621f1f712131c6a338bb5421da67fc17 | https://github.com/jails/li3_tree/blob/43fdbe9c621f1f712131c6a338bb5421da67fc17/extensions/data/behavior/Tree.php#L399-L413 |
204,133 | jails/li3_tree | extensions/data/behavior/Tree.php | Tree.moveDown | public function moveDown($entity) {
extract($this->_config);
$next = $model::find('first', [
'conditions' => [
$parent => $entity->$parent,
$left => $entity->$right + 1
]]);
if ($next !== null) {
$spanToZero = $entity->$right;
$rangeX = ['floor' => $entity->$left, 'ceiling' => $entity-... | php | public function moveDown($entity) {
extract($this->_config);
$next = $model::find('first', [
'conditions' => [
$parent => $entity->$parent,
$left => $entity->$right + 1
]]);
if ($next !== null) {
$spanToZero = $entity->$right;
$rangeX = ['floor' => $entity->$left, 'ceiling' => $entity-... | [
"public",
"function",
"moveDown",
"(",
"$",
"entity",
")",
"{",
"extract",
"(",
"$",
"this",
"->",
"_config",
")",
";",
"$",
"next",
"=",
"$",
"model",
"::",
"find",
"(",
"'first'",
",",
"[",
"'conditions'",
"=>",
"[",
"$",
"parent",
"=>",
"$",
"en... | Moves an element down in order
@param object $entity The Entity to move down | [
"Moves",
"an",
"element",
"down",
"in",
"order"
] | 43fdbe9c621f1f712131c6a338bb5421da67fc17 | https://github.com/jails/li3_tree/blob/43fdbe9c621f1f712131c6a338bb5421da67fc17/extensions/data/behavior/Tree.php#L420-L446 |
204,134 | jails/li3_tree | extensions/data/behavior/Tree.php | Tree.moveUp | public function moveUp($entity) {
extract($this->_config);
$prev = $model::find('first', [
'conditions' => [
$parent => $entity->$parent,
$right => $entity->$left - 1
]
]);
if (!$prev) {
return true;
}
$spanToZero = $entity->$right;
$rangeX = ['floor' => $entity->$left, 'ceiling' => $enti... | php | public function moveUp($entity) {
extract($this->_config);
$prev = $model::find('first', [
'conditions' => [
$parent => $entity->$parent,
$right => $entity->$left - 1
]
]);
if (!$prev) {
return true;
}
$spanToZero = $entity->$right;
$rangeX = ['floor' => $entity->$left, 'ceiling' => $enti... | [
"public",
"function",
"moveUp",
"(",
"$",
"entity",
")",
"{",
"extract",
"(",
"$",
"this",
"->",
"_config",
")",
";",
"$",
"prev",
"=",
"$",
"model",
"::",
"find",
"(",
"'first'",
",",
"[",
"'conditions'",
"=>",
"[",
"$",
"parent",
"=>",
"$",
"enti... | Moves an element up in order
@param object $entity The Entity to move up | [
"Moves",
"an",
"element",
"up",
"in",
"order"
] | 43fdbe9c621f1f712131c6a338bb5421da67fc17 | https://github.com/jails/li3_tree/blob/43fdbe9c621f1f712131c6a338bb5421da67fc17/extensions/data/behavior/Tree.php#L453-L480 |
204,135 | jails/li3_tree | extensions/data/behavior/Tree.php | Tree._getPosition | protected function _getPosition($entity, $childrenCount = false) {
extract($this->_config);
$parent = $this->_getById($entity->$parent);
if ($entity->$left === ($parent->$left + 1)) {
return 0;
}
if (($entity->$right + 1) === $parent->$right) {
if ($childrenCount === false) {
$childrenCount = $pa... | php | protected function _getPosition($entity, $childrenCount = false) {
extract($this->_config);
$parent = $this->_getById($entity->$parent);
if ($entity->$left === ($parent->$left + 1)) {
return 0;
}
if (($entity->$right + 1) === $parent->$right) {
if ($childrenCount === false) {
$childrenCount = $pa... | [
"protected",
"function",
"_getPosition",
"(",
"$",
"entity",
",",
"$",
"childrenCount",
"=",
"false",
")",
"{",
"extract",
"(",
"$",
"this",
"->",
"_config",
")",
";",
"$",
"parent",
"=",
"$",
"this",
"->",
"_getById",
"(",
"$",
"entity",
"->",
"$",
... | Returns the current position number of an element at the same level,
where 0 is first position
@param object $entity the entity node to get the position from.
@param integer $childrenCount number of children of entity's parent,
performance parameter to avoid double select. | [
"Returns",
"the",
"current",
"position",
"number",
"of",
"an",
"element",
"at",
"the",
"same",
"level",
"where",
"0",
"is",
"first",
"position"
] | 43fdbe9c621f1f712131c6a338bb5421da67fc17 | https://github.com/jails/li3_tree/blob/43fdbe9c621f1f712131c6a338bb5421da67fc17/extensions/data/behavior/Tree.php#L509-L537 |
204,136 | alphacomm/alpharpc | src/AlphaRPC/Client/AlphaRPCStatus.php | AlphaRPCStatus.queueStatus | public function queueStatus($manager)
{
$socket = $this->getSocket($manager);
$stream = $socket->getStream();
$stream->send(new QueueStatusRequest());
$msg = $stream->read(new TimeoutTimer(1500));
if (!$msg instanceof QueueStatusResponse) {
throw new RuntimeExce... | php | public function queueStatus($manager)
{
$socket = $this->getSocket($manager);
$stream = $socket->getStream();
$stream->send(new QueueStatusRequest());
$msg = $stream->read(new TimeoutTimer(1500));
if (!$msg instanceof QueueStatusResponse) {
throw new RuntimeExce... | [
"public",
"function",
"queueStatus",
"(",
"$",
"manager",
")",
"{",
"$",
"socket",
"=",
"$",
"this",
"->",
"getSocket",
"(",
"$",
"manager",
")",
";",
"$",
"stream",
"=",
"$",
"socket",
"->",
"getStream",
"(",
")",
";",
"$",
"stream",
"->",
"send",
... | Requests the queue status.
@param string $manager
@return array
@throws \RuntimeException | [
"Requests",
"the",
"queue",
"status",
"."
] | cf162854500554c4ba8d39f2675de35a49c30ed0 | https://github.com/alphacomm/alpharpc/blob/cf162854500554c4ba8d39f2675de35a49c30ed0/src/AlphaRPC/Client/AlphaRPCStatus.php#L70-L83 |
204,137 | interactivesolutions/honeycomb-scripts | src/app/commands/service/HCServiceFormValidators.php | HCServiceFormValidators.optimize | public function optimize (stdClass $data)
{
$data->formValidationName = $data->serviceName . 'Validator';
$data->formValidationNameSpace = str_replace ('\\http\\controllers', '\\validators', $data->controllerNamespace);
$data->formValidationDestination = str_replace ('/http/controllers', '/v... | php | public function optimize (stdClass $data)
{
$data->formValidationName = $data->serviceName . 'Validator';
$data->formValidationNameSpace = str_replace ('\\http\\controllers', '\\validators', $data->controllerNamespace);
$data->formValidationDestination = str_replace ('/http/controllers', '/v... | [
"public",
"function",
"optimize",
"(",
"stdClass",
"$",
"data",
")",
"{",
"$",
"data",
"->",
"formValidationName",
"=",
"$",
"data",
"->",
"serviceName",
".",
"'Validator'",
";",
"$",
"data",
"->",
"formValidationNameSpace",
"=",
"str_replace",
"(",
"'\\\\http... | Optimizing configuration for form creation
@param stdClass $data
@return stdClass | [
"Optimizing",
"configuration",
"for",
"form",
"creation"
] | be2428ded5219dc612ecc51f43aa4dedff3d034d | https://github.com/interactivesolutions/honeycomb-scripts/blob/be2428ded5219dc612ecc51f43aa4dedff3d034d/src/app/commands/service/HCServiceFormValidators.php#L21-L33 |
204,138 | interactivesolutions/honeycomb-scripts | src/app/commands/service/HCServiceFormValidators.php | HCServiceFormValidators.generate | public function generate (stdClass $data)
{
$files = [];
$this->createFileFromTemplate ([
"destination" => $data->formValidationDestination,
"templateDestination" => __DIR__ . '/../templates/service/validator.hctpl',
"content" => [
... | php | public function generate (stdClass $data)
{
$files = [];
$this->createFileFromTemplate ([
"destination" => $data->formValidationDestination,
"templateDestination" => __DIR__ . '/../templates/service/validator.hctpl',
"content" => [
... | [
"public",
"function",
"generate",
"(",
"stdClass",
"$",
"data",
")",
"{",
"$",
"files",
"=",
"[",
"]",
";",
"$",
"this",
"->",
"createFileFromTemplate",
"(",
"[",
"\"destination\"",
"=>",
"$",
"data",
"->",
"formValidationDestination",
",",
"\"templateDestinat... | Generating validator files
@param stdClass $data
@return array | [
"Generating",
"validator",
"files"
] | be2428ded5219dc612ecc51f43aa4dedff3d034d | https://github.com/interactivesolutions/honeycomb-scripts/blob/be2428ded5219dc612ecc51f43aa4dedff3d034d/src/app/commands/service/HCServiceFormValidators.php#L41-L73 |
204,139 | pmdevelopment/tool-bundle | Components/Helper/ComposerHelper.php | ComposerHelper.getConsoleDir | public static function getConsoleDir()
{
$rootDir = sprintf('%s/../../../../../../../..', __DIR__);
$paths = [
'bin',
'app',
];
foreach ($paths as $path) {
$fullPath = sprintf('%s/%s', $rootDir, $path);
if (true === is_dir($fullPath)... | php | public static function getConsoleDir()
{
$rootDir = sprintf('%s/../../../../../../../..', __DIR__);
$paths = [
'bin',
'app',
];
foreach ($paths as $path) {
$fullPath = sprintf('%s/%s', $rootDir, $path);
if (true === is_dir($fullPath)... | [
"public",
"static",
"function",
"getConsoleDir",
"(",
")",
"{",
"$",
"rootDir",
"=",
"sprintf",
"(",
"'%s/../../../../../../../..'",
",",
"__DIR__",
")",
";",
"$",
"paths",
"=",
"[",
"'bin'",
",",
"'app'",
",",
"]",
";",
"foreach",
"(",
"$",
"paths",
"as... | Get Console Dir
@return null|string | [
"Get",
"Console",
"Dir"
] | 2cbc9f82c5b33fd7a9d389edd3676e9f70ea8129 | https://github.com/pmdevelopment/tool-bundle/blob/2cbc9f82c5b33fd7a9d389edd3676e9f70ea8129/Components/Helper/ComposerHelper.php#L100-L118 |
204,140 | mglaman/docker-helper | src/Machine.php | Machine.start | public static function start($name)
{
// Check if machine is running.
$status = self::status($name);
if ($status == self::STOPPED) {
// If not, try to start it.
return self::runCommand('start', [$name])->isSuccessful();
}
return $status == Machine::R... | php | public static function start($name)
{
// Check if machine is running.
$status = self::status($name);
if ($status == self::STOPPED) {
// If not, try to start it.
return self::runCommand('start', [$name])->isSuccessful();
}
return $status == Machine::R... | [
"public",
"static",
"function",
"start",
"(",
"$",
"name",
")",
"{",
"// Check if machine is running.",
"$",
"status",
"=",
"self",
"::",
"status",
"(",
"$",
"name",
")",
";",
"if",
"(",
"$",
"status",
"==",
"self",
"::",
"STOPPED",
")",
"{",
"// If not,... | Start a machine.
@param $name
@return bool
@throws \Exception | [
"Start",
"a",
"machine",
"."
] | b262a50dcdbc495487568f775a8f41da82ae2c03 | https://github.com/mglaman/docker-helper/blob/b262a50dcdbc495487568f775a8f41da82ae2c03/src/Machine.php#L45-L56 |
204,141 | mglaman/docker-helper | src/Machine.php | Machine.getEnv | public static function getEnv($name)
{
$envs = [];
$output = self::runCommand('env', [$name]);
if (trim($output->getOutput()) == "$name is not running. Please start this with docker-machine start $name") {
throw new \Exception('Docker machine has not been started yet.');
... | php | public static function getEnv($name)
{
$envs = [];
$output = self::runCommand('env', [$name]);
if (trim($output->getOutput()) == "$name is not running. Please start this with docker-machine start $name") {
throw new \Exception('Docker machine has not been started yet.');
... | [
"public",
"static",
"function",
"getEnv",
"(",
"$",
"name",
")",
"{",
"$",
"envs",
"=",
"[",
"]",
";",
"$",
"output",
"=",
"self",
"::",
"runCommand",
"(",
"'env'",
",",
"[",
"$",
"name",
"]",
")",
";",
"if",
"(",
"trim",
"(",
"$",
"output",
"-... | Returns an array of the environment for the Docker client.
@param $name
@return array
@throws \Exception | [
"Returns",
"an",
"array",
"of",
"the",
"environment",
"for",
"the",
"Docker",
"client",
"."
] | b262a50dcdbc495487568f775a8f41da82ae2c03 | https://github.com/mglaman/docker-helper/blob/b262a50dcdbc495487568f775a8f41da82ae2c03/src/Machine.php#L89-L105 |
204,142 | K-Phoen/gaufrette-extras-bundle | Form/Type/ImageType.php | ImageType.buildView | public function buildView(FormView $view, FormInterface $form, array $options)
{
$parentData = $form->getParent()->getData();
if ($parentData !== null) {
$accessor = PropertyAccess::getPropertyAccessor();
// set an "image_url" variable that will be available when rendering t... | php | public function buildView(FormView $view, FormInterface $form, array $options)
{
$parentData = $form->getParent()->getData();
if ($parentData !== null) {
$accessor = PropertyAccess::getPropertyAccessor();
// set an "image_url" variable that will be available when rendering t... | [
"public",
"function",
"buildView",
"(",
"FormView",
"$",
"view",
",",
"FormInterface",
"$",
"form",
",",
"array",
"$",
"options",
")",
"{",
"$",
"parentData",
"=",
"$",
"form",
"->",
"getParent",
"(",
")",
"->",
"getData",
"(",
")",
";",
"if",
"(",
"... | Pass the image url to the view
@param FormView $view
@param FormInterface $form
@param array $options | [
"Pass",
"the",
"image",
"url",
"to",
"the",
"view"
] | 3f05779179117d5649184164544e1f22de28d706 | https://github.com/K-Phoen/gaufrette-extras-bundle/blob/3f05779179117d5649184164544e1f22de28d706/Form/Type/ImageType.php#L46-L67 |
204,143 | antaresproject/translations | src/Http/Controllers/Admin/SyncController.php | SyncController.index | public function index($area = null, $locale = null)
{
return $this->processor->index($this, !is_null($area) ? $area : area(), $locale);
} | php | public function index($area = null, $locale = null)
{
return $this->processor->index($this, !is_null($area) ? $area : area(), $locale);
} | [
"public",
"function",
"index",
"(",
"$",
"area",
"=",
"null",
",",
"$",
"locale",
"=",
"null",
")",
"{",
"return",
"$",
"this",
"->",
"processor",
"->",
"index",
"(",
"$",
"this",
",",
"!",
"is_null",
"(",
"$",
"area",
")",
"?",
"$",
"area",
":",... | index default action
@return \Illuminate\View\View | [
"index",
"default",
"action"
] | 63097aeb97f18c5aeeef7dcf15f0c67959951685 | https://github.com/antaresproject/translations/blob/63097aeb97f18c5aeeef7dcf15f0c67959951685/src/Http/Controllers/Admin/SyncController.php#L57-L60 |
204,144 | newup/core | src/Console/Commandable.php | Commandable.setApplication | public function setApplication(ApplicationContract $application = null)
{
$this->application = $application;
if ($application) {
$this->setHelperSet($application->getHelperSet());
} else {
$this->helperSet = null;
}
} | php | public function setApplication(ApplicationContract $application = null)
{
$this->application = $application;
if ($application) {
$this->setHelperSet($application->getHelperSet());
} else {
$this->helperSet = null;
}
} | [
"public",
"function",
"setApplication",
"(",
"ApplicationContract",
"$",
"application",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"application",
"=",
"$",
"application",
";",
"if",
"(",
"$",
"application",
")",
"{",
"$",
"this",
"->",
"setHelperSet",
"(",
... | Sets the ApplicationContract instance.
@param ApplicationContract|null $application | [
"Sets",
"the",
"ApplicationContract",
"instance",
"."
] | 54128903e7775e67d63284d958b46862c8df71f9 | https://github.com/newup/core/blob/54128903e7775e67d63284d958b46862c8df71f9/src/Console/Commandable.php#L50-L58 |
204,145 | PopSugar/php-yesmail-api | src/Yesmail/Yesmail.php | Yesmail.Subscriber_Update | public function Subscriber_Update($user_id, $subscription_state, $division, $attributes, $allow_resubscribe = true,
$append = false) {
$data = $this->_package_subscriber_elements($subscription_state, $division, $attributes);
if (is_null($allow_resubscribe) === fals... | php | public function Subscriber_Update($user_id, $subscription_state, $division, $attributes, $allow_resubscribe = true,
$append = false) {
$data = $this->_package_subscriber_elements($subscription_state, $division, $attributes);
if (is_null($allow_resubscribe) === fals... | [
"public",
"function",
"Subscriber_Update",
"(",
"$",
"user_id",
",",
"$",
"subscription_state",
",",
"$",
"division",
",",
"$",
"attributes",
",",
"$",
"allow_resubscribe",
"=",
"true",
",",
"$",
"append",
"=",
"false",
")",
"{",
"$",
"data",
"=",
"$",
"... | Update an existing subscriber.
@param int $user_id The id of the subscriber to update
@param mixed $subscription_state [optional] Any of {"UNSUBSCRIBED", "SUBSCRIBED", "REFERRED", "DEAD", "REVIVED"}
@param mixed $division [optional] The division display name. If this is specified the subscriber will be
subscribed to t... | [
"Update",
"an",
"existing",
"subscriber",
"."
] | 42c20a3ded1d8f2177c792cd3aa44bcdfdcb239c | https://github.com/PopSugar/php-yesmail-api/blob/42c20a3ded1d8f2177c792cd3aa44bcdfdcb239c/src/Yesmail/Yesmail.php#L99-L114 |
204,146 | PopSugar/php-yesmail-api | src/Yesmail/Yesmail.php | Yesmail.Subscriber_Get_Id | public function Subscriber_Get_Id($attributes) {
try {
$ret = $this->Subscriber_Lookup($attributes);
$uri = $ret->uri;
$id = (int) substr(strrchr($uri, '/'), 1);
} catch (\Exception $e) {
if( $e->getCode() === 404){
$id = false;
... | php | public function Subscriber_Get_Id($attributes) {
try {
$ret = $this->Subscriber_Lookup($attributes);
$uri = $ret->uri;
$id = (int) substr(strrchr($uri, '/'), 1);
} catch (\Exception $e) {
if( $e->getCode() === 404){
$id = false;
... | [
"public",
"function",
"Subscriber_Get_Id",
"(",
"$",
"attributes",
")",
"{",
"try",
"{",
"$",
"ret",
"=",
"$",
"this",
"->",
"Subscriber_Lookup",
"(",
"$",
"attributes",
")",
";",
"$",
"uri",
"=",
"$",
"ret",
"->",
"uri",
";",
"$",
"id",
"=",
"(",
... | Look up the id of an existing subscriber.
@param array $attributes An array of attribute to look up the subscriber with
@return mixed Either the subscriber id, or false if the subscriber is not found
@access public | [
"Look",
"up",
"the",
"id",
"of",
"an",
"existing",
"subscriber",
"."
] | 42c20a3ded1d8f2177c792cd3aa44bcdfdcb239c | https://github.com/PopSugar/php-yesmail-api/blob/42c20a3ded1d8f2177c792cd3aa44bcdfdcb239c/src/Yesmail/Yesmail.php#L136-L150 |
204,147 | PopSugar/php-yesmail-api | src/Yesmail/Yesmail.php | Yesmail.Subscriber_Retrieve | public function Subscriber_Retrieve($attributes, $division) {
$ret = false;
$subscriberId = $this->Subscriber_Get_Id($attributes);
if ($subscriberId !== false) {
$ret = $this->_call_api('get', "{$this->_url}/subscribers/$subscriberId", array('division' => $division));
}
... | php | public function Subscriber_Retrieve($attributes, $division) {
$ret = false;
$subscriberId = $this->Subscriber_Get_Id($attributes);
if ($subscriberId !== false) {
$ret = $this->_call_api('get', "{$this->_url}/subscribers/$subscriberId", array('division' => $division));
}
... | [
"public",
"function",
"Subscriber_Retrieve",
"(",
"$",
"attributes",
",",
"$",
"division",
")",
"{",
"$",
"ret",
"=",
"false",
";",
"$",
"subscriberId",
"=",
"$",
"this",
"->",
"Subscriber_Get_Id",
"(",
"$",
"attributes",
")",
";",
"if",
"(",
"$",
"subsc... | Retrieve all information about a subscriber, including attributes, division subscription status, etc.
@param array $attributes An array of attribute to look up the subscriber with
@param mixed $division The division display name. The division from which to get the subscribers information
@return mixed A JSON decoded P... | [
"Retrieve",
"all",
"information",
"about",
"a",
"subscriber",
"including",
"attributes",
"division",
"subscription",
"status",
"etc",
"."
] | 42c20a3ded1d8f2177c792cd3aa44bcdfdcb239c | https://github.com/PopSugar/php-yesmail-api/blob/42c20a3ded1d8f2177c792cd3aa44bcdfdcb239c/src/Yesmail/Yesmail.php#L174-L182 |
204,148 | PopSugar/php-yesmail-api | src/Yesmail/Yesmail.php | Yesmail.Subscribe_And_Send | public function Subscribe_And_Send($subscription_state, $division, $attributes, $allow_resubscribe, $masterId) {
$data = new \stdClass();
$subscriber = $this->_package_subscriber_elements($subscription_state, $division, $attributes);
if (is_bool($allow_resubscribe) === true) {
$subs... | php | public function Subscribe_And_Send($subscription_state, $division, $attributes, $allow_resubscribe, $masterId) {
$data = new \stdClass();
$subscriber = $this->_package_subscriber_elements($subscription_state, $division, $attributes);
if (is_bool($allow_resubscribe) === true) {
$subs... | [
"public",
"function",
"Subscribe_And_Send",
"(",
"$",
"subscription_state",
",",
"$",
"division",
",",
"$",
"attributes",
",",
"$",
"allow_resubscribe",
",",
"$",
"masterId",
")",
"{",
"$",
"data",
"=",
"new",
"\\",
"stdClass",
"(",
")",
";",
"$",
"subscri... | Subscribe and send
@param mixed $subscription_state Any of {"UNSUBSCRIBED", "SUBSCRIBED", "REFERRED", "DEAD", "REVIVED"} or null
@param mixed $division The division display name. If specified, the subscriber will be subscribed
to this division. If null, subscriber will not be subscribed to a division.
@param array $at... | [
"Subscribe",
"and",
"send"
] | 42c20a3ded1d8f2177c792cd3aa44bcdfdcb239c | https://github.com/PopSugar/php-yesmail-api/blob/42c20a3ded1d8f2177c792cd3aa44bcdfdcb239c/src/Yesmail/Yesmail.php#L198-L214 |
204,149 | PopSugar/php-yesmail-api | src/Yesmail/Yesmail.php | Yesmail.Status_Get | public function Status_Get($guid, $nowait = true) {
if ($nowait === true) {
$ret = $this->_call_api('get', "{$this->_url}/statusNoWait/$guid", array());
} else {
do {
$ret = $this->_call_api('get', "{$this->_url}/status/$guid", array());
switch($re... | php | public function Status_Get($guid, $nowait = true) {
if ($nowait === true) {
$ret = $this->_call_api('get', "{$this->_url}/statusNoWait/$guid", array());
} else {
do {
$ret = $this->_call_api('get', "{$this->_url}/status/$guid", array());
switch($re... | [
"public",
"function",
"Status_Get",
"(",
"$",
"guid",
",",
"$",
"nowait",
"=",
"true",
")",
"{",
"if",
"(",
"$",
"nowait",
"===",
"true",
")",
"{",
"$",
"ret",
"=",
"$",
"this",
"->",
"_call_api",
"(",
"'get'",
",",
"\"{$this->_url}/statusNoWait/$guid\""... | Get the status of an outstanding request.
@param int $guid The trackingId of the request to get status for
@param bool $nowait True if we should return without blocking. False if we should block until the request
reaches a completed state.
@return mixed A JSON decoded PHP variable representing the HTTP response.
@acce... | [
"Get",
"the",
"status",
"of",
"an",
"outstanding",
"request",
"."
] | 42c20a3ded1d8f2177c792cd3aa44bcdfdcb239c | https://github.com/PopSugar/php-yesmail-api/blob/42c20a3ded1d8f2177c792cd3aa44bcdfdcb239c/src/Yesmail/Yesmail.php#L225-L251 |
204,150 | PopSugar/php-yesmail-api | src/Yesmail/Yesmail.php | Yesmail.Master_Create | public function Master_Create($envelope, $targeting, $scheduling) {
$ret = false;
$data = $this->_package_master_elements($envelope, $targeting, $scheduling);
if ($data !== false) {
$ret = $this->_call_api('post', "{$this->_url}/masters", $data);
}
return $ret;
... | php | public function Master_Create($envelope, $targeting, $scheduling) {
$ret = false;
$data = $this->_package_master_elements($envelope, $targeting, $scheduling);
if ($data !== false) {
$ret = $this->_call_api('post', "{$this->_url}/masters", $data);
}
return $ret;
... | [
"public",
"function",
"Master_Create",
"(",
"$",
"envelope",
",",
"$",
"targeting",
",",
"$",
"scheduling",
")",
"{",
"$",
"ret",
"=",
"false",
";",
"$",
"data",
"=",
"$",
"this",
"->",
"_package_master_elements",
"(",
"$",
"envelope",
",",
"$",
"targeti... | Create a new Master
@param object $envelope The envelope to use for the new master
@param mixed $targeting [optional] Optional targeting parameters to use for the new master
@param mixed $scheduling [optional] Optional scheduling parameters to use for the new master
@return mixed A JSON decoded PHP variable representi... | [
"Create",
"a",
"new",
"Master"
] | 42c20a3ded1d8f2177c792cd3aa44bcdfdcb239c | https://github.com/PopSugar/php-yesmail-api/blob/42c20a3ded1d8f2177c792cd3aa44bcdfdcb239c/src/Yesmail/Yesmail.php#L271-L280 |
204,151 | PopSugar/php-yesmail-api | src/Yesmail/Yesmail.php | Yesmail.Master_Update | public function Master_Update($masterId, $envelope, $targeting, $scheduling) {
$ret = false;
$data = $this->_package_master_elements($envelope, $targeting, $scheduling);
if ($data !== false) {
$ret = $this->_call_api('put', "{$this->_url}/masters/$masterId", $data);
}
... | php | public function Master_Update($masterId, $envelope, $targeting, $scheduling) {
$ret = false;
$data = $this->_package_master_elements($envelope, $targeting, $scheduling);
if ($data !== false) {
$ret = $this->_call_api('put', "{$this->_url}/masters/$masterId", $data);
}
... | [
"public",
"function",
"Master_Update",
"(",
"$",
"masterId",
",",
"$",
"envelope",
",",
"$",
"targeting",
",",
"$",
"scheduling",
")",
"{",
"$",
"ret",
"=",
"false",
";",
"$",
"data",
"=",
"$",
"this",
"->",
"_package_master_elements",
"(",
"$",
"envelop... | Update an existing Master
@param int $masterId The id of the master to update
@param object $envelope The envelope to use for the new master
@param mixed $targeting [optional] Optional targeting parameters to use for the new master
@param mixed $scheduling [optional] Optional scheduling parameters to use for the new m... | [
"Update",
"an",
"existing",
"Master"
] | 42c20a3ded1d8f2177c792cd3aa44bcdfdcb239c | https://github.com/PopSugar/php-yesmail-api/blob/42c20a3ded1d8f2177c792cd3aa44bcdfdcb239c/src/Yesmail/Yesmail.php#L292-L301 |
204,152 | PopSugar/php-yesmail-api | src/Yesmail/Yesmail.php | Yesmail.Master_Get | public function Master_Get($masterId) {
$ret = false;
if (is_int($masterId) === true) {
try {
$ret = $this->_call_api('get', "{$this->_url}/masters/$masterId", array());
$ret = $this->_Type_Safe_Yesmail_Master($ret);
$ret->id = (int) $masterId... | php | public function Master_Get($masterId) {
$ret = false;
if (is_int($masterId) === true) {
try {
$ret = $this->_call_api('get', "{$this->_url}/masters/$masterId", array());
$ret = $this->_Type_Safe_Yesmail_Master($ret);
$ret->id = (int) $masterId... | [
"public",
"function",
"Master_Get",
"(",
"$",
"masterId",
")",
"{",
"$",
"ret",
"=",
"false",
";",
"if",
"(",
"is_int",
"(",
"$",
"masterId",
")",
"===",
"true",
")",
"{",
"try",
"{",
"$",
"ret",
"=",
"$",
"this",
"->",
"_call_api",
"(",
"'get'",
... | Get an existing Master
@param int $masterId The id of the master to retrieve
@return mixed A JSON decoded PHP variable representing the HTTP response.
@access public | [
"Get",
"an",
"existing",
"Master"
] | 42c20a3ded1d8f2177c792cd3aa44bcdfdcb239c | https://github.com/PopSugar/php-yesmail-api/blob/42c20a3ded1d8f2177c792cd3aa44bcdfdcb239c/src/Yesmail/Yesmail.php#L337-L355 |
204,153 | PopSugar/php-yesmail-api | src/Yesmail/Yesmail.php | Yesmail.Master_Get_By_Name | public function Master_Get_By_Name($masterName) {
$ret = false;
if (is_string($masterName) === true) {
$pageSize = 50;
$begin = 1;
$end = $pageSize;
$filter = 'active';
$more = true;
while($more) {
$res = $this->_ca... | php | public function Master_Get_By_Name($masterName) {
$ret = false;
if (is_string($masterName) === true) {
$pageSize = 50;
$begin = 1;
$end = $pageSize;
$filter = 'active';
$more = true;
while($more) {
$res = $this->_ca... | [
"public",
"function",
"Master_Get_By_Name",
"(",
"$",
"masterName",
")",
"{",
"$",
"ret",
"=",
"false",
";",
"if",
"(",
"is_string",
"(",
"$",
"masterName",
")",
"===",
"true",
")",
"{",
"$",
"pageSize",
"=",
"50",
";",
"$",
"begin",
"=",
"1",
";",
... | Get an existing Master by name
@param int $masterName The name of the master to retrieve
@return mixed A JSON decoded PHP variable representing the HTTP response, or false if the master is not found
@access public | [
"Get",
"an",
"existing",
"Master",
"by",
"name"
] | 42c20a3ded1d8f2177c792cd3aa44bcdfdcb239c | https://github.com/PopSugar/php-yesmail-api/blob/42c20a3ded1d8f2177c792cd3aa44bcdfdcb239c/src/Yesmail/Yesmail.php#L364-L397 |
204,154 | PopSugar/php-yesmail-api | src/Yesmail/Yesmail.php | Yesmail.Master_Post_Run_Count | public function Master_Post_Run_Count($masterId) {
$ret = false;
if (is_int($masterId) === true) {
$ret = $this->_call_api('post', "{$this->_url}/masters/$masterId/RUN/countData", array());
}
return $ret;
} | php | public function Master_Post_Run_Count($masterId) {
$ret = false;
if (is_int($masterId) === true) {
$ret = $this->_call_api('post', "{$this->_url}/masters/$masterId/RUN/countData", array());
}
return $ret;
} | [
"public",
"function",
"Master_Post_Run_Count",
"(",
"$",
"masterId",
")",
"{",
"$",
"ret",
"=",
"false",
";",
"if",
"(",
"is_int",
"(",
"$",
"masterId",
")",
"===",
"true",
")",
"{",
"$",
"ret",
"=",
"$",
"this",
"->",
"_call_api",
"(",
"'post'",
","... | Submit the master's ID and RUN the eAPI service URL to request the the count job for a specific master
Run this before doing Master_Post_Run_Count
@param int $master_id master's id to check the count for
@return mixed A JSON decoded PHP variable representing the HTTP response.
@access public | [
"Submit",
"the",
"master",
"s",
"ID",
"and",
"RUN",
"the",
"eAPI",
"service",
"URL",
"to",
"request",
"the",
"the",
"count",
"job",
"for",
"a",
"specific",
"master",
"Run",
"this",
"before",
"doing",
"Master_Post_Run_Count"
] | 42c20a3ded1d8f2177c792cd3aa44bcdfdcb239c | https://github.com/PopSugar/php-yesmail-api/blob/42c20a3ded1d8f2177c792cd3aa44bcdfdcb239c/src/Yesmail/Yesmail.php#L407-L415 |
204,155 | PopSugar/php-yesmail-api | src/Yesmail/Yesmail.php | Yesmail.Master_Get_Count | public function Master_Get_Count($masterId) {
$ret = false;
if (is_int($masterId) === true) {
do {
$ret = $this->_call_api('get', "{$this->_url}/masters/$masterId/countData", array());
// Sleep for 15 seconds so we don't keep hammering the api
... | php | public function Master_Get_Count($masterId) {
$ret = false;
if (is_int($masterId) === true) {
do {
$ret = $this->_call_api('get', "{$this->_url}/masters/$masterId/countData", array());
// Sleep for 15 seconds so we don't keep hammering the api
... | [
"public",
"function",
"Master_Get_Count",
"(",
"$",
"masterId",
")",
"{",
"$",
"ret",
"=",
"false",
";",
"if",
"(",
"is_int",
"(",
"$",
"masterId",
")",
"===",
"true",
")",
"{",
"do",
"{",
"$",
"ret",
"=",
"$",
"this",
"->",
"_call_api",
"(",
"'get... | Get the number of active subscribers based on master's id.
Run this after doing Master_Post_Run_Count
@param int $master_id master's id to check the count for
@return mixed A JSON decoded PHP variable representing the HTTP response.
@access public | [
"Get",
"the",
"number",
"of",
"active",
"subscribers",
"based",
"on",
"master",
"s",
"id",
".",
"Run",
"this",
"after",
"doing",
"Master_Post_Run_Count"
] | 42c20a3ded1d8f2177c792cd3aa44bcdfdcb239c | https://github.com/PopSugar/php-yesmail-api/blob/42c20a3ded1d8f2177c792cd3aa44bcdfdcb239c/src/Yesmail/Yesmail.php#L425-L438 |
204,156 | PopSugar/php-yesmail-api | src/Yesmail/Yesmail.php | Yesmail.Master_Assets_Get | public function Master_Assets_Get($masterId) {
$ret = false;
if (is_int($masterId) === true) {
$ret = $this->_call_api('get', "{$this->_url}/masters/$masterId/assets", array());
}
return $ret;
} | php | public function Master_Assets_Get($masterId) {
$ret = false;
if (is_int($masterId) === true) {
$ret = $this->_call_api('get', "{$this->_url}/masters/$masterId/assets", array());
}
return $ret;
} | [
"public",
"function",
"Master_Assets_Get",
"(",
"$",
"masterId",
")",
"{",
"$",
"ret",
"=",
"false",
";",
"if",
"(",
"is_int",
"(",
"$",
"masterId",
")",
"===",
"true",
")",
"{",
"$",
"ret",
"=",
"$",
"this",
"->",
"_call_api",
"(",
"'get'",
",",
"... | Get the assets that belong to a Master
@param int $masterId The id of the master who's assets are being requested
@return mixed A JSON decoded PHP variable representing the HTTP response.
@access public | [
"Get",
"the",
"assets",
"that",
"belong",
"to",
"a",
"Master"
] | 42c20a3ded1d8f2177c792cd3aa44bcdfdcb239c | https://github.com/PopSugar/php-yesmail-api/blob/42c20a3ded1d8f2177c792cd3aa44bcdfdcb239c/src/Yesmail/Yesmail.php#L484-L492 |
204,157 | PopSugar/php-yesmail-api | src/Yesmail/Yesmail.php | Yesmail.Master_Preview | public function Master_Preview($masterId, $contentType, $distributionList, $userId, $emails) {
$ret = false;
$contentTypes = array('HTML', 'PLAIN', 'BOTH', 'USERPREFERENCE');
if (in_array($contentType, $contentTypes) === true) {
if (is_string($distributionList) === true xor (is_int(... | php | public function Master_Preview($masterId, $contentType, $distributionList, $userId, $emails) {
$ret = false;
$contentTypes = array('HTML', 'PLAIN', 'BOTH', 'USERPREFERENCE');
if (in_array($contentType, $contentTypes) === true) {
if (is_string($distributionList) === true xor (is_int(... | [
"public",
"function",
"Master_Preview",
"(",
"$",
"masterId",
",",
"$",
"contentType",
",",
"$",
"distributionList",
",",
"$",
"userId",
",",
"$",
"emails",
")",
"{",
"$",
"ret",
"=",
"false",
";",
"$",
"contentTypes",
"=",
"array",
"(",
"'HTML'",
",",
... | Provides a way to preview a message by sending it to a group of email addresses, following the same semantics as
the preview functionality within the Enterprise Application.
@param int $masterId The id of the master to preview
@param string $contentType HTML - Use HTML content in the email
PLAIN - Use plain text conte... | [
"Provides",
"a",
"way",
"to",
"preview",
"a",
"message",
"by",
"sending",
"it",
"to",
"a",
"group",
"of",
"email",
"addresses",
"following",
"the",
"same",
"semantics",
"as",
"the",
"preview",
"functionality",
"within",
"the",
"Enterprise",
"Application",
"."
... | 42c20a3ded1d8f2177c792cd3aa44bcdfdcb239c | https://github.com/PopSugar/php-yesmail-api/blob/42c20a3ded1d8f2177c792cd3aa44bcdfdcb239c/src/Yesmail/Yesmail.php#L545-L567 |
204,158 | PopSugar/php-yesmail-api | src/Yesmail/Yesmail.php | Yesmail.ListManagement_Get_Lists | public function ListManagement_Get_Lists($type) {
$ret = false;
if (is_string($type) === true) {
$type = rawurlencode($type);
$ret = $this->_call_api('get', "{$this->_url}/lists/$type", array());
}
return $ret;
} | php | public function ListManagement_Get_Lists($type) {
$ret = false;
if (is_string($type) === true) {
$type = rawurlencode($type);
$ret = $this->_call_api('get', "{$this->_url}/lists/$type", array());
}
return $ret;
} | [
"public",
"function",
"ListManagement_Get_Lists",
"(",
"$",
"type",
")",
"{",
"$",
"ret",
"=",
"false",
";",
"if",
"(",
"is_string",
"(",
"$",
"type",
")",
"===",
"true",
")",
"{",
"$",
"type",
"=",
"rawurlencode",
"(",
"$",
"type",
")",
";",
"$",
... | Get a list of lists given a list type
@param string $type The type of lists to get. Should be either LISTLOADLIST or DISTRIBUTIONLIST
@return mixed A JSON decoded PHP variable representing the HTTP response | [
"Get",
"a",
"list",
"of",
"lists",
"given",
"a",
"list",
"type"
] | 42c20a3ded1d8f2177c792cd3aa44bcdfdcb239c | https://github.com/PopSugar/php-yesmail-api/blob/42c20a3ded1d8f2177c792cd3aa44bcdfdcb239c/src/Yesmail/Yesmail.php#L575-L584 |
204,159 | PopSugar/php-yesmail-api | src/Yesmail/Yesmail.php | Yesmail.ListManagement_Update_List | public function ListManagement_Update_List($modifyList) {
$ret = false;
if ($modifyList instanceof \Yesmail\YesmailListManagementModifyList && $modifyList->is_valid() === true) {
$name = rawurlencode($modifyList->name);
$type = rawurlencode($modifyList->type);
$ret =... | php | public function ListManagement_Update_List($modifyList) {
$ret = false;
if ($modifyList instanceof \Yesmail\YesmailListManagementModifyList && $modifyList->is_valid() === true) {
$name = rawurlencode($modifyList->name);
$type = rawurlencode($modifyList->type);
$ret =... | [
"public",
"function",
"ListManagement_Update_List",
"(",
"$",
"modifyList",
")",
"{",
"$",
"ret",
"=",
"false",
";",
"if",
"(",
"$",
"modifyList",
"instanceof",
"\\",
"Yesmail",
"\\",
"YesmailListManagementModifyList",
"&&",
"$",
"modifyList",
"->",
"is_valid",
... | Either remove or append the subscribers identified in the payload. For subscriberIds and emails that are
submitted as part of a request that cannot be mapped back to existing subscriber data are ignored and a total
count of the number added users is returned as part of the status message.
@param object $modifyList
@re... | [
"Either",
"remove",
"or",
"append",
"the",
"subscribers",
"identified",
"in",
"the",
"payload",
".",
"For",
"subscriberIds",
"and",
"emails",
"that",
"are",
"submitted",
"as",
"part",
"of",
"a",
"request",
"that",
"cannot",
"be",
"mapped",
"back",
"to",
"exi... | 42c20a3ded1d8f2177c792cd3aa44bcdfdcb239c | https://github.com/PopSugar/php-yesmail-api/blob/42c20a3ded1d8f2177c792cd3aa44bcdfdcb239c/src/Yesmail/Yesmail.php#L614-L624 |
204,160 | PopSugar/php-yesmail-api | src/Yesmail/Yesmail.php | Yesmail.ListManagement_Create_List | public function ListManagement_Create_List($modifyList) {
$ret = false;
if ($modifyList instanceof \Yesmail\YesmailListManagementModifyList && $modifyList->is_valid() === true) {
$ret = $this->_call_api('post', "{$this->_url}/lists/{$modifyList->type}", $modifyList);
}
retu... | php | public function ListManagement_Create_List($modifyList) {
$ret = false;
if ($modifyList instanceof \Yesmail\YesmailListManagementModifyList && $modifyList->is_valid() === true) {
$ret = $this->_call_api('post', "{$this->_url}/lists/{$modifyList->type}", $modifyList);
}
retu... | [
"public",
"function",
"ListManagement_Create_List",
"(",
"$",
"modifyList",
")",
"{",
"$",
"ret",
"=",
"false",
";",
"if",
"(",
"$",
"modifyList",
"instanceof",
"\\",
"Yesmail",
"\\",
"YesmailListManagementModifyList",
"&&",
"$",
"modifyList",
"->",
"is_valid",
... | Create a new list of the given type
@param object $modifyList
@return mixed A JSON decoded PHP variable representing the HTTP response | [
"Create",
"a",
"new",
"list",
"of",
"the",
"given",
"type"
] | 42c20a3ded1d8f2177c792cd3aa44bcdfdcb239c | https://github.com/PopSugar/php-yesmail-api/blob/42c20a3ded1d8f2177c792cd3aa44bcdfdcb239c/src/Yesmail/Yesmail.php#L632-L640 |
204,161 | PopSugar/php-yesmail-api | src/Yesmail/Yesmail.php | Yesmail._package_master_elements | protected function _package_master_elements($envelope, $targeting, $scheduling) {
$ret = false;
if ($envelope instanceof \Yesmail\YesmailMasterEnvelope && $envelope->is_valid() === true) {
$ret = new \stdClass();
$ret->envelope = $envelope;
if ($targeting instanceof... | php | protected function _package_master_elements($envelope, $targeting, $scheduling) {
$ret = false;
if ($envelope instanceof \Yesmail\YesmailMasterEnvelope && $envelope->is_valid() === true) {
$ret = new \stdClass();
$ret->envelope = $envelope;
if ($targeting instanceof... | [
"protected",
"function",
"_package_master_elements",
"(",
"$",
"envelope",
",",
"$",
"targeting",
",",
"$",
"scheduling",
")",
"{",
"$",
"ret",
"=",
"false",
";",
"if",
"(",
"$",
"envelope",
"instanceof",
"\\",
"Yesmail",
"\\",
"YesmailMasterEnvelope",
"&&",
... | Package a Master's envelope, targeting, and scheduling for sending in a request
@param object $envelope The Master's envelope
@param mixed $targeting [optional] Optional targeting parameters for the new master
@param mixed $scheduling [optional] Optional scheduling parameters for the new master
@return mixed Either a ... | [
"Package",
"a",
"Master",
"s",
"envelope",
"targeting",
"and",
"scheduling",
"for",
"sending",
"in",
"a",
"request"
] | 42c20a3ded1d8f2177c792cd3aa44bcdfdcb239c | https://github.com/PopSugar/php-yesmail-api/blob/42c20a3ded1d8f2177c792cd3aa44bcdfdcb239c/src/Yesmail/Yesmail.php#L681-L698 |
204,162 | PopSugar/php-yesmail-api | src/Yesmail/Yesmail.php | Yesmail._call_api | protected function _call_api( $method, $url, $params ) {
$raw_response = $this->_client->$method($url, $params);
$info = $this->_client->get_info();
if ($info['http_code'] != null) {
switch ($info["http_code"]) {
case 200:
case 202:
... | php | protected function _call_api( $method, $url, $params ) {
$raw_response = $this->_client->$method($url, $params);
$info = $this->_client->get_info();
if ($info['http_code'] != null) {
switch ($info["http_code"]) {
case 200:
case 202:
... | [
"protected",
"function",
"_call_api",
"(",
"$",
"method",
",",
"$",
"url",
",",
"$",
"params",
")",
"{",
"$",
"raw_response",
"=",
"$",
"this",
"->",
"_client",
"->",
"$",
"method",
"(",
"$",
"url",
",",
"$",
"params",
")",
";",
"$",
"info",
"=",
... | Make a call to the Yesmail API
@param string $method Any of {'get', 'put', 'post', 'delete'}
@param string $url The url of the API call
@param mixed $params An object or array of parameters to submit in the request
@return mixed A JSON decoded PHP variable representing the HTTP response.
@access protected
@throws Exce... | [
"Make",
"a",
"call",
"to",
"the",
"Yesmail",
"API"
] | 42c20a3ded1d8f2177c792cd3aa44bcdfdcb239c | https://github.com/PopSugar/php-yesmail-api/blob/42c20a3ded1d8f2177c792cd3aa44bcdfdcb239c/src/Yesmail/Yesmail.php#L735-L762 |
204,163 | pmdevelopment/tool-bundle | Twig/TimeExtension.php | TimeExtension.getSecondsAsText | public function getSecondsAsText($seconds, $decimals = 2, $decPoint = ',', $thousandsSep = '.')
{
$seconds = floatval($seconds);
if (60 > $seconds) {
return sprintf('%ss', number_format($seconds, $decimals, $decPoint, $thousandsSep));
}
$minutes = floor($seconds / 60);
... | php | public function getSecondsAsText($seconds, $decimals = 2, $decPoint = ',', $thousandsSep = '.')
{
$seconds = floatval($seconds);
if (60 > $seconds) {
return sprintf('%ss', number_format($seconds, $decimals, $decPoint, $thousandsSep));
}
$minutes = floor($seconds / 60);
... | [
"public",
"function",
"getSecondsAsText",
"(",
"$",
"seconds",
",",
"$",
"decimals",
"=",
"2",
",",
"$",
"decPoint",
"=",
"','",
",",
"$",
"thousandsSep",
"=",
"'.'",
")",
"{",
"$",
"seconds",
"=",
"floatval",
"(",
"$",
"seconds",
")",
";",
"if",
"("... | Get Seconds As Text
@param float $seconds
@param int $decimals
@param string $decPoint
@param string $thousandsSep
@return string | [
"Get",
"Seconds",
"As",
"Text"
] | 2cbc9f82c5b33fd7a9d389edd3676e9f70ea8129 | https://github.com/pmdevelopment/tool-bundle/blob/2cbc9f82c5b33fd7a9d389edd3676e9f70ea8129/Twig/TimeExtension.php#L82-L100 |
204,164 | pmdevelopment/tool-bundle | Twig/TimeExtension.php | TimeExtension.getSecondsAsTextExtended | public function getSecondsAsTextExtended($seconds)
{
$seconds = floatval($seconds);
$result = [];
$steps = [
'days' => 86400,
'hours' => 3600,
'minutes' => 60,
'seconds' => 1,
];
foreach ($steps as $stepName => $stepDivid... | php | public function getSecondsAsTextExtended($seconds)
{
$seconds = floatval($seconds);
$result = [];
$steps = [
'days' => 86400,
'hours' => 3600,
'minutes' => 60,
'seconds' => 1,
];
foreach ($steps as $stepName => $stepDivid... | [
"public",
"function",
"getSecondsAsTextExtended",
"(",
"$",
"seconds",
")",
"{",
"$",
"seconds",
"=",
"floatval",
"(",
"$",
"seconds",
")",
";",
"$",
"result",
"=",
"[",
"]",
";",
"$",
"steps",
"=",
"[",
"'days'",
"=>",
"86400",
",",
"'hours'",
"=>",
... | Get Seconds As Text Extended
@param float $seconds
@return string | [
"Get",
"Seconds",
"As",
"Text",
"Extended"
] | 2cbc9f82c5b33fd7a9d389edd3676e9f70ea8129 | https://github.com/pmdevelopment/tool-bundle/blob/2cbc9f82c5b33fd7a9d389edd3676e9f70ea8129/Twig/TimeExtension.php#L109-L130 |
204,165 | headzoo/web-tools | src/Headzoo/Web/Tools/WebClient.php | WebClient.validate | protected function validate()
{
if ($this->method === HttpMethods::POST && empty($this->data)) {
throw new Exceptions\WebException(
"Using method POST without data."
);
}
} | php | protected function validate()
{
if ($this->method === HttpMethods::POST && empty($this->data)) {
throw new Exceptions\WebException(
"Using method POST without data."
);
}
} | [
"protected",
"function",
"validate",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"method",
"===",
"HttpMethods",
"::",
"POST",
"&&",
"empty",
"(",
"$",
"this",
"->",
"data",
")",
")",
"{",
"throw",
"new",
"Exceptions",
"\\",
"WebException",
"(",
"\"Us... | Validates the request values for correctness
@throws Exceptions\WebException When an incorrect value is found | [
"Validates",
"the",
"request",
"values",
"for",
"correctness"
] | 305ce78029b86fa1fadaf8341d8fc737c84eab87 | https://github.com/headzoo/web-tools/blob/305ce78029b86fa1fadaf8341d8fc737c84eab87/src/Headzoo/Web/Tools/WebClient.php#L297-L304 |
204,166 | headzoo/web-tools | src/Headzoo/Web/Tools/WebClient.php | WebClient.prepareCurl | protected function prepareCurl()
{
$this->curl = curl_init();
$this->complete = Complete::factory(function() {
if ($this->curl) {
curl_close($this->curl);
}
$this->curl = null;
$this->complete = null;
});
foreach(se... | php | protected function prepareCurl()
{
$this->curl = curl_init();
$this->complete = Complete::factory(function() {
if ($this->curl) {
curl_close($this->curl);
}
$this->curl = null;
$this->complete = null;
});
foreach(se... | [
"protected",
"function",
"prepareCurl",
"(",
")",
"{",
"$",
"this",
"->",
"curl",
"=",
"curl_init",
"(",
")",
";",
"$",
"this",
"->",
"complete",
"=",
"Complete",
"::",
"factory",
"(",
"function",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"curl",
... | Initializes the curl resource | [
"Initializes",
"the",
"curl",
"resource"
] | 305ce78029b86fa1fadaf8341d8fc737c84eab87 | https://github.com/headzoo/web-tools/blob/305ce78029b86fa1fadaf8341d8fc737c84eab87/src/Headzoo/Web/Tools/WebClient.php#L309-L333 |
204,167 | headzoo/web-tools | src/Headzoo/Web/Tools/WebClient.php | WebClient.prepareData | protected function prepareData()
{
if (!empty($this->data)) {
if ($this->method === HttpMethods::GET) {
$this->url = Utils::appendUrlQuery($this->url, $this->data);
} else if ($this->method === HttpMethods::POST) {
curl_setopt($this->curl, CURLOPT_POST... | php | protected function prepareData()
{
if (!empty($this->data)) {
if ($this->method === HttpMethods::GET) {
$this->url = Utils::appendUrlQuery($this->url, $this->data);
} else if ($this->method === HttpMethods::POST) {
curl_setopt($this->curl, CURLOPT_POST... | [
"protected",
"function",
"prepareData",
"(",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"this",
"->",
"data",
")",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"method",
"===",
"HttpMethods",
"::",
"GET",
")",
"{",
"$",
"this",
"->",
"url",
"=",
"Ut... | Adds the data value to the curl request | [
"Adds",
"the",
"data",
"value",
"to",
"the",
"curl",
"request"
] | 305ce78029b86fa1fadaf8341d8fc737c84eab87 | https://github.com/headzoo/web-tools/blob/305ce78029b86fa1fadaf8341d8fc737c84eab87/src/Headzoo/Web/Tools/WebClient.php#L338-L347 |
204,168 | headzoo/web-tools | src/Headzoo/Web/Tools/WebClient.php | WebClient.prepareHeaders | protected function prepareHeaders()
{
// Need to let curl set the content type when posting. Our own content type
// value would overwrite that.
if ($this->method === HttpMethods::POST && !empty($this->headers["Content-Type"])) {
unset($this->headers["Content-Type"]);
}
... | php | protected function prepareHeaders()
{
// Need to let curl set the content type when posting. Our own content type
// value would overwrite that.
if ($this->method === HttpMethods::POST && !empty($this->headers["Content-Type"])) {
unset($this->headers["Content-Type"]);
}
... | [
"protected",
"function",
"prepareHeaders",
"(",
")",
"{",
"// Need to let curl set the content type when posting. Our own content type",
"// value would overwrite that.",
"if",
"(",
"$",
"this",
"->",
"method",
"===",
"HttpMethods",
"::",
"POST",
"&&",
"!",
"empty",
"(",
... | Adds the set headers to the curl request | [
"Adds",
"the",
"set",
"headers",
"to",
"the",
"curl",
"request"
] | 305ce78029b86fa1fadaf8341d8fc737c84eab87 | https://github.com/headzoo/web-tools/blob/305ce78029b86fa1fadaf8341d8fc737c84eab87/src/Headzoo/Web/Tools/WebClient.php#L352-L365 |
204,169 | headzoo/web-tools | src/Headzoo/Web/Tools/WebClient.php | WebClient.exec | protected function exec()
{
curl_setopt($this->curl, CURLOPT_URL, $this->url);
$response_text = curl_exec($this->curl);
$this->info = curl_getinfo($this->curl);
$this->logInformation();
if (false === $response_text) {
throw new Exceptions\WebException(... | php | protected function exec()
{
curl_setopt($this->curl, CURLOPT_URL, $this->url);
$response_text = curl_exec($this->curl);
$this->info = curl_getinfo($this->curl);
$this->logInformation();
if (false === $response_text) {
throw new Exceptions\WebException(... | [
"protected",
"function",
"exec",
"(",
")",
"{",
"curl_setopt",
"(",
"$",
"this",
"->",
"curl",
",",
"CURLOPT_URL",
",",
"$",
"this",
"->",
"url",
")",
";",
"$",
"response_text",
"=",
"curl_exec",
"(",
"$",
"this",
"->",
"curl",
")",
";",
"$",
"this",... | Executes the configured request | [
"Executes",
"the",
"configured",
"request"
] | 305ce78029b86fa1fadaf8341d8fc737c84eab87 | https://github.com/headzoo/web-tools/blob/305ce78029b86fa1fadaf8341d8fc737c84eab87/src/Headzoo/Web/Tools/WebClient.php#L370-L401 |
204,170 | headzoo/web-tools | src/Headzoo/Web/Tools/WebClient.php | WebClient.logInformation | protected function logInformation()
{
if ($this->logger) {
$level = $this->info["http_code"] > 0 && $this->info["http_code"] < 400
? LogLevel::INFO
: LogLevel::ERROR;
$this->info["method"] = $this->method;
$this->logger->log($level, $this->... | php | protected function logInformation()
{
if ($this->logger) {
$level = $this->info["http_code"] > 0 && $this->info["http_code"] < 400
? LogLevel::INFO
: LogLevel::ERROR;
$this->info["method"] = $this->method;
$this->logger->log($level, $this->... | [
"protected",
"function",
"logInformation",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"logger",
")",
"{",
"$",
"level",
"=",
"$",
"this",
"->",
"info",
"[",
"\"http_code\"",
"]",
">",
"0",
"&&",
"$",
"this",
"->",
"info",
"[",
"\"http_code\"",
"]",... | Logs request information when logging is enabled | [
"Logs",
"request",
"information",
"when",
"logging",
"is",
"enabled"
] | 305ce78029b86fa1fadaf8341d8fc737c84eab87 | https://github.com/headzoo/web-tools/blob/305ce78029b86fa1fadaf8341d8fc737c84eab87/src/Headzoo/Web/Tools/WebClient.php#L406-L415 |
204,171 | andyburton/Sonic-Framework | src/Resource/IP.php | IP.Allow | public function Allow ($range)
{
$formatted = $this->formatRange ($range);
if (!$formatted)
{
return FALSE;
}
$this->allowIPs[$formatted[0]] = $formatted[1];
return TRUE;
} | php | public function Allow ($range)
{
$formatted = $this->formatRange ($range);
if (!$formatted)
{
return FALSE;
}
$this->allowIPs[$formatted[0]] = $formatted[1];
return TRUE;
} | [
"public",
"function",
"Allow",
"(",
"$",
"range",
")",
"{",
"$",
"formatted",
"=",
"$",
"this",
"->",
"formatRange",
"(",
"$",
"range",
")",
";",
"if",
"(",
"!",
"$",
"formatted",
")",
"{",
"return",
"FALSE",
";",
"}",
"$",
"this",
"->",
"allowIPs"... | Add an IP address range to allow
Return FALSE is the IP range is invalid
@see formatRange ()
@param string $range IP range to allow
@return boolean | [
"Add",
"an",
"IP",
"address",
"range",
"to",
"allow",
"Return",
"FALSE",
"is",
"the",
"IP",
"range",
"is",
"invalid"
] | a5999448a0abab4d542413002a780ede391e7374 | https://github.com/andyburton/Sonic-Framework/blob/a5999448a0abab4d542413002a780ede391e7374/src/Resource/IP.php#L37-L50 |
204,172 | andyburton/Sonic-Framework | src/Resource/IP.php | IP.Deny | public function Deny ($range)
{
$formatted = $this->formatRange ($range);
if (!$formatted)
{
return FALSE;
}
$this->denyIPs[$formatted[0]] = $formatted[1];
return TRUE;
} | php | public function Deny ($range)
{
$formatted = $this->formatRange ($range);
if (!$formatted)
{
return FALSE;
}
$this->denyIPs[$formatted[0]] = $formatted[1];
return TRUE;
} | [
"public",
"function",
"Deny",
"(",
"$",
"range",
")",
"{",
"$",
"formatted",
"=",
"$",
"this",
"->",
"formatRange",
"(",
"$",
"range",
")",
";",
"if",
"(",
"!",
"$",
"formatted",
")",
"{",
"return",
"FALSE",
";",
"}",
"$",
"this",
"->",
"denyIPs",
... | Add an IP address range to deny
Return FALSE is the IP range is invalid
@see formatRange ()
@param string $range IP range to deny
@return boolean | [
"Add",
"an",
"IP",
"address",
"range",
"to",
"deny",
"Return",
"FALSE",
"is",
"the",
"IP",
"range",
"is",
"invalid"
] | a5999448a0abab4d542413002a780ede391e7374 | https://github.com/andyburton/Sonic-Framework/blob/a5999448a0abab4d542413002a780ede391e7374/src/Resource/IP.php#L61-L74 |
204,173 | andyburton/Sonic-Framework | src/Resource/IP.php | IP.removeAllowed | public function removeAllowed ($range)
{
$formatted = $this->formatRange ($range);
if (!$formatted)
{
return FALSE;
}
unset ($this->allowIPs[$formatted[0]]);
return TRUE;
} | php | public function removeAllowed ($range)
{
$formatted = $this->formatRange ($range);
if (!$formatted)
{
return FALSE;
}
unset ($this->allowIPs[$formatted[0]]);
return TRUE;
} | [
"public",
"function",
"removeAllowed",
"(",
"$",
"range",
")",
"{",
"$",
"formatted",
"=",
"$",
"this",
"->",
"formatRange",
"(",
"$",
"range",
")",
";",
"if",
"(",
"!",
"$",
"formatted",
")",
"{",
"return",
"FALSE",
";",
"}",
"unset",
"(",
"$",
"t... | Remove an allowed IP address range
Return FALSE is the IP range is invalid
@param string $range IP range to remove
@return boolean | [
"Remove",
"an",
"allowed",
"IP",
"address",
"range",
"Return",
"FALSE",
"is",
"the",
"IP",
"range",
"is",
"invalid"
] | a5999448a0abab4d542413002a780ede391e7374 | https://github.com/andyburton/Sonic-Framework/blob/a5999448a0abab4d542413002a780ede391e7374/src/Resource/IP.php#L84-L97 |
204,174 | andyburton/Sonic-Framework | src/Resource/IP.php | IP.removeDenied | public function removeDenied ($range)
{
$formatted = $this->formatRange ($range);
if (!$formatted)
{
return FALSE;
}
unset ($this->denyIPs[$formatted[0]]);
return TRUE;
} | php | public function removeDenied ($range)
{
$formatted = $this->formatRange ($range);
if (!$formatted)
{
return FALSE;
}
unset ($this->denyIPs[$formatted[0]]);
return TRUE;
} | [
"public",
"function",
"removeDenied",
"(",
"$",
"range",
")",
"{",
"$",
"formatted",
"=",
"$",
"this",
"->",
"formatRange",
"(",
"$",
"range",
")",
";",
"if",
"(",
"!",
"$",
"formatted",
")",
"{",
"return",
"FALSE",
";",
"}",
"unset",
"(",
"$",
"th... | Remove a denied IP address range
Return FALSE is the IP range is invalid
@param string $range IP range to remove
@return boolean | [
"Remove",
"a",
"denied",
"IP",
"address",
"range",
"Return",
"FALSE",
"is",
"the",
"IP",
"range",
"is",
"invalid"
] | a5999448a0abab4d542413002a780ede391e7374 | https://github.com/andyburton/Sonic-Framework/blob/a5999448a0abab4d542413002a780ede391e7374/src/Resource/IP.php#L107-L120 |
204,175 | andyburton/Sonic-Framework | src/Resource/IP.php | IP.formatRange | public function formatRange ($range)
{
// CIDR
if (strpos ($range, '/') !== FALSE)
{
// Get the IP and netmask
list ($ip, $netmask) = explode ('/', $range, 2);
// Split decimal and pad to ensure we have 4 octets
$ip = implode ('.', array_pad (explode ('.', $ip), 4, 0));
// I... | php | public function formatRange ($range)
{
// CIDR
if (strpos ($range, '/') !== FALSE)
{
// Get the IP and netmask
list ($ip, $netmask) = explode ('/', $range, 2);
// Split decimal and pad to ensure we have 4 octets
$ip = implode ('.', array_pad (explode ('.', $ip), 4, 0));
// I... | [
"public",
"function",
"formatRange",
"(",
"$",
"range",
")",
"{",
"// CIDR",
"if",
"(",
"strpos",
"(",
"$",
"range",
",",
"'/'",
")",
"!==",
"FALSE",
")",
"{",
"// Get the IP and netmask",
"list",
"(",
"$",
"ip",
",",
"$",
"netmask",
")",
"=",
"explode... | Format an IP address range
Valid IP ranges can be:
Single: 192.168.1.1
CIDR: 192.168.1/24, 192.168.1.0/24 or 192.168.1.0/255.255.255.0
Wildcard: 192.168.1.*
Start-End: 192.168.1.0-192.168.1.255
@param string $range Valid IP range
@return FALSE|array (name, range) | [
"Format",
"an",
"IP",
"address",
"range"
] | a5999448a0abab4d542413002a780ede391e7374 | https://github.com/andyburton/Sonic-Framework/blob/a5999448a0abab4d542413002a780ede391e7374/src/Resource/IP.php#L182-L325 |
204,176 | andyburton/Sonic-Framework | src/Resource/IP.php | IP.isInside | protected function isInside ($ip, $name, $range)
{
// Single IP
if (!is_array ($range))
{
if ($ip == $range)
{
return TRUE;
}
}
// CIDR
elseif (strpos ($name, '/') !== FALSE)
{
if (($ip & $range[1]) == ($range[0] & $range[1]))
{
return TRUE;
}
}
// Start-End
elseif... | php | protected function isInside ($ip, $name, $range)
{
// Single IP
if (!is_array ($range))
{
if ($ip == $range)
{
return TRUE;
}
}
// CIDR
elseif (strpos ($name, '/') !== FALSE)
{
if (($ip & $range[1]) == ($range[0] & $range[1]))
{
return TRUE;
}
}
// Start-End
elseif... | [
"protected",
"function",
"isInside",
"(",
"$",
"ip",
",",
"$",
"name",
",",
"$",
"range",
")",
"{",
"// Single IP",
"if",
"(",
"!",
"is_array",
"(",
"$",
"range",
")",
")",
"{",
"if",
"(",
"$",
"ip",
"==",
"$",
"range",
")",
"{",
"return",
"TRUE"... | Return whether an IP is inside a range
@param intger $ip IP decimal to check
@param string $name IP Range name
@param string|array $range Valid IP range
@return boolean | [
"Return",
"whether",
"an",
"IP",
"is",
"inside",
"a",
"range"
] | a5999448a0abab4d542413002a780ede391e7374 | https://github.com/andyburton/Sonic-Framework/blob/a5999448a0abab4d542413002a780ede391e7374/src/Resource/IP.php#L336-L373 |
204,177 | andyburton/Sonic-Framework | src/Resource/IP.php | IP.isAllowed | public function isAllowed ($ip, $priority = 'deny,allow')
{
// Convert IP to decimal
$ipDec = (float)sprintf ("%u", ip2long ($ip));
// Check
foreach (explode (',', $priority) as $type)
{
switch ($type)
{
// Check if the IP is allowed
case 'allow':
foreach ($... | php | public function isAllowed ($ip, $priority = 'deny,allow')
{
// Convert IP to decimal
$ipDec = (float)sprintf ("%u", ip2long ($ip));
// Check
foreach (explode (',', $priority) as $type)
{
switch ($type)
{
// Check if the IP is allowed
case 'allow':
foreach ($... | [
"public",
"function",
"isAllowed",
"(",
"$",
"ip",
",",
"$",
"priority",
"=",
"'deny,allow'",
")",
"{",
"// Convert IP to decimal",
"$",
"ipDec",
"=",
"(",
"float",
")",
"sprintf",
"(",
"\"%u\"",
",",
"ip2long",
"(",
"$",
"ip",
")",
")",
";",
"// Check",... | Return whether an IP is allowed
@param string $ip IPv4 address
@param string $priority Order priority, default deny,allow
@return boolean | [
"Return",
"whether",
"an",
"IP",
"is",
"allowed"
] | a5999448a0abab4d542413002a780ede391e7374 | https://github.com/andyburton/Sonic-Framework/blob/a5999448a0abab4d542413002a780ede391e7374/src/Resource/IP.php#L383-L434 |
204,178 | alphacomm/alpharpc | src/AlphaRPC/Console/Command/WorkerStatus.php | WorkerStatus.row | protected function row($worker, $service, $current, $ready, $valid)
{
$mask = "| %-10.10s | %-40.40s | %-40.40s | %-5s | %-5s |";
$text = sprintf($mask, $worker, $service, $current, $ready, $valid);
$this->output->writeln($text);
} | php | protected function row($worker, $service, $current, $ready, $valid)
{
$mask = "| %-10.10s | %-40.40s | %-40.40s | %-5s | %-5s |";
$text = sprintf($mask, $worker, $service, $current, $ready, $valid);
$this->output->writeln($text);
} | [
"protected",
"function",
"row",
"(",
"$",
"worker",
",",
"$",
"service",
",",
"$",
"current",
",",
"$",
"ready",
",",
"$",
"valid",
")",
"{",
"$",
"mask",
"=",
"\"| %-10.10s | %-40.40s | %-40.40s | %-5s | %-5s |\"",
";",
"$",
"text",
"=",
"sprintf",
"(",
"... | Print a single line with information.
@param $worker
@param $service
@param $current
@param $ready
@param $valid | [
"Print",
"a",
"single",
"line",
"with",
"information",
"."
] | cf162854500554c4ba8d39f2675de35a49c30ed0 | https://github.com/alphacomm/alpharpc/blob/cf162854500554c4ba8d39f2675de35a49c30ed0/src/AlphaRPC/Console/Command/WorkerStatus.php#L120-L125 |
204,179 | alphacomm/alpharpc | src/AlphaRPC/Common/Socket/Factory.php | Factory.parseValidKeys | protected static function parseValidKeys()
{
if (self::$validOptions !== null) {
return;
}
$refl = new ReflectionClass('\ZMQ');
$const = $refl->getConstants();
self::$validOptions = array();
foreach ($const as $key => $value) {
if (substr($key... | php | protected static function parseValidKeys()
{
if (self::$validOptions !== null) {
return;
}
$refl = new ReflectionClass('\ZMQ');
$const = $refl->getConstants();
self::$validOptions = array();
foreach ($const as $key => $value) {
if (substr($key... | [
"protected",
"static",
"function",
"parseValidKeys",
"(",
")",
"{",
"if",
"(",
"self",
"::",
"$",
"validOptions",
"!==",
"null",
")",
"{",
"return",
";",
"}",
"$",
"refl",
"=",
"new",
"ReflectionClass",
"(",
"'\\ZMQ'",
")",
";",
"$",
"const",
"=",
"$",... | Fills the attribute validOptions containing a list of options that
can be set.
@return null | [
"Fills",
"the",
"attribute",
"validOptions",
"containing",
"a",
"list",
"of",
"options",
"that",
"can",
"be",
"set",
"."
] | cf162854500554c4ba8d39f2675de35a49c30ed0 | https://github.com/alphacomm/alpharpc/blob/cf162854500554c4ba8d39f2675de35a49c30ed0/src/AlphaRPC/Common/Socket/Factory.php#L73-L87 |
204,180 | alphacomm/alpharpc | src/AlphaRPC/Common/Socket/Factory.php | Factory.isOptionKeyValid | public function isOptionKeyValid($key)
{
self::parseValidKeys();
if (isset(self::$validOptions[$key])) {
return true;
}
return false;
} | php | public function isOptionKeyValid($key)
{
self::parseValidKeys();
if (isset(self::$validOptions[$key])) {
return true;
}
return false;
} | [
"public",
"function",
"isOptionKeyValid",
"(",
"$",
"key",
")",
"{",
"self",
"::",
"parseValidKeys",
"(",
")",
";",
"if",
"(",
"isset",
"(",
"self",
"::",
"$",
"validOptions",
"[",
"$",
"key",
"]",
")",
")",
"{",
"return",
"true",
";",
"}",
"return",... | Checks if the given option key is valid for ZMQ.
@param mixed $key
@return boolean | [
"Checks",
"if",
"the",
"given",
"option",
"key",
"is",
"valid",
"for",
"ZMQ",
"."
] | cf162854500554c4ba8d39f2675de35a49c30ed0 | https://github.com/alphacomm/alpharpc/blob/cf162854500554c4ba8d39f2675de35a49c30ed0/src/AlphaRPC/Common/Socket/Factory.php#L96-L105 |
204,181 | alphacomm/alpharpc | src/AlphaRPC/Common/Socket/Factory.php | Factory.addOption | public function addOption($key, $value)
{
if (!$this->isOptionKeyValid($key)) {
throw new \RuntimeException('Invalid socket option '.$key.'.');
}
$this->options[$key] = $value;
return $this;
} | php | public function addOption($key, $value)
{
if (!$this->isOptionKeyValid($key)) {
throw new \RuntimeException('Invalid socket option '.$key.'.');
}
$this->options[$key] = $value;
return $this;
} | [
"public",
"function",
"addOption",
"(",
"$",
"key",
",",
"$",
"value",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"isOptionKeyValid",
"(",
"$",
"key",
")",
")",
"{",
"throw",
"new",
"\\",
"RuntimeException",
"(",
"'Invalid socket option '",
".",
"$",
... | Overrides a default ZMQ option.
@param int $key
@param mixed $value
@return \AlphaRPC\Common\Socket\Factory
@throws \RuntimeException | [
"Overrides",
"a",
"default",
"ZMQ",
"option",
"."
] | cf162854500554c4ba8d39f2675de35a49c30ed0 | https://github.com/alphacomm/alpharpc/blob/cf162854500554c4ba8d39f2675de35a49c30ed0/src/AlphaRPC/Common/Socket/Factory.php#L116-L125 |
204,182 | alphacomm/alpharpc | src/AlphaRPC/Common/Socket/Factory.php | Factory.addOptions | public function addOptions($options)
{
foreach ($options as $key => $value) {
$this->addOption($key, $value);
}
return $this;
} | php | public function addOptions($options)
{
foreach ($options as $key => $value) {
$this->addOption($key, $value);
}
return $this;
} | [
"public",
"function",
"addOptions",
"(",
"$",
"options",
")",
"{",
"foreach",
"(",
"$",
"options",
"as",
"$",
"key",
"=>",
"$",
"value",
")",
"{",
"$",
"this",
"->",
"addOption",
"(",
"$",
"key",
",",
"$",
"value",
")",
";",
"}",
"return",
"$",
"... | Adds ZMQ socket options.
@param array $options
@return \AlphaRPC\Common\Socket\Factory
@throws \RuntimeException | [
"Adds",
"ZMQ",
"socket",
"options",
"."
] | cf162854500554c4ba8d39f2675de35a49c30ed0 | https://github.com/alphacomm/alpharpc/blob/cf162854500554c4ba8d39f2675de35a49c30ed0/src/AlphaRPC/Common/Socket/Factory.php#L135-L142 |
204,183 | alphacomm/alpharpc | src/AlphaRPC/Common/Socket/Factory.php | Factory.createPublisher | public function createPublisher($mode, $dsn = null, $options = array())
{
return $this->createSocket(ZMQ::SOCKET_PUB, $mode, $dsn, $options);
} | php | public function createPublisher($mode, $dsn = null, $options = array())
{
return $this->createSocket(ZMQ::SOCKET_PUB, $mode, $dsn, $options);
} | [
"public",
"function",
"createPublisher",
"(",
"$",
"mode",
",",
"$",
"dsn",
"=",
"null",
",",
"$",
"options",
"=",
"array",
"(",
")",
")",
"{",
"return",
"$",
"this",
"->",
"createSocket",
"(",
"ZMQ",
"::",
"SOCKET_PUB",
",",
"$",
"mode",
",",
"$",
... | Creates a publiser socket.
@param string $mode
@param string|array $dsn
@param array $options
@return Socket | [
"Creates",
"a",
"publiser",
"socket",
"."
] | cf162854500554c4ba8d39f2675de35a49c30ed0 | https://github.com/alphacomm/alpharpc/blob/cf162854500554c4ba8d39f2675de35a49c30ed0/src/AlphaRPC/Common/Socket/Factory.php#L167-L170 |
204,184 | alphacomm/alpharpc | src/AlphaRPC/Common/Socket/Factory.php | Factory.createSubscriber | public function createSubscriber($mode, $dsn = null, $subscribe = '', $options = array())
{
$options[ZMQ::SOCKOPT_SUBSCRIBE] = $subscribe;
return $this->createSocket(ZMQ::SOCKET_SUB, $mode, $dsn, $options);
} | php | public function createSubscriber($mode, $dsn = null, $subscribe = '', $options = array())
{
$options[ZMQ::SOCKOPT_SUBSCRIBE] = $subscribe;
return $this->createSocket(ZMQ::SOCKET_SUB, $mode, $dsn, $options);
} | [
"public",
"function",
"createSubscriber",
"(",
"$",
"mode",
",",
"$",
"dsn",
"=",
"null",
",",
"$",
"subscribe",
"=",
"''",
",",
"$",
"options",
"=",
"array",
"(",
")",
")",
"{",
"$",
"options",
"[",
"ZMQ",
"::",
"SOCKOPT_SUBSCRIBE",
"]",
"=",
"$",
... | Creates a subscriber socket.
@param string $mode
@param string $subscribe
@param string|array $dsn
@param array $options
@return Socket | [
"Creates",
"a",
"subscriber",
"socket",
"."
] | cf162854500554c4ba8d39f2675de35a49c30ed0 | https://github.com/alphacomm/alpharpc/blob/cf162854500554c4ba8d39f2675de35a49c30ed0/src/AlphaRPC/Common/Socket/Factory.php#L182-L187 |
204,185 | alphacomm/alpharpc | src/AlphaRPC/Common/Socket/Factory.php | Factory.createRequest | public function createRequest($mode, $dsn = null, $options = array())
{
return $this->createSocket(ZMQ::SOCKET_REQ, $mode, $dsn, $options);
} | php | public function createRequest($mode, $dsn = null, $options = array())
{
return $this->createSocket(ZMQ::SOCKET_REQ, $mode, $dsn, $options);
} | [
"public",
"function",
"createRequest",
"(",
"$",
"mode",
",",
"$",
"dsn",
"=",
"null",
",",
"$",
"options",
"=",
"array",
"(",
")",
")",
"{",
"return",
"$",
"this",
"->",
"createSocket",
"(",
"ZMQ",
"::",
"SOCKET_REQ",
",",
"$",
"mode",
",",
"$",
"... | Creates a request socket.
@param string $mode
@param string|array $dsn
@param array $options
@return Socket | [
"Creates",
"a",
"request",
"socket",
"."
] | cf162854500554c4ba8d39f2675de35a49c30ed0 | https://github.com/alphacomm/alpharpc/blob/cf162854500554c4ba8d39f2675de35a49c30ed0/src/AlphaRPC/Common/Socket/Factory.php#L198-L201 |
204,186 | alphacomm/alpharpc | src/AlphaRPC/Common/Socket/Factory.php | Factory.createReply | public function createReply($mode, $dsn = null, $options = array())
{
return $this->createSocket(ZMQ::SOCKET_REP, $mode, $dsn, $options);
} | php | public function createReply($mode, $dsn = null, $options = array())
{
return $this->createSocket(ZMQ::SOCKET_REP, $mode, $dsn, $options);
} | [
"public",
"function",
"createReply",
"(",
"$",
"mode",
",",
"$",
"dsn",
"=",
"null",
",",
"$",
"options",
"=",
"array",
"(",
")",
")",
"{",
"return",
"$",
"this",
"->",
"createSocket",
"(",
"ZMQ",
"::",
"SOCKET_REP",
",",
"$",
"mode",
",",
"$",
"ds... | Creates a reply socket.
@param string $mode
@param string|array $dsn
@param array $options
@return Socket | [
"Creates",
"a",
"reply",
"socket",
"."
] | cf162854500554c4ba8d39f2675de35a49c30ed0 | https://github.com/alphacomm/alpharpc/blob/cf162854500554c4ba8d39f2675de35a49c30ed0/src/AlphaRPC/Common/Socket/Factory.php#L212-L215 |
204,187 | alphacomm/alpharpc | src/AlphaRPC/Common/Socket/Factory.php | Factory.createRouter | public function createRouter($mode, $dsn = null, $options = array())
{
return $this->createSocket(ZMQ::SOCKET_ROUTER, $mode, $dsn, $options);
} | php | public function createRouter($mode, $dsn = null, $options = array())
{
return $this->createSocket(ZMQ::SOCKET_ROUTER, $mode, $dsn, $options);
} | [
"public",
"function",
"createRouter",
"(",
"$",
"mode",
",",
"$",
"dsn",
"=",
"null",
",",
"$",
"options",
"=",
"array",
"(",
")",
")",
"{",
"return",
"$",
"this",
"->",
"createSocket",
"(",
"ZMQ",
"::",
"SOCKET_ROUTER",
",",
"$",
"mode",
",",
"$",
... | Creates a router socket.
@param string $mode
@param string|array $dsn
@param array $options
@return Socket | [
"Creates",
"a",
"router",
"socket",
"."
] | cf162854500554c4ba8d39f2675de35a49c30ed0 | https://github.com/alphacomm/alpharpc/blob/cf162854500554c4ba8d39f2675de35a49c30ed0/src/AlphaRPC/Common/Socket/Factory.php#L226-L229 |
204,188 | alphacomm/alpharpc | src/AlphaRPC/Common/Socket/Factory.php | Factory.createSocket | protected function createSocket($type, $mode, $dsn = null, $options = array())
{
$context = $this->getContext();
$socket = new Socket($context, $type);
$options = $this->options + $options;
foreach ($options as $key => $value) {
$socket->setSockOpt($key, $value);
... | php | protected function createSocket($type, $mode, $dsn = null, $options = array())
{
$context = $this->getContext();
$socket = new Socket($context, $type);
$options = $this->options + $options;
foreach ($options as $key => $value) {
$socket->setSockOpt($key, $value);
... | [
"protected",
"function",
"createSocket",
"(",
"$",
"type",
",",
"$",
"mode",
",",
"$",
"dsn",
"=",
"null",
",",
"$",
"options",
"=",
"array",
"(",
")",
")",
"{",
"$",
"context",
"=",
"$",
"this",
"->",
"getContext",
"(",
")",
";",
"$",
"socket",
... | Creates a socket.
@param int $type
@param string $mode
@param string $dsn
@param array $options
@return Socket | [
"Creates",
"a",
"socket",
"."
] | cf162854500554c4ba8d39f2675de35a49c30ed0 | https://github.com/alphacomm/alpharpc/blob/cf162854500554c4ba8d39f2675de35a49c30ed0/src/AlphaRPC/Common/Socket/Factory.php#L241-L254 |
204,189 | alphacomm/alpharpc | src/AlphaRPC/Common/Socket/Factory.php | Factory.connect | public function connect(ZMQSocket $socket, $mode, $dsn)
{
if ($mode == self::MODE_CONSTRUCT) {
return $this;
}
$func = null;
if ($mode == self::MODE_BIND) {
$func = 'bind';
} elseif ($mode == self::MODE_CONNECT) {
$func = 'connect';
... | php | public function connect(ZMQSocket $socket, $mode, $dsn)
{
if ($mode == self::MODE_CONSTRUCT) {
return $this;
}
$func = null;
if ($mode == self::MODE_BIND) {
$func = 'bind';
} elseif ($mode == self::MODE_CONNECT) {
$func = 'connect';
... | [
"public",
"function",
"connect",
"(",
"ZMQSocket",
"$",
"socket",
",",
"$",
"mode",
",",
"$",
"dsn",
")",
"{",
"if",
"(",
"$",
"mode",
"==",
"self",
"::",
"MODE_CONSTRUCT",
")",
"{",
"return",
"$",
"this",
";",
"}",
"$",
"func",
"=",
"null",
";",
... | Connects or binds a socket based on mode.
@param ZMQSocket $socket
@param string $mode
@param string|array $dsn
@return \AlphaRPC\Common\Socket\Factory
@throws \RuntimeException | [
"Connects",
"or",
"binds",
"a",
"socket",
"based",
"on",
"mode",
"."
] | cf162854500554c4ba8d39f2675de35a49c30ed0 | https://github.com/alphacomm/alpharpc/blob/cf162854500554c4ba8d39f2675de35a49c30ed0/src/AlphaRPC/Common/Socket/Factory.php#L266-L293 |
204,190 | Synapse-Cmf/synapse-cmf | src/Synapse/Cmf/Framework/Media/Media/Domain/ProxyDomain.php | ProxyDomain.registerMediaDomain | public function registerMediaDomain($extensions, DomainInterface $mediaDomain)
{
foreach ((array) $extensions as $extensions) {
$this->mediaDomainsMap[strtolower($extensions)] = $mediaDomain;
}
} | php | public function registerMediaDomain($extensions, DomainInterface $mediaDomain)
{
foreach ((array) $extensions as $extensions) {
$this->mediaDomainsMap[strtolower($extensions)] = $mediaDomain;
}
} | [
"public",
"function",
"registerMediaDomain",
"(",
"$",
"extensions",
",",
"DomainInterface",
"$",
"mediaDomain",
")",
"{",
"foreach",
"(",
"(",
"array",
")",
"$",
"extensions",
"as",
"$",
"extensions",
")",
"{",
"$",
"this",
"->",
"mediaDomainsMap",
"[",
"st... | Register a media domain for given file extension set.
@param string|array $extensions
@param DomainInterface $mediaDomain | [
"Register",
"a",
"media",
"domain",
"for",
"given",
"file",
"extension",
"set",
"."
] | d8122a4150a83d5607289724425cf35c56a5e880 | https://github.com/Synapse-Cmf/synapse-cmf/blob/d8122a4150a83d5607289724425cf35c56a5e880/src/Synapse/Cmf/Framework/Media/Media/Domain/ProxyDomain.php#L37-L42 |
204,191 | Synapse-Cmf/synapse-cmf | src/Synapse/Cmf/Framework/Media/Media/Domain/ProxyDomain.php | ProxyDomain.fetchDomain | private function fetchDomain($extension)
{
if (!array_key_exists($extension = strtolower($extension), $this->mediaDomainsMap)) {
throw new UnsupportedFileException(sprintf(
'Extension ".%s" isnt supported by Media component, only ["%s"] are.',
$extension,
... | php | private function fetchDomain($extension)
{
if (!array_key_exists($extension = strtolower($extension), $this->mediaDomainsMap)) {
throw new UnsupportedFileException(sprintf(
'Extension ".%s" isnt supported by Media component, only ["%s"] are.',
$extension,
... | [
"private",
"function",
"fetchDomain",
"(",
"$",
"extension",
")",
"{",
"if",
"(",
"!",
"array_key_exists",
"(",
"$",
"extension",
"=",
"strtolower",
"(",
"$",
"extension",
")",
",",
"$",
"this",
"->",
"mediaDomainsMap",
")",
")",
"{",
"throw",
"new",
"Un... | Fetch and return domain matching given file extension.
@param string $extension
@return DomainInterface
@throws UnsupportedFileException If given extension isnt supported | [
"Fetch",
"and",
"return",
"domain",
"matching",
"given",
"file",
"extension",
"."
] | d8122a4150a83d5607289724425cf35c56a5e880 | https://github.com/Synapse-Cmf/synapse-cmf/blob/d8122a4150a83d5607289724425cf35c56a5e880/src/Synapse/Cmf/Framework/Media/Media/Domain/ProxyDomain.php#L53-L64 |
204,192 | inhere/php-library-plus | libs/Auth/User.php | User.can | public function can($permission, array $params = [], $caching = true)
{
return $this->canAccess($permission, $params, $caching);
} | php | public function can($permission, array $params = [], $caching = true)
{
return $this->canAccess($permission, $params, $caching);
} | [
"public",
"function",
"can",
"(",
"$",
"permission",
",",
"array",
"$",
"params",
"=",
"[",
"]",
",",
"$",
"caching",
"=",
"true",
")",
"{",
"return",
"$",
"this",
"->",
"canAccess",
"(",
"$",
"permission",
",",
"$",
"params",
",",
"$",
"caching",
... | check user permission
@param string $permission a permission name or a url
@param array $params
@param bool|true $caching
@return bool | [
"check",
"user",
"permission"
] | 8604e037937d31fa2338d79aaf9d0910cb48f559 | https://github.com/inhere/php-library-plus/blob/8604e037937d31fa2338d79aaf9d0910cb48f559/libs/Auth/User.php#L162-L165 |
204,193 | PHPColibri/framework | Session/Session.php | Session.get | public static function get($dottedKey, $default = null)
{
if (self::$flashedVars) {
$flashedValue = Arr::get(self::$flashedVars, $dottedKey, '~no~flashed~value~');
if ($flashedValue !== '~no~flashed~value~') {
return $flashedValue;
}
}
ret... | php | public static function get($dottedKey, $default = null)
{
if (self::$flashedVars) {
$flashedValue = Arr::get(self::$flashedVars, $dottedKey, '~no~flashed~value~');
if ($flashedValue !== '~no~flashed~value~') {
return $flashedValue;
}
}
ret... | [
"public",
"static",
"function",
"get",
"(",
"$",
"dottedKey",
",",
"$",
"default",
"=",
"null",
")",
"{",
"if",
"(",
"self",
"::",
"$",
"flashedVars",
")",
"{",
"$",
"flashedValue",
"=",
"Arr",
"::",
"get",
"(",
"self",
"::",
"$",
"flashedVars",
",",... | Retrieve the value from session.
@param string $dottedKey
@param mixed $default
@return mixed | [
"Retrieve",
"the",
"value",
"from",
"session",
"."
] | 7e5b77141da5e5e7c63afc83592671321ac52f36 | https://github.com/PHPColibri/framework/blob/7e5b77141da5e5e7c63afc83592671321ac52f36/Session/Session.php#L53-L63 |
204,194 | cymapgt/logger | src/Logger.php | Logger.addLogHandler | public function addLogHandler(array $logHandlers, $createLogger = false) {
try {
$this->configuredLogHandlers = array_merge($this->configuredLogHandlers, $logHandlers);
if ($createLogger === true) {
$this->createLogger($this->channelName);
$this->createLo... | php | public function addLogHandler(array $logHandlers, $createLogger = false) {
try {
$this->configuredLogHandlers = array_merge($this->configuredLogHandlers, $logHandlers);
if ($createLogger === true) {
$this->createLogger($this->channelName);
$this->createLo... | [
"public",
"function",
"addLogHandler",
"(",
"array",
"$",
"logHandlers",
",",
"$",
"createLogger",
"=",
"false",
")",
"{",
"try",
"{",
"$",
"this",
"->",
"configuredLogHandlers",
"=",
"array_merge",
"(",
"$",
"this",
"->",
"configuredLogHandlers",
",",
"$",
... | Add log handlers to the configuration
@param array $logHandlers - Array of log handler configuration. The alphanumeric keys are the namespace
@param bool $createLogger - Boolean flag. If true, create concrete Logger and instantiate the log handlers | [
"Add",
"log",
"handlers",
"to",
"the",
"configuration"
] | 8d042b21a9e13a3597c99084229781ab6151d78f | https://github.com/cymapgt/logger/blob/8d042b21a9e13a3597c99084229781ab6151d78f/src/Logger.php#L72-L88 |
204,195 | cymapgt/logger | src/Logger.php | Logger.createLogHandlers | protected function createLogHandlers() {
$logHandlers = $this->configuredLogHandlers;
foreach ($logHandlers as $handlerNamespace => $handlerDetails) {
if (
is_array($handlerDetails)
&& array_key_exists('handler_parameters', $handlerDetai... | php | protected function createLogHandlers() {
$logHandlers = $this->configuredLogHandlers;
foreach ($logHandlers as $handlerNamespace => $handlerDetails) {
if (
is_array($handlerDetails)
&& array_key_exists('handler_parameters', $handlerDetai... | [
"protected",
"function",
"createLogHandlers",
"(",
")",
"{",
"$",
"logHandlers",
"=",
"$",
"this",
"->",
"configuredLogHandlers",
";",
"foreach",
"(",
"$",
"logHandlers",
"as",
"$",
"handlerNamespace",
"=>",
"$",
"handlerDetails",
")",
"{",
"if",
"(",
"is_arra... | Iterate the configured log handlers and create concrete handlers | [
"Iterate",
"the",
"configured",
"log",
"handlers",
"and",
"create",
"concrete",
"handlers"
] | 8d042b21a9e13a3597c99084229781ab6151d78f | https://github.com/cymapgt/logger/blob/8d042b21a9e13a3597c99084229781ab6151d78f/src/Logger.php#L102-L115 |
204,196 | cymapgt/logger | src/Logger.php | Logger._getLoggerStderr | private static function _getLoggerStderr() {
if (!isset(self::$loggerStderr)) {
$CymapgtStderrLogger = new MonologLogger('cymapgt_stderr');
$CymapgtStderrLogger->pushHandler(new ErrorLogHandler());
self::$loggerStderr = $CymapgtStderrLogger;
}
return s... | php | private static function _getLoggerStderr() {
if (!isset(self::$loggerStderr)) {
$CymapgtStderrLogger = new MonologLogger('cymapgt_stderr');
$CymapgtStderrLogger->pushHandler(new ErrorLogHandler());
self::$loggerStderr = $CymapgtStderrLogger;
}
return s... | [
"private",
"static",
"function",
"_getLoggerStderr",
"(",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"self",
"::",
"$",
"loggerStderr",
")",
")",
"{",
"$",
"CymapgtStderrLogger",
"=",
"new",
"MonologLogger",
"(",
"'cymapgt_stderr'",
")",
";",
"$",
"CymapgtStder... | return the stderr logger
@return object
@private
@static | [
"return",
"the",
"stderr",
"logger"
] | 8d042b21a9e13a3597c99084229781ab6151d78f | https://github.com/cymapgt/logger/blob/8d042b21a9e13a3597c99084229781ab6151d78f/src/Logger.php#L179-L186 |
204,197 | cymapgt/logger | src/Logger.php | Logger._getLoggerLevel1 | private static function _getLoggerLevel1($loggerParams) {
if (!isset(self::$loggerLevel1)) {
$CymapgtLevel1LogDir = $loggerParams['log_dir'];
$CymapgtLevel1Stream = new StreamHandler($CymapgtLevel1LogDir, MonologLogger::DEBUG);
$CymapgtLevel1Logger = new MonologLogger('cymapg... | php | private static function _getLoggerLevel1($loggerParams) {
if (!isset(self::$loggerLevel1)) {
$CymapgtLevel1LogDir = $loggerParams['log_dir'];
$CymapgtLevel1Stream = new StreamHandler($CymapgtLevel1LogDir, MonologLogger::DEBUG);
$CymapgtLevel1Logger = new MonologLogger('cymapg... | [
"private",
"static",
"function",
"_getLoggerLevel1",
"(",
"$",
"loggerParams",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"self",
"::",
"$",
"loggerLevel1",
")",
")",
"{",
"$",
"CymapgtLevel1LogDir",
"=",
"$",
"loggerParams",
"[",
"'log_dir'",
"]",
";",
"$",
... | return the level1 logger
@param array $loggerParams - Array of parameters to configure the level 1 logger
@return object
@private
@static | [
"return",
"the",
"level1",
"logger"
] | 8d042b21a9e13a3597c99084229781ab6151d78f | https://github.com/cymapgt/logger/blob/8d042b21a9e13a3597c99084229781ab6151d78f/src/Logger.php#L197-L206 |
204,198 | cymapgt/logger | src/Logger.php | Logger._getLoggerLevel2 | private static function _getLoggerLevel2($loggerParams) {
if (!isset(self::$loggerLevel2)) {
$CymapgtLevel2LogDir = $loggerParams['log_dir'];
$CymapgtLevel2Stream = new StreamHandler($CymapgtLevel2LogDir, MonologLogger::ERROR);
$CymapgtLevel2Logger = new MonologLogger... | php | private static function _getLoggerLevel2($loggerParams) {
if (!isset(self::$loggerLevel2)) {
$CymapgtLevel2LogDir = $loggerParams['log_dir'];
$CymapgtLevel2Stream = new StreamHandler($CymapgtLevel2LogDir, MonologLogger::ERROR);
$CymapgtLevel2Logger = new MonologLogger... | [
"private",
"static",
"function",
"_getLoggerLevel2",
"(",
"$",
"loggerParams",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"self",
"::",
"$",
"loggerLevel2",
")",
")",
"{",
"$",
"CymapgtLevel2LogDir",
"=",
"$",
"loggerParams",
"[",
"'log_dir'",
"]",
";",
"$",
... | return the level2 logger
@param array $loggerParams - Array of parameters to configure the level 2 logger
@return object
@private
@static | [
"return",
"the",
"level2",
"logger"
] | 8d042b21a9e13a3597c99084229781ab6151d78f | https://github.com/cymapgt/logger/blob/8d042b21a9e13a3597c99084229781ab6151d78f/src/Logger.php#L217-L229 |
204,199 | cymapgt/logger | src/Logger.php | Logger._getLoggerLevel3 | private static function _getLoggerLevel3($loggerParams) {
if (!isset(self::$loggerLevel3)) {
/*create notifier object for africas talking. If you are behind a proxy, the
*second parameter should be true, and your configuration array should contain
*the proxy serve... | php | private static function _getLoggerLevel3($loggerParams) {
if (!isset(self::$loggerLevel3)) {
/*create notifier object for africas talking. If you are behind a proxy, the
*second parameter should be true, and your configuration array should contain
*the proxy serve... | [
"private",
"static",
"function",
"_getLoggerLevel3",
"(",
"$",
"loggerParams",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"self",
"::",
"$",
"loggerLevel3",
")",
")",
"{",
"/*create notifier object for africas talking. If you are behind a proxy, the\n *second param... | return the level3 logger
@param array $loggerParams - Array of parameters to configure the level 3 logger
@return object
@private
@static | [
"return",
"the",
"level3",
"logger"
] | 8d042b21a9e13a3597c99084229781ab6151d78f | https://github.com/cymapgt/logger/blob/8d042b21a9e13a3597c99084229781ab6151d78f/src/Logger.php#L240-L262 |
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.