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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
221,800 | dwightwatson/breadcrumbs | src/Breadcrumbs/Manager.php | Manager.render | public function render()
{
if ($breadcrumbs = $this->generator->generate()) {
return $this->renderer->render(config('breadcrumbs.view'), $breadcrumbs);
}
} | php | public function render()
{
if ($breadcrumbs = $this->generator->generate()) {
return $this->renderer->render(config('breadcrumbs.view'), $breadcrumbs);
}
} | [
"public",
"function",
"render",
"(",
")",
"{",
"if",
"(",
"$",
"breadcrumbs",
"=",
"$",
"this",
"->",
"generator",
"->",
"generate",
"(",
")",
")",
"{",
"return",
"$",
"this",
"->",
"renderer",
"->",
"render",
"(",
"config",
"(",
"'breadcrumbs.view'",
... | Render the breadcrumbs as an HTML string.
@return \Illuminate\Support\HtmlString | [
"Render",
"the",
"breadcrumbs",
"as",
"an",
"HTML",
"string",
"."
] | b54dc7e1fc131749ff60c88115ca70bf7c6443ca | https://github.com/dwightwatson/breadcrumbs/blob/b54dc7e1fc131749ff60c88115ca70bf7c6443ca/src/Breadcrumbs/Manager.php#L40-L45 |
221,801 | Pageworks/craft-manytomany | src/services/ManyToManyService.php | ManyToManyService.getRelatedEntries | public function getRelatedEntries(ElementInterface $element, Section $section, string $field): array
{
$query = Entry::find();
$query->section = $section;
$query->limit = null;
$query->status = null;
$query->enabledForSite = null;
$query->relatedTo = [
't... | php | public function getRelatedEntries(ElementInterface $element, Section $section, string $field): array
{
$query = Entry::find();
$query->section = $section;
$query->limit = null;
$query->status = null;
$query->enabledForSite = null;
$query->relatedTo = [
't... | [
"public",
"function",
"getRelatedEntries",
"(",
"ElementInterface",
"$",
"element",
",",
"Section",
"$",
"section",
",",
"string",
"$",
"field",
")",
":",
"array",
"{",
"$",
"query",
"=",
"Entry",
"::",
"find",
"(",
")",
";",
"$",
"query",
"->",
"section... | Returns related entries from an element limited to a section.
@param ElementInterface $element
@param Section $section
@param string $field
@return Entry[] | [
"Returns",
"related",
"entries",
"from",
"an",
"element",
"limited",
"to",
"a",
"section",
"."
] | bd4d2e81e43428962e910cfd5a6b4a6aefc195f6 | https://github.com/Pageworks/craft-manytomany/blob/bd4d2e81e43428962e910cfd5a6b4a6aefc195f6/src/services/ManyToManyService.php#L24-L38 |
221,802 | dwightwatson/breadcrumbs | src/Breadcrumbs/Generator.php | Generator.register | public function register(string $name, Closure $definition)
{
$this->registrar->set($name, $definition);
} | php | public function register(string $name, Closure $definition)
{
$this->registrar->set($name, $definition);
} | [
"public",
"function",
"register",
"(",
"string",
"$",
"name",
",",
"Closure",
"$",
"definition",
")",
"{",
"$",
"this",
"->",
"registrar",
"->",
"set",
"(",
"$",
"name",
",",
"$",
"definition",
")",
";",
"}"
] | Register a definition with the registrar.
@param string $name
@param \Closure $definition
@return void
@throws \Watson\Breadcrumbs\Exceptions\DefinitionAlreadyExists | [
"Register",
"a",
"definition",
"with",
"the",
"registrar",
"."
] | b54dc7e1fc131749ff60c88115ca70bf7c6443ca | https://github.com/dwightwatson/breadcrumbs/blob/b54dc7e1fc131749ff60c88115ca70bf7c6443ca/src/Breadcrumbs/Generator.php#L53-L56 |
221,803 | dwightwatson/breadcrumbs | src/Breadcrumbs/Generator.php | Generator.generate | public function generate(): Collection
{
if ($this->route->present() && $this->registrar->has($this->route->name())) {
$this->call(
$this->route->name(),
$this->route->parameters()
);
}
return $this->breadcrumbs;
} | php | public function generate(): Collection
{
if ($this->route->present() && $this->registrar->has($this->route->name())) {
$this->call(
$this->route->name(),
$this->route->parameters()
);
}
return $this->breadcrumbs;
} | [
"public",
"function",
"generate",
"(",
")",
":",
"Collection",
"{",
"if",
"(",
"$",
"this",
"->",
"route",
"->",
"present",
"(",
")",
"&&",
"$",
"this",
"->",
"registrar",
"->",
"has",
"(",
"$",
"this",
"->",
"route",
"->",
"name",
"(",
")",
")",
... | Generate the collection of breadcrumbs from the given route.
@return \Illuminate\Support\Collection | [
"Generate",
"the",
"collection",
"of",
"breadcrumbs",
"from",
"the",
"given",
"route",
"."
] | b54dc7e1fc131749ff60c88115ca70bf7c6443ca | https://github.com/dwightwatson/breadcrumbs/blob/b54dc7e1fc131749ff60c88115ca70bf7c6443ca/src/Breadcrumbs/Generator.php#L63-L73 |
221,804 | dwightwatson/breadcrumbs | src/Breadcrumbs/Generator.php | Generator.add | public function add(string $title, string $url)
{
$this->breadcrumbs->push(new Breadcrumb($title, $url));
} | php | public function add(string $title, string $url)
{
$this->breadcrumbs->push(new Breadcrumb($title, $url));
} | [
"public",
"function",
"add",
"(",
"string",
"$",
"title",
",",
"string",
"$",
"url",
")",
"{",
"$",
"this",
"->",
"breadcrumbs",
"->",
"push",
"(",
"new",
"Breadcrumb",
"(",
"$",
"title",
",",
"$",
"url",
")",
")",
";",
"}"
] | Add a breadcrumb to the collection.
@param string $title
@param string $url
@return void | [
"Add",
"a",
"breadcrumb",
"to",
"the",
"collection",
"."
] | b54dc7e1fc131749ff60c88115ca70bf7c6443ca | https://github.com/dwightwatson/breadcrumbs/blob/b54dc7e1fc131749ff60c88115ca70bf7c6443ca/src/Breadcrumbs/Generator.php#L94-L97 |
221,805 | dwightwatson/breadcrumbs | src/Breadcrumbs/Generator.php | Generator.call | protected function call(string $name, array $parameters)
{
$definition = $this->registrar->get($name);
$parameters = array_prepend(array_values($parameters), $this);
call_user_func_array($definition, $parameters);
} | php | protected function call(string $name, array $parameters)
{
$definition = $this->registrar->get($name);
$parameters = array_prepend(array_values($parameters), $this);
call_user_func_array($definition, $parameters);
} | [
"protected",
"function",
"call",
"(",
"string",
"$",
"name",
",",
"array",
"$",
"parameters",
")",
"{",
"$",
"definition",
"=",
"$",
"this",
"->",
"registrar",
"->",
"get",
"(",
"$",
"name",
")",
";",
"$",
"parameters",
"=",
"array_prepend",
"(",
"arra... | Call the breadcrumb definition with the given parameters.
@param string $name
@param array $parameters
@return void
@throws \Watson\Breadcrumbs\DefinitionNotFoundException | [
"Call",
"the",
"breadcrumb",
"definition",
"with",
"the",
"given",
"parameters",
"."
] | b54dc7e1fc131749ff60c88115ca70bf7c6443ca | https://github.com/dwightwatson/breadcrumbs/blob/b54dc7e1fc131749ff60c88115ca70bf7c6443ca/src/Breadcrumbs/Generator.php#L107-L114 |
221,806 | Pageworks/craft-manytomany | src/fields/ManyToManyField.php | ManyToManyField.getSettingsHtml | public function getSettingsHtml(): string
{
$allSections = Craft::$app->sections->getAllSections();
$allFields = Craft::$app->fields->getAllFields() ?? [];
// Group the Sections into an array
$elements = [];
foreach ($allSections as $element) {
$elements[$element... | php | public function getSettingsHtml(): string
{
$allSections = Craft::$app->sections->getAllSections();
$allFields = Craft::$app->fields->getAllFields() ?? [];
// Group the Sections into an array
$elements = [];
foreach ($allSections as $element) {
$elements[$element... | [
"public",
"function",
"getSettingsHtml",
"(",
")",
":",
"string",
"{",
"$",
"allSections",
"=",
"Craft",
"::",
"$",
"app",
"->",
"sections",
"->",
"getAllSections",
"(",
")",
";",
"$",
"allFields",
"=",
"Craft",
"::",
"$",
"app",
"->",
"fields",
"->",
... | Get template for field type settings.
@return string | [
"Get",
"template",
"for",
"field",
"type",
"settings",
"."
] | bd4d2e81e43428962e910cfd5a6b4a6aefc195f6 | https://github.com/Pageworks/craft-manytomany/blob/bd4d2e81e43428962e910cfd5a6b4a6aefc195f6/src/fields/ManyToManyField.php#L67-L97 |
221,807 | Pageworks/craft-manytomany | src/fields/ManyToManyField.php | ManyToManyField.getInputHtml | public function getInputHtml($value, ElementInterface $element = null): string
{
$plugin = Plugin::getInstance();
$service = $plugin->service;
// Validate settings
if (empty($this->source)) {
return Craft::t('manytomany', 'To use the {pluginName} plugin you need to set a... | php | public function getInputHtml($value, ElementInterface $element = null): string
{
$plugin = Plugin::getInstance();
$service = $plugin->service;
// Validate settings
if (empty($this->source)) {
return Craft::t('manytomany', 'To use the {pluginName} plugin you need to set a... | [
"public",
"function",
"getInputHtml",
"(",
"$",
"value",
",",
"ElementInterface",
"$",
"element",
"=",
"null",
")",
":",
"string",
"{",
"$",
"plugin",
"=",
"Plugin",
"::",
"getInstance",
"(",
")",
";",
"$",
"service",
"=",
"$",
"plugin",
"->",
"service",... | Product input HTML for edit pages.
@param mixed $value
@param ElementInterface|null $element
@return string | [
"Product",
"input",
"HTML",
"for",
"edit",
"pages",
"."
] | bd4d2e81e43428962e910cfd5a6b4a6aefc195f6 | https://github.com/Pageworks/craft-manytomany/blob/bd4d2e81e43428962e910cfd5a6b4a6aefc195f6/src/fields/ManyToManyField.php#L106-L167 |
221,808 | dwightwatson/breadcrumbs | src/Breadcrumbs/Renderer.php | Renderer.render | public function render(string $view, Collection $breadcrumbs): HtmlString
{
return new HtmlString(
$this->makeView($view, $breadcrumbs)->render()
);
} | php | public function render(string $view, Collection $breadcrumbs): HtmlString
{
return new HtmlString(
$this->makeView($view, $breadcrumbs)->render()
);
} | [
"public",
"function",
"render",
"(",
"string",
"$",
"view",
",",
"Collection",
"$",
"breadcrumbs",
")",
":",
"HtmlString",
"{",
"return",
"new",
"HtmlString",
"(",
"$",
"this",
"->",
"makeView",
"(",
"$",
"view",
",",
"$",
"breadcrumbs",
")",
"->",
"rend... | Render the given breadcrumbs into the given view.
@param string $view
@param \Illuminate\Support\Collection $breadcrumbs
@return \Illuminate\Support\HtmlString | [
"Render",
"the",
"given",
"breadcrumbs",
"into",
"the",
"given",
"view",
"."
] | b54dc7e1fc131749ff60c88115ca70bf7c6443ca | https://github.com/dwightwatson/breadcrumbs/blob/b54dc7e1fc131749ff60c88115ca70bf7c6443ca/src/Breadcrumbs/Renderer.php#L37-L42 |
221,809 | dwightwatson/breadcrumbs | src/Breadcrumbs/Renderer.php | Renderer.makeView | protected function makeView(string $view, Collection $breadcrumbs): View
{
return $this->factory->make($view, compact('breadcrumbs'));
} | php | protected function makeView(string $view, Collection $breadcrumbs): View
{
return $this->factory->make($view, compact('breadcrumbs'));
} | [
"protected",
"function",
"makeView",
"(",
"string",
"$",
"view",
",",
"Collection",
"$",
"breadcrumbs",
")",
":",
"View",
"{",
"return",
"$",
"this",
"->",
"factory",
"->",
"make",
"(",
"$",
"view",
",",
"compact",
"(",
"'breadcrumbs'",
")",
")",
";",
... | Get a view instance of the given view file with breadcrumbs.
@param string $view
@param \Illuminate\Support\Collection $breadcrumbs
@return \Illuminate\View\View | [
"Get",
"a",
"view",
"instance",
"of",
"the",
"given",
"view",
"file",
"with",
"breadcrumbs",
"."
] | b54dc7e1fc131749ff60c88115ca70bf7c6443ca | https://github.com/dwightwatson/breadcrumbs/blob/b54dc7e1fc131749ff60c88115ca70bf7c6443ca/src/Breadcrumbs/Renderer.php#L51-L54 |
221,810 | xperseguers/doodle_client | src/Domain/Model/Poll.php | Poll.getPublicUrl | public function getPublicUrl(): string
{
if (!empty($this->_info['prettyUrl'])) {
$publicUrl = $this->_info['prettyUrl'];
} else {
$publicUrl = 'https://doodle.com/poll/' . $this->getId();
}
return $publicUrl;
} | php | public function getPublicUrl(): string
{
if (!empty($this->_info['prettyUrl'])) {
$publicUrl = $this->_info['prettyUrl'];
} else {
$publicUrl = 'https://doodle.com/poll/' . $this->getId();
}
return $publicUrl;
} | [
"public",
"function",
"getPublicUrl",
"(",
")",
":",
"string",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"this",
"->",
"_info",
"[",
"'prettyUrl'",
"]",
")",
")",
"{",
"$",
"publicUrl",
"=",
"$",
"this",
"->",
"_info",
"[",
"'prettyUrl'",
"]",
";",
"... | Returns the public URL.
@return string | [
"Returns",
"the",
"public",
"URL",
"."
] | 5ad422023d3d599631e908c852ef04fb7afa7087 | https://github.com/xperseguers/doodle_client/blob/5ad422023d3d599631e908c852ef04fb7afa7087/src/Domain/Model/Poll.php#L523-L532 |
221,811 | xperseguers/doodle_client | src/Domain/Model/Poll.php | Poll.getDescription | public function getDescription(): string
{
if ($this->description === null && $this->_repository !== null) {
$this->_repository->injectDescription($this);
}
return $this->description ?: '';
} | php | public function getDescription(): string
{
if ($this->description === null && $this->_repository !== null) {
$this->_repository->injectDescription($this);
}
return $this->description ?: '';
} | [
"public",
"function",
"getDescription",
"(",
")",
":",
"string",
"{",
"if",
"(",
"$",
"this",
"->",
"description",
"===",
"null",
"&&",
"$",
"this",
"->",
"_repository",
"!==",
"null",
")",
"{",
"$",
"this",
"->",
"_repository",
"->",
"injectDescription",
... | Returns the description.
@return string | [
"Returns",
"the",
"description",
"."
] | 5ad422023d3d599631e908c852ef04fb7afa7087 | https://github.com/xperseguers/doodle_client/blob/5ad422023d3d599631e908c852ef04fb7afa7087/src/Domain/Model/Poll.php#L539-L546 |
221,812 | xperseguers/doodle_client | src/Domain/Model/Poll.php | Poll.setDescription | public function setDescription(string $description): Poll
{
$description = trim($description);
$this->description = substr($description, 0, min(static::MAX_LENGTH_DESCRIPTION, strlen($description)));
return $this;
} | php | public function setDescription(string $description): Poll
{
$description = trim($description);
$this->description = substr($description, 0, min(static::MAX_LENGTH_DESCRIPTION, strlen($description)));
return $this;
} | [
"public",
"function",
"setDescription",
"(",
"string",
"$",
"description",
")",
":",
"Poll",
"{",
"$",
"description",
"=",
"trim",
"(",
"$",
"description",
")",
";",
"$",
"this",
"->",
"description",
"=",
"substr",
"(",
"$",
"description",
",",
"0",
",",... | Sets the description.
@param string $description
@return $this | [
"Sets",
"the",
"description",
"."
] | 5ad422023d3d599631e908c852ef04fb7afa7087 | https://github.com/xperseguers/doodle_client/blob/5ad422023d3d599631e908c852ef04fb7afa7087/src/Domain/Model/Poll.php#L554-L560 |
221,813 | xperseguers/doodle_client | src/Domain/Model/Poll.php | Poll.getOptions | public function getOptions(): array
{
if ($this->options === null && $this->_repository !== null) {
$this->_repository->injectOptions($this);
}
return $this->options ?: [];
} | php | public function getOptions(): array
{
if ($this->options === null && $this->_repository !== null) {
$this->_repository->injectOptions($this);
}
return $this->options ?: [];
} | [
"public",
"function",
"getOptions",
"(",
")",
":",
"array",
"{",
"if",
"(",
"$",
"this",
"->",
"options",
"===",
"null",
"&&",
"$",
"this",
"->",
"_repository",
"!==",
"null",
")",
"{",
"$",
"this",
"->",
"_repository",
"->",
"injectOptions",
"(",
"$",... | Returns the options.
@return Option[] | [
"Returns",
"the",
"options",
"."
] | 5ad422023d3d599631e908c852ef04fb7afa7087 | https://github.com/xperseguers/doodle_client/blob/5ad422023d3d599631e908c852ef04fb7afa7087/src/Domain/Model/Poll.php#L567-L574 |
221,814 | xperseguers/doodle_client | src/Domain/Model/Poll.php | Poll.getParticipants | public function getParticipants(): array
{
if ($this->participants === null && $this->_repository !== null) {
$this->_repository->injectParticipants($this);
}
return $this->participants ?: [];
} | php | public function getParticipants(): array
{
if ($this->participants === null && $this->_repository !== null) {
$this->_repository->injectParticipants($this);
}
return $this->participants ?: [];
} | [
"public",
"function",
"getParticipants",
"(",
")",
":",
"array",
"{",
"if",
"(",
"$",
"this",
"->",
"participants",
"===",
"null",
"&&",
"$",
"this",
"->",
"_repository",
"!==",
"null",
")",
"{",
"$",
"this",
"->",
"_repository",
"->",
"injectParticipants"... | Returns the participants.
@return Participant[] | [
"Returns",
"the",
"participants",
"."
] | 5ad422023d3d599631e908c852ef04fb7afa7087 | https://github.com/xperseguers/doodle_client/blob/5ad422023d3d599631e908c852ef04fb7afa7087/src/Domain/Model/Poll.php#L594-L601 |
221,815 | xperseguers/doodle_client | src/Domain/Model/Poll.php | Poll.getLocation | public function getLocation(): Location
{
if ($this->location === false && $this->_repository !== null) {
$this->_repository->injectLocation($this);
}
return $this->location ?: null;
} | php | public function getLocation(): Location
{
if ($this->location === false && $this->_repository !== null) {
$this->_repository->injectLocation($this);
}
return $this->location ?: null;
} | [
"public",
"function",
"getLocation",
"(",
")",
":",
"Location",
"{",
"if",
"(",
"$",
"this",
"->",
"location",
"===",
"false",
"&&",
"$",
"this",
"->",
"_repository",
"!==",
"null",
")",
"{",
"$",
"this",
"->",
"_repository",
"->",
"injectLocation",
"(",... | Returns the location.
@return Location|null | [
"Returns",
"the",
"location",
"."
] | 5ad422023d3d599631e908c852ef04fb7afa7087 | https://github.com/xperseguers/doodle_client/blob/5ad422023d3d599631e908c852ef04fb7afa7087/src/Domain/Model/Poll.php#L620-L627 |
221,816 | Ocramius/OcraServiceManager | src/OcraServiceManager/ServiceFactory/ServiceManagerFactory.php | ServiceManagerFactory.createService | public function createService(ServiceLocatorInterface $serviceLocator, $name = null)
{
$config = $serviceLocator->get('Config');
if (! $config['ocra_service_manager']['logged_service_manager']) {
return $serviceLocator;
}
/* @var $proxyFactory \ProxyManager\Factory\Acce... | php | public function createService(ServiceLocatorInterface $serviceLocator, $name = null)
{
$config = $serviceLocator->get('Config');
if (! $config['ocra_service_manager']['logged_service_manager']) {
return $serviceLocator;
}
/* @var $proxyFactory \ProxyManager\Factory\Acce... | [
"public",
"function",
"createService",
"(",
"ServiceLocatorInterface",
"$",
"serviceLocator",
",",
"$",
"name",
"=",
"null",
")",
"{",
"$",
"config",
"=",
"$",
"serviceLocator",
"->",
"get",
"(",
"'Config'",
")",
";",
"if",
"(",
"!",
"$",
"config",
"[",
... | Create an overloaded service manager
@param ServiceLocatorInterface $serviceLocator
@param string|null $name
@return ServiceLocatorInterface | [
"Create",
"an",
"overloaded",
"service",
"manager"
] | 8ca97c970ff32e138e89e93338ab3647a5d9370c | https://github.com/Ocramius/OcraServiceManager/blob/8ca97c970ff32e138e89e93338ab3647a5d9370c/src/OcraServiceManager/ServiceFactory/ServiceManagerFactory.php#L40-L68 |
221,817 | silverstripe/silverstripe-mssql | code/MSSQLQueryBuilder.php | MSSQLQueryBuilder.parseLimit | protected function parseLimit(SQLSelect $query)
{
$limit = '';
$offset = '0';
if (is_array($query->getLimit())) {
$limitArr = $query->getLimit();
if (isset($limitArr['limit'])) {
$limit = $limitArr['limit'];
}
if (isset($limitAr... | php | protected function parseLimit(SQLSelect $query)
{
$limit = '';
$offset = '0';
if (is_array($query->getLimit())) {
$limitArr = $query->getLimit();
if (isset($limitArr['limit'])) {
$limit = $limitArr['limit'];
}
if (isset($limitAr... | [
"protected",
"function",
"parseLimit",
"(",
"SQLSelect",
"$",
"query",
")",
"{",
"$",
"limit",
"=",
"''",
";",
"$",
"offset",
"=",
"'0'",
";",
"if",
"(",
"is_array",
"(",
"$",
"query",
"->",
"getLimit",
"(",
")",
")",
")",
"{",
"$",
"limitArr",
"="... | Extracts the limit and offset from the limit clause
@param SQLSelect $query
@return array Two item array with $limit and $offset as values
@throws InvalidArgumentException | [
"Extracts",
"the",
"limit",
"and",
"offset",
"from",
"the",
"limit",
"clause"
] | 34fb10580af3f403d69ba84984e78bcfc3f48bf3 | https://github.com/silverstripe/silverstripe-mssql/blob/34fb10580af3f403d69ba84984e78bcfc3f48bf3/code/MSSQLQueryBuilder.php#L98-L123 |
221,818 | stackify/stackify-api-php | src/Stackify/Log/Transport/ExecTransport.php | ExecTransport.finish | public function finish()
{
if (!empty($this->queue)) {
// empty queue to avoid duplicates
$queue = $this->queue;
$this->queue = array();
$this->sendChunk($queue);
}
} | php | public function finish()
{
if (!empty($this->queue)) {
// empty queue to avoid duplicates
$queue = $this->queue;
$this->queue = array();
$this->sendChunk($queue);
}
} | [
"public",
"function",
"finish",
"(",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"this",
"->",
"queue",
")",
")",
"{",
"// empty queue to avoid duplicates",
"$",
"queue",
"=",
"$",
"this",
"->",
"queue",
";",
"$",
"this",
"->",
"queue",
"=",
"array",
... | Overrides parent's method | [
"Overrides",
"parent",
"s",
"method"
] | 73b4e67432dc532d1dd46b90d385feb321f24e0a | https://github.com/stackify/stackify-api-php/blob/73b4e67432dc532d1dd46b90d385feb321f24e0a/src/Stackify/Log/Transport/ExecTransport.php#L36-L44 |
221,819 | Ocramius/OcraServiceManager | src/OcraServiceManager/View/Helper/YumlUrl.php | YumlUrl.getUrl | public function getUrl(array $services)
{
$chunks = array();
foreach ($services as $serviceName => $details) {
foreach ($details['dependencies'] as $dependency) {
$chunks[] = '[' . $serviceName . ']->[' . $dependency . ']';
}
}
return implode... | php | public function getUrl(array $services)
{
$chunks = array();
foreach ($services as $serviceName => $details) {
foreach ($details['dependencies'] as $dependency) {
$chunks[] = '[' . $serviceName . ']->[' . $dependency . ']';
}
}
return implode... | [
"public",
"function",
"getUrl",
"(",
"array",
"$",
"services",
")",
"{",
"$",
"chunks",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"services",
"as",
"$",
"serviceName",
"=>",
"$",
"details",
")",
"{",
"foreach",
"(",
"$",
"details",
"[",
"'dep... | Retrieves a YUML diagram link
@param array $services services as produced
by {@see \OcraServiceManager\ServiceManager\LoggedServiceManager::getLoggedServices}
@return string | [
"Retrieves",
"a",
"YUML",
"diagram",
"link"
] | 8ca97c970ff32e138e89e93338ab3647a5d9370c | https://github.com/Ocramius/OcraServiceManager/blob/8ca97c970ff32e138e89e93338ab3647a5d9370c/src/OcraServiceManager/View/Helper/YumlUrl.php#L40-L51 |
221,820 | tabuna/VestaAPI | src/Services/DNS.php | DNS.listOnlyDNS | public function listOnlyDNS($dns)
{
$this->returnCode = 'no';
$listDNS = $this->send('v-list-dns-domain', $this->userName, $dns, 'json');
$data = json_decode($listDNS, true);
return $data;
} | php | public function listOnlyDNS($dns)
{
$this->returnCode = 'no';
$listDNS = $this->send('v-list-dns-domain', $this->userName, $dns, 'json');
$data = json_decode($listDNS, true);
return $data;
} | [
"public",
"function",
"listOnlyDNS",
"(",
"$",
"dns",
")",
"{",
"$",
"this",
"->",
"returnCode",
"=",
"'no'",
";",
"$",
"listDNS",
"=",
"$",
"this",
"->",
"send",
"(",
"'v-list-dns-domain'",
",",
"$",
"this",
"->",
"userName",
",",
"$",
"dns",
",",
"... | List Only DNS.
@param $dns
@return mixed | [
"List",
"Only",
"DNS",
"."
] | 3f6e9c411b70d01d4cc38cb4e007803ff0abd457 | https://github.com/tabuna/VestaAPI/blob/3f6e9c411b70d01d4cc38cb4e007803ff0abd457/src/Services/DNS.php#L28-L35 |
221,821 | tabuna/VestaAPI | src/Services/DNS.php | DNS.addDNSDomain | public function addDNSDomain($domain, $ip, $ns1, $ns2, $ns3 = null, $ns4 = null)
{
return $this->send('v-add-dns-domain', $this->userName, $domain, $ip, $ns1, $ns2, $ns3,
$ns4, 'no');
} | php | public function addDNSDomain($domain, $ip, $ns1, $ns2, $ns3 = null, $ns4 = null)
{
return $this->send('v-add-dns-domain', $this->userName, $domain, $ip, $ns1, $ns2, $ns3,
$ns4, 'no');
} | [
"public",
"function",
"addDNSDomain",
"(",
"$",
"domain",
",",
"$",
"ip",
",",
"$",
"ns1",
",",
"$",
"ns2",
",",
"$",
"ns3",
"=",
"null",
",",
"$",
"ns4",
"=",
"null",
")",
"{",
"return",
"$",
"this",
"->",
"send",
"(",
"'v-add-dns-domain'",
",",
... | Add DNS domain.
@param $domain
@param $ip
@param $ns1
@param $ns2
@param null $ns3
@param null $ns4
@return mixed | [
"Add",
"DNS",
"domain",
"."
] | 3f6e9c411b70d01d4cc38cb4e007803ff0abd457 | https://github.com/tabuna/VestaAPI/blob/3f6e9c411b70d01d4cc38cb4e007803ff0abd457/src/Services/DNS.php#L74-L78 |
221,822 | tabuna/VestaAPI | src/Services/DNS.php | DNS.listDNSRecords | public function listDNSRecords($domain)
{
$this->returnCode = 'no';
$data = $this->send('v-list-dns-records', $this->userName, $domain, 'json');
$data = json_decode($data, true);
return $data;
} | php | public function listDNSRecords($domain)
{
$this->returnCode = 'no';
$data = $this->send('v-list-dns-records', $this->userName, $domain, 'json');
$data = json_decode($data, true);
return $data;
} | [
"public",
"function",
"listDNSRecords",
"(",
"$",
"domain",
")",
"{",
"$",
"this",
"->",
"returnCode",
"=",
"'no'",
";",
"$",
"data",
"=",
"$",
"this",
"->",
"send",
"(",
"'v-list-dns-records'",
",",
"$",
"this",
"->",
"userName",
",",
"$",
"domain",
"... | List DNS record domain.
@param $domain
@return mixed | [
"List",
"DNS",
"record",
"domain",
"."
] | 3f6e9c411b70d01d4cc38cb4e007803ff0abd457 | https://github.com/tabuna/VestaAPI/blob/3f6e9c411b70d01d4cc38cb4e007803ff0abd457/src/Services/DNS.php#L113-L120 |
221,823 | tabuna/VestaAPI | src/Services/DNS.php | DNS.changeDNSDomainRecord | public function changeDNSDomainRecord($domain, $recordId, $val, $priority)
{
return $this->send('v-change-dns-record', $this->userName, $domain, $recordId, $val,
$priority);
} | php | public function changeDNSDomainRecord($domain, $recordId, $val, $priority)
{
return $this->send('v-change-dns-record', $this->userName, $domain, $recordId, $val,
$priority);
} | [
"public",
"function",
"changeDNSDomainRecord",
"(",
"$",
"domain",
",",
"$",
"recordId",
",",
"$",
"val",
",",
"$",
"priority",
")",
"{",
"return",
"$",
"this",
"->",
"send",
"(",
"'v-change-dns-record'",
",",
"$",
"this",
"->",
"userName",
",",
"$",
"do... | Change DNS domain record.
@param $domain
@param $recordId
@param $val
@param $priority
@return mixed | [
"Change",
"DNS",
"domain",
"record",
"."
] | 3f6e9c411b70d01d4cc38cb4e007803ff0abd457 | https://github.com/tabuna/VestaAPI/blob/3f6e9c411b70d01d4cc38cb4e007803ff0abd457/src/Services/DNS.php#L132-L136 |
221,824 | tabuna/VestaAPI | src/Services/DNS.php | DNS.addDNSRecord | public function addDNSRecord($domain, $rec, $type, $val, $priority)
{
$this->send('v-add-dns-record', $this->userName, $domain, $rec, $type, $val, $priority);
} | php | public function addDNSRecord($domain, $rec, $type, $val, $priority)
{
$this->send('v-add-dns-record', $this->userName, $domain, $rec, $type, $val, $priority);
} | [
"public",
"function",
"addDNSRecord",
"(",
"$",
"domain",
",",
"$",
"rec",
",",
"$",
"type",
",",
"$",
"val",
",",
"$",
"priority",
")",
"{",
"$",
"this",
"->",
"send",
"(",
"'v-add-dns-record'",
",",
"$",
"this",
"->",
"userName",
",",
"$",
"domain"... | Add DNS record.
@param $domain
@param $rec
@param $type
@param $val
@param $priority | [
"Add",
"DNS",
"record",
"."
] | 3f6e9c411b70d01d4cc38cb4e007803ff0abd457 | https://github.com/tabuna/VestaAPI/blob/3f6e9c411b70d01d4cc38cb4e007803ff0abd457/src/Services/DNS.php#L158-L161 |
221,825 | Ocramius/OcraServiceManager | src/OcraServiceManager/ServiceFactory/ServiceManagerAccessInterceptorsFactory.php | ServiceManagerAccessInterceptorsFactory.createInstantiationListener | private function createInstantiationListener(EventManagerInterface $eventManager)
{
return function ($proxy, $instance, $method, $params, $returnValue) use ($eventManager) {
$eventName = ('create' === $method)
? ServiceManagerEvent::EVENT_SERVICEMANAGER_CREATE
: S... | php | private function createInstantiationListener(EventManagerInterface $eventManager)
{
return function ($proxy, $instance, $method, $params, $returnValue) use ($eventManager) {
$eventName = ('create' === $method)
? ServiceManagerEvent::EVENT_SERVICEMANAGER_CREATE
: S... | [
"private",
"function",
"createInstantiationListener",
"(",
"EventManagerInterface",
"$",
"eventManager",
")",
"{",
"return",
"function",
"(",
"$",
"proxy",
",",
"$",
"instance",
",",
"$",
"method",
",",
"$",
"params",
",",
"$",
"returnValue",
")",
"use",
"(",
... | Bulds a listener closure responsible for triggering events on service instantiation
@param EventManagerInterface $eventManager
@return \Closure | [
"Bulds",
"a",
"listener",
"closure",
"responsible",
"for",
"triggering",
"events",
"on",
"service",
"instantiation"
] | 8ca97c970ff32e138e89e93338ab3647a5d9370c | https://github.com/Ocramius/OcraServiceManager/blob/8ca97c970ff32e138e89e93338ab3647a5d9370c/src/OcraServiceManager/ServiceFactory/ServiceManagerAccessInterceptorsFactory.php#L62-L87 |
221,826 | gboyegadada/lumen-jwt | src/JWTGuard.php | JWTGuard.logout | public function logout()
{
$this->user = null;
return $this->jwt->isHealthy()
? $this->jwt->invalidateToken()
: null;
} | php | public function logout()
{
$this->user = null;
return $this->jwt->isHealthy()
? $this->jwt->invalidateToken()
: null;
} | [
"public",
"function",
"logout",
"(",
")",
"{",
"$",
"this",
"->",
"user",
"=",
"null",
";",
"return",
"$",
"this",
"->",
"jwt",
"->",
"isHealthy",
"(",
")",
"?",
"$",
"this",
"->",
"jwt",
"->",
"invalidateToken",
"(",
")",
":",
"null",
";",
"}"
] | Invalidate token for a user.
@return string | [
"Invalidate",
"token",
"for",
"a",
"user",
"."
] | 3701e6615e43ec9ba33f69a92eb8dc8afe8a8c62 | https://github.com/gboyegadada/lumen-jwt/blob/3701e6615e43ec9ba33f69a92eb8dc8afe8a8c62/src/JWTGuard.php#L209-L215 |
221,827 | Ocramius/OcraServiceManager | src/OcraServiceManager/Controller/YumlController.php | YumlController.indexAction | public function indexAction()
{
$config = $this->getServiceLocator()->get('Config');
if (! $config['ocra_service_manager']['logged_service_manager']
|| ! isset($config['zenddevelopertools']['toolbar']['enabled'])
|| ! $config['zenddevelopertools']['toolbar']['enabled']
... | php | public function indexAction()
{
$config = $this->getServiceLocator()->get('Config');
if (! $config['ocra_service_manager']['logged_service_manager']
|| ! isset($config['zenddevelopertools']['toolbar']['enabled'])
|| ! $config['zenddevelopertools']['toolbar']['enabled']
... | [
"public",
"function",
"indexAction",
"(",
")",
"{",
"$",
"config",
"=",
"$",
"this",
"->",
"getServiceLocator",
"(",
")",
"->",
"get",
"(",
"'Config'",
")",
";",
"if",
"(",
"!",
"$",
"config",
"[",
"'ocra_service_manager'",
"]",
"[",
"'logged_service_manag... | Redirects the user to a YUML graph drawn with the provided `dsl_text`
@return \Zend\Http\Response
@throws \UnexpectedValueException if the YUML service answered incorrectly
@throws BadMethodCallException if the request has been aborted for security reasons | [
"Redirects",
"the",
"user",
"to",
"a",
"YUML",
"graph",
"drawn",
"with",
"the",
"provided",
"dsl_text"
] | 8ca97c970ff32e138e89e93338ab3647a5d9370c | https://github.com/Ocramius/OcraServiceManager/blob/8ca97c970ff32e138e89e93338ab3647a5d9370c/src/OcraServiceManager/Controller/YumlController.php#L46-L75 |
221,828 | gboyegadada/lumen-jwt | src/JWTHelper.php | JWTHelper.getDecoded | public function getDecoded()
{
if (is_null($this->token)) return null;
if (is_null($this->decoded)) {
try {
$this->decoded = JWT::decode($this->token, $this->key, ['HS512']);
}
catch (\Exception $e) {}
catch (\DomainException $e) {}
}
retur... | php | public function getDecoded()
{
if (is_null($this->token)) return null;
if (is_null($this->decoded)) {
try {
$this->decoded = JWT::decode($this->token, $this->key, ['HS512']);
}
catch (\Exception $e) {}
catch (\DomainException $e) {}
}
retur... | [
"public",
"function",
"getDecoded",
"(",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"this",
"->",
"token",
")",
")",
"return",
"null",
";",
"if",
"(",
"is_null",
"(",
"$",
"this",
"->",
"decoded",
")",
")",
"{",
"try",
"{",
"$",
"this",
"->",
"dec... | Get decoded token.
@return StdObject JSON Object | [
"Get",
"decoded",
"token",
"."
] | 3701e6615e43ec9ba33f69a92eb8dc8afe8a8c62 | https://github.com/gboyegadada/lumen-jwt/blob/3701e6615e43ec9ba33f69a92eb8dc8afe8a8c62/src/JWTHelper.php#L124-L135 |
221,829 | gboyegadada/lumen-jwt | src/JWTHelper.php | JWTHelper.getId | public function getId()
{
$decoded = $this->getDecoded();
return !is_null($decoded)
? $decoded->data->{$this->id_field}
: null;
} | php | public function getId()
{
$decoded = $this->getDecoded();
return !is_null($decoded)
? $decoded->data->{$this->id_field}
: null;
} | [
"public",
"function",
"getId",
"(",
")",
"{",
"$",
"decoded",
"=",
"$",
"this",
"->",
"getDecoded",
"(",
")",
";",
"return",
"!",
"is_null",
"(",
"$",
"decoded",
")",
"?",
"$",
"decoded",
"->",
"data",
"->",
"{",
"$",
"this",
"->",
"id_field",
"}",... | Get value stored in token id field
@return string | [
"Get",
"value",
"stored",
"in",
"token",
"id",
"field"
] | 3701e6615e43ec9ba33f69a92eb8dc8afe8a8c62 | https://github.com/gboyegadada/lumen-jwt/blob/3701e6615e43ec9ba33f69a92eb8dc8afe8a8c62/src/JWTHelper.php#L174-L180 |
221,830 | silverstripe/silverstripe-mssql | code/MSSQLSchemaManager.php | MSSQLSchemaManager.buildMSSQLIndexName | public function buildMSSQLIndexName($tableName, $indexName, $prefix = 'ix')
{
// Cleanup names of namespaced tables
$tableName = str_replace('\\', '_', $tableName);
$indexName = str_replace('\\', '_', $indexName);
return "{$prefix}_{$tableName}_{$indexName}";
} | php | public function buildMSSQLIndexName($tableName, $indexName, $prefix = 'ix')
{
// Cleanup names of namespaced tables
$tableName = str_replace('\\', '_', $tableName);
$indexName = str_replace('\\', '_', $indexName);
return "{$prefix}_{$tableName}_{$indexName}";
} | [
"public",
"function",
"buildMSSQLIndexName",
"(",
"$",
"tableName",
",",
"$",
"indexName",
",",
"$",
"prefix",
"=",
"'ix'",
")",
"{",
"// Cleanup names of namespaced tables",
"$",
"tableName",
"=",
"str_replace",
"(",
"'\\\\'",
",",
"'_'",
",",
"$",
"tableName",... | Builds the internal MS SQL Server index name given the silverstripe table and index name
@param string $tableName
@param string $indexName
@param string $prefix The optional prefix for the index. Defaults to "ix" for indexes.
@return string The name of the index | [
"Builds",
"the",
"internal",
"MS",
"SQL",
"Server",
"index",
"name",
"given",
"the",
"silverstripe",
"table",
"and",
"index",
"name"
] | 34fb10580af3f403d69ba84984e78bcfc3f48bf3 | https://github.com/silverstripe/silverstripe-mssql/blob/34fb10580af3f403d69ba84984e78bcfc3f48bf3/code/MSSQLSchemaManager.php#L28-L36 |
221,831 | silverstripe/silverstripe-mssql | code/MSSQLSchemaManager.php | MSSQLSchemaManager.waitUntilIndexingFinished | public function waitUntilIndexingFinished($maxWaitingTime = 15)
{
if (!$this->database->fullTextEnabled()) {
return;
}
$this->query("EXEC sp_fulltext_catalog 'ftCatalog', 'Rebuild';");
// Busy wait until it's done updating, but no longer than 15 seconds.
$start ... | php | public function waitUntilIndexingFinished($maxWaitingTime = 15)
{
if (!$this->database->fullTextEnabled()) {
return;
}
$this->query("EXEC sp_fulltext_catalog 'ftCatalog', 'Rebuild';");
// Busy wait until it's done updating, but no longer than 15 seconds.
$start ... | [
"public",
"function",
"waitUntilIndexingFinished",
"(",
"$",
"maxWaitingTime",
"=",
"15",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"database",
"->",
"fullTextEnabled",
"(",
")",
")",
"{",
"return",
";",
"}",
"$",
"this",
"->",
"query",
"(",
"\"EXEC s... | Sleep until the catalog has been fully rebuilt. This is a busy wait designed for situations
when you need to be sure the index is up to date - for example in unit tests.
TODO: move this to Database class? Can we assume this will be useful for all databases?
Also see the wrapper functions "waitUntilIndexingFinished" in... | [
"Sleep",
"until",
"the",
"catalog",
"has",
"been",
"fully",
"rebuilt",
".",
"This",
"is",
"a",
"busy",
"wait",
"designed",
"for",
"situations",
"when",
"you",
"need",
"to",
"be",
"sure",
"the",
"index",
"is",
"up",
"to",
"date",
"-",
"for",
"example",
... | 34fb10580af3f403d69ba84984e78bcfc3f48bf3 | https://github.com/silverstripe/silverstripe-mssql/blob/34fb10580af3f403d69ba84984e78bcfc3f48bf3/code/MSSQLSchemaManager.php#L75-L94 |
221,832 | silverstripe/silverstripe-mssql | code/MSSQLSchemaManager.php | MSSQLSchemaManager.fulltextIndexExists | public function fulltextIndexExists($tableName)
{
// Special case for no full text index support
if (!$this->database->fullTextEnabled()) {
return null;
}
return (bool) $this->preparedQuery("
SELECT 1 FROM sys.fulltext_indexes i
JOIN sys.objects o ON i.object_id = ... | php | public function fulltextIndexExists($tableName)
{
// Special case for no full text index support
if (!$this->database->fullTextEnabled()) {
return null;
}
return (bool) $this->preparedQuery("
SELECT 1 FROM sys.fulltext_indexes i
JOIN sys.objects o ON i.object_id = ... | [
"public",
"function",
"fulltextIndexExists",
"(",
"$",
"tableName",
")",
"{",
"// Special case for no full text index support",
"if",
"(",
"!",
"$",
"this",
"->",
"database",
"->",
"fullTextEnabled",
"(",
")",
")",
"{",
"return",
"null",
";",
"}",
"return",
"(",... | Check if a fulltext index exists on a particular table name.
@param string $tableName
@return boolean TRUE index exists | FALSE index does not exist | NULL no support | [
"Check",
"if",
"a",
"fulltext",
"index",
"exists",
"on",
"a",
"particular",
"table",
"name",
"."
] | 34fb10580af3f403d69ba84984e78bcfc3f48bf3 | https://github.com/silverstripe/silverstripe-mssql/blob/34fb10580af3f403d69ba84984e78bcfc3f48bf3/code/MSSQLSchemaManager.php#L102-L115 |
221,833 | silverstripe/silverstripe-mssql | code/MSSQLSchemaManager.php | MSSQLSchemaManager.getPrimaryKey | public function getPrimaryKey($tableName)
{
$indexes = $this->query("EXEC sp_helpindex '$tableName';");
$indexName = '';
foreach ($indexes as $index) {
if ($index['index_keys'] == 'ID') {
$indexName = $index['index_name'];
break;
}
... | php | public function getPrimaryKey($tableName)
{
$indexes = $this->query("EXEC sp_helpindex '$tableName';");
$indexName = '';
foreach ($indexes as $index) {
if ($index['index_keys'] == 'ID') {
$indexName = $index['index_name'];
break;
}
... | [
"public",
"function",
"getPrimaryKey",
"(",
"$",
"tableName",
")",
"{",
"$",
"indexes",
"=",
"$",
"this",
"->",
"query",
"(",
"\"EXEC sp_helpindex '$tableName';\"",
")",
";",
"$",
"indexName",
"=",
"''",
";",
"foreach",
"(",
"$",
"indexes",
"as",
"$",
"ind... | MSSQL stores the primary key column with an internal identifier,
so a lookup needs to be done to determine it.
@param string $tableName Name of table with primary key column "ID"
@return string Internal identifier for primary key | [
"MSSQL",
"stores",
"the",
"primary",
"key",
"column",
"with",
"an",
"internal",
"identifier",
"so",
"a",
"lookup",
"needs",
"to",
"be",
"done",
"to",
"determine",
"it",
"."
] | 34fb10580af3f403d69ba84984e78bcfc3f48bf3 | https://github.com/silverstripe/silverstripe-mssql/blob/34fb10580af3f403d69ba84984e78bcfc3f48bf3/code/MSSQLSchemaManager.php#L124-L136 |
221,834 | silverstripe/silverstripe-mssql | code/MSSQLSchemaManager.php | MSSQLSchemaManager.alterTable | public function alterTable($tableName, $newFields = null, $newIndexes = null, $alteredFields = null, $alteredIndexes = null, $alteredOptions=null, $advancedOptions=null)
{
$alterList = array();
// drop any fulltext indexes that exist on the table before altering the structure
if ($this->ful... | php | public function alterTable($tableName, $newFields = null, $newIndexes = null, $alteredFields = null, $alteredIndexes = null, $alteredOptions=null, $advancedOptions=null)
{
$alterList = array();
// drop any fulltext indexes that exist on the table before altering the structure
if ($this->ful... | [
"public",
"function",
"alterTable",
"(",
"$",
"tableName",
",",
"$",
"newFields",
"=",
"null",
",",
"$",
"newIndexes",
"=",
"null",
",",
"$",
"alteredFields",
"=",
"null",
",",
"$",
"alteredIndexes",
"=",
"null",
",",
"$",
"alteredOptions",
"=",
"null",
... | Alter a table's schema.
@param string $tableName The name of the table to alter
@param array $newFields New fields, a map of field name => field schema
@param array $newIndexes New indexes, a map of index name => index type
@param array $alteredFields Updated fields, a map of field name => field schema
@param array $al... | [
"Alter",
"a",
"table",
"s",
"schema",
"."
] | 34fb10580af3f403d69ba84984e78bcfc3f48bf3 | https://github.com/silverstripe/silverstripe-mssql/blob/34fb10580af3f403d69ba84984e78bcfc3f48bf3/code/MSSQLSchemaManager.php#L241-L279 |
221,835 | silverstripe/silverstripe-mssql | code/MSSQLSchemaManager.php | MSSQLSchemaManager.getConstraintCheckClause | public function getConstraintCheckClause($tableName, $columnName)
{
// Check already processed table columns
if (isset(self::$cached_checks[$tableName])) {
if (!isset(self::$cached_checks[$tableName][$columnName])) {
return null;
}
return self::$ca... | php | public function getConstraintCheckClause($tableName, $columnName)
{
// Check already processed table columns
if (isset(self::$cached_checks[$tableName])) {
if (!isset(self::$cached_checks[$tableName][$columnName])) {
return null;
}
return self::$ca... | [
"public",
"function",
"getConstraintCheckClause",
"(",
"$",
"tableName",
",",
"$",
"columnName",
")",
"{",
"// Check already processed table columns",
"if",
"(",
"isset",
"(",
"self",
"::",
"$",
"cached_checks",
"[",
"$",
"tableName",
"]",
")",
")",
"{",
"if",
... | Given a table and column name, return a check constraint clause for that column in
the table.
This is an expensive query, so it is cached per-request and stored by table. The initial
call for a table that has not been cached will query all columns and store that
so subsequent calls are fast.
@param string $tableName ... | [
"Given",
"a",
"table",
"and",
"column",
"name",
"return",
"a",
"check",
"constraint",
"clause",
"for",
"that",
"column",
"in",
"the",
"table",
"."
] | 34fb10580af3f403d69ba84984e78bcfc3f48bf3 | https://github.com/silverstripe/silverstripe-mssql/blob/34fb10580af3f403d69ba84984e78bcfc3f48bf3/code/MSSQLSchemaManager.php#L311-L336 |
221,836 | silverstripe/silverstripe-mssql | code/MSSQLSchemaManager.php | MSSQLSchemaManager.enumValuesFromCheckClause | protected function enumValuesFromCheckClause($clause)
{
$segments = preg_split('/ +OR *\[/i', $clause);
$constraints = array();
foreach ($segments as $segment) {
$bits = preg_split('/ *= */', $segment);
for ($i = 1; $i < sizeof($bits); $i += 2) {
array... | php | protected function enumValuesFromCheckClause($clause)
{
$segments = preg_split('/ +OR *\[/i', $clause);
$constraints = array();
foreach ($segments as $segment) {
$bits = preg_split('/ *= */', $segment);
for ($i = 1; $i < sizeof($bits); $i += 2) {
array... | [
"protected",
"function",
"enumValuesFromCheckClause",
"(",
"$",
"clause",
")",
"{",
"$",
"segments",
"=",
"preg_split",
"(",
"'/ +OR *\\[/i'",
",",
"$",
"clause",
")",
";",
"$",
"constraints",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"segments",
"... | Get enum values from a constraint check clause.
@param string $clause Check clause to parse values from
@return array Enum values | [
"Get",
"enum",
"values",
"from",
"a",
"constraint",
"check",
"clause",
"."
] | 34fb10580af3f403d69ba84984e78bcfc3f48bf3 | https://github.com/silverstripe/silverstripe-mssql/blob/34fb10580af3f403d69ba84984e78bcfc3f48bf3/code/MSSQLSchemaManager.php#L366-L377 |
221,837 | silverstripe/silverstripe-mssql | code/MSSQLSchemaManager.php | MSSQLSchemaManager.getIndexSqlDefinition | protected function getIndexSqlDefinition($tableName, $indexName, $indexSpec)
{
// Determine index name
$index = $this->buildMSSQLIndexName($tableName, $indexName);
// Consolidate/Cleanup spec into array format
$indexSpec = $this->parseIndexSpec($indexName, $indexSpec);
$dr... | php | protected function getIndexSqlDefinition($tableName, $indexName, $indexSpec)
{
// Determine index name
$index = $this->buildMSSQLIndexName($tableName, $indexName);
// Consolidate/Cleanup spec into array format
$indexSpec = $this->parseIndexSpec($indexName, $indexSpec);
$dr... | [
"protected",
"function",
"getIndexSqlDefinition",
"(",
"$",
"tableName",
",",
"$",
"indexName",
",",
"$",
"indexSpec",
")",
"{",
"// Determine index name",
"$",
"index",
"=",
"$",
"this",
"->",
"buildMSSQLIndexName",
"(",
"$",
"tableName",
",",
"$",
"indexName",... | Return SQL for dropping and recreating an index
@param string $tableName Name of table to create this index against
@param string $indexName Name of this index
@param array|string $indexSpec Index specification, either as a raw string
or parsed array form
@return string The SQL required to generate this index | [
"Return",
"SQL",
"for",
"dropping",
"and",
"recreating",
"an",
"index"
] | 34fb10580af3f403d69ba84984e78bcfc3f48bf3 | https://github.com/silverstripe/silverstripe-mssql/blob/34fb10580af3f403d69ba84984e78bcfc3f48bf3/code/MSSQLSchemaManager.php#L603-L634 |
221,838 | silverstripe/silverstripe-mssql | code/MSSQLSchemaManager.php | MSSQLSchemaManager.indexList | public function indexList($table)
{
$indexes = $this->query("EXEC sp_helpindex '$table';");
$indexList = array();
// Enumerate all basic indexes
foreach ($indexes as $index) {
if (strpos($index['index_description'], 'unique') !== false) {
$indexType = 'un... | php | public function indexList($table)
{
$indexes = $this->query("EXEC sp_helpindex '$table';");
$indexList = array();
// Enumerate all basic indexes
foreach ($indexes as $index) {
if (strpos($index['index_description'], 'unique') !== false) {
$indexType = 'un... | [
"public",
"function",
"indexList",
"(",
"$",
"table",
")",
"{",
"$",
"indexes",
"=",
"$",
"this",
"->",
"query",
"(",
"\"EXEC sp_helpindex '$table';\"",
")",
";",
"$",
"indexList",
"=",
"array",
"(",
")",
";",
"// Enumerate all basic indexes",
"foreach",
"(",
... | Return the list of indexes in a table.
@param string $table The table name.
@return array | [
"Return",
"the",
"list",
"of",
"indexes",
"in",
"a",
"table",
"."
] | 34fb10580af3f403d69ba84984e78bcfc3f48bf3 | https://github.com/silverstripe/silverstripe-mssql/blob/34fb10580af3f403d69ba84984e78bcfc3f48bf3/code/MSSQLSchemaManager.php#L646-L694 |
221,839 | silverstripe/silverstripe-mssql | code/MSSQLAzureDatabase.php | MSSQLAzureDatabase.connectDatabase | protected function connectDatabase($database)
{
$parameters = $this->parameters;
$parameters['database'] = $database;
$parameters['multipleactiveresultsets'] = 0;
// Ensure that driver is available (required by PDO)
if (empty($parameters['driver'])) {
$parameters... | php | protected function connectDatabase($database)
{
$parameters = $this->parameters;
$parameters['database'] = $database;
$parameters['multipleactiveresultsets'] = 0;
// Ensure that driver is available (required by PDO)
if (empty($parameters['driver'])) {
$parameters... | [
"protected",
"function",
"connectDatabase",
"(",
"$",
"database",
")",
"{",
"$",
"parameters",
"=",
"$",
"this",
"->",
"parameters",
";",
"$",
"parameters",
"[",
"'database'",
"]",
"=",
"$",
"database",
";",
"$",
"parameters",
"[",
"'multipleactiveresultsets'"... | Connect to a database using the provided parameters
@param string $database | [
"Connect",
"to",
"a",
"database",
"using",
"the",
"provided",
"parameters"
] | 34fb10580af3f403d69ba84984e78bcfc3f48bf3 | https://github.com/silverstripe/silverstripe-mssql/blob/34fb10580af3f403d69ba84984e78bcfc3f48bf3/code/MSSQLAzureDatabase.php#L62-L80 |
221,840 | silverstripe/silverstripe-mssql | code/MSSQLAzureDatabase.php | MSSQLAzureDatabase.selectDatabase | public function selectDatabase($name, $create = false, $errorLevel = E_USER_ERROR)
{
$this->fullTextEnabled = null;
if (!$this->schemaManager->databaseExists($name)) {
// Check DB creation permisson
if (!$create) {
if ($errorLevel !== false) {
... | php | public function selectDatabase($name, $create = false, $errorLevel = E_USER_ERROR)
{
$this->fullTextEnabled = null;
if (!$this->schemaManager->databaseExists($name)) {
// Check DB creation permisson
if (!$create) {
if ($errorLevel !== false) {
... | [
"public",
"function",
"selectDatabase",
"(",
"$",
"name",
",",
"$",
"create",
"=",
"false",
",",
"$",
"errorLevel",
"=",
"E_USER_ERROR",
")",
"{",
"$",
"this",
"->",
"fullTextEnabled",
"=",
"null",
";",
"if",
"(",
"!",
"$",
"this",
"->",
"schemaManager",... | Switches to the given database.
IMPORTANT: SQL Azure doesn't support "USE", so we need
to reinitialize the database connection with the requested
database name.
@see http://msdn.microsoft.com/en-us/library/windowsazure/ee336288.aspx
@param string $name The database name to switch to
@param bool $create
@param bool|in... | [
"Switches",
"to",
"the",
"given",
"database",
"."
] | 34fb10580af3f403d69ba84984e78bcfc3f48bf3 | https://github.com/silverstripe/silverstripe-mssql/blob/34fb10580af3f403d69ba84984e78bcfc3f48bf3/code/MSSQLAzureDatabase.php#L95-L112 |
221,841 | silverstripe/silverstripe-mssql | code/MSSQLDatabase.php | MSSQLDatabase.fullTextSearchMSSQL | public function fullTextSearchMSSQL($tableName, $keywords, $fields = null)
{
// Make sure we are getting an array of fields
if (isset($fields) && !is_array($fields)) {
$fields = array($fields);
}
// Strip unfriendly characters, SQLServer "CONTAINS" predicate will crash o... | php | public function fullTextSearchMSSQL($tableName, $keywords, $fields = null)
{
// Make sure we are getting an array of fields
if (isset($fields) && !is_array($fields)) {
$fields = array($fields);
}
// Strip unfriendly characters, SQLServer "CONTAINS" predicate will crash o... | [
"public",
"function",
"fullTextSearchMSSQL",
"(",
"$",
"tableName",
",",
"$",
"keywords",
",",
"$",
"fields",
"=",
"null",
")",
"{",
"// Make sure we are getting an array of fields",
"if",
"(",
"isset",
"(",
"$",
"fields",
")",
"&&",
"!",
"is_array",
"(",
"$",... | Returns a SQL fragment for querying a fulltext search index
@param string $tableName specific - table name
@param string $keywords The search query
@param array $fields The list of field names to search on, or null to include all
@return string Clause, or null if keyword set is empty or the string with JOIN clause to ... | [
"Returns",
"a",
"SQL",
"fragment",
"for",
"querying",
"a",
"fulltext",
"search",
"index"
] | 34fb10580af3f403d69ba84984e78bcfc3f48bf3 | https://github.com/silverstripe/silverstripe-mssql/blob/34fb10580af3f403d69ba84984e78bcfc3f48bf3/code/MSSQLDatabase.php#L370-L402 |
221,842 | silverstripe/silverstripe-mssql | code/MSSQLDatabase.php | MSSQLDatabase.removeStopwords | public function removeStopwords($keywords)
{
$goodKeywords = array();
foreach ($keywords as $keyword) {
if (in_array($keyword, self::$noiseWords)) {
continue;
}
$goodKeywords[] = trim($keyword);
}
return $goodKeywords;
} | php | public function removeStopwords($keywords)
{
$goodKeywords = array();
foreach ($keywords as $keyword) {
if (in_array($keyword, self::$noiseWords)) {
continue;
}
$goodKeywords[] = trim($keyword);
}
return $goodKeywords;
} | [
"public",
"function",
"removeStopwords",
"(",
"$",
"keywords",
")",
"{",
"$",
"goodKeywords",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"keywords",
"as",
"$",
"keyword",
")",
"{",
"if",
"(",
"in_array",
"(",
"$",
"keyword",
",",
"self",
"::",
... | Remove stopwords that would kill a MSSQL full-text query
@param array $keywords
@return array $keywords with stopwords removed | [
"Remove",
"stopwords",
"that",
"would",
"kill",
"a",
"MSSQL",
"full",
"-",
"text",
"query"
] | 34fb10580af3f403d69ba84984e78bcfc3f48bf3 | https://github.com/silverstripe/silverstripe-mssql/blob/34fb10580af3f403d69ba84984e78bcfc3f48bf3/code/MSSQLDatabase.php#L411-L421 |
221,843 | silverstripe/silverstripe-mssql | code/MSSQLDatabase.php | MSSQLDatabase.supportsExtensions | public function supportsExtensions($extensions = array('partitions', 'tablespaces', 'clustering'))
{
if (isset($extensions['partitions'])) {
return false;
} elseif (isset($extensions['tablespaces'])) {
return false;
} elseif (isset($extensions['clustering'])) {
... | php | public function supportsExtensions($extensions = array('partitions', 'tablespaces', 'clustering'))
{
if (isset($extensions['partitions'])) {
return false;
} elseif (isset($extensions['tablespaces'])) {
return false;
} elseif (isset($extensions['clustering'])) {
... | [
"public",
"function",
"supportsExtensions",
"(",
"$",
"extensions",
"=",
"array",
"(",
"'partitions'",
",",
"'tablespaces'",
",",
"'clustering'",
")",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"extensions",
"[",
"'partitions'",
"]",
")",
")",
"{",
"return",
... | This is a quick lookup to discover if the database supports particular extensions
Currently, MSSQL supports no extensions
@param array $extensions List of extensions to check for support of. The key of this array
will be an extension name, and the value the configuration for that extension. This
could be one of partit... | [
"This",
"is",
"a",
"quick",
"lookup",
"to",
"discover",
"if",
"the",
"database",
"supports",
"particular",
"extensions",
"Currently",
"MSSQL",
"supports",
"no",
"extensions"
] | 34fb10580af3f403d69ba84984e78bcfc3f48bf3 | https://github.com/silverstripe/silverstripe-mssql/blob/34fb10580af3f403d69ba84984e78bcfc3f48bf3/code/MSSQLDatabase.php#L440-L451 |
221,844 | silverstripe/silverstripe-mssql | code/MSSQLDatabase.php | MSSQLDatabase.transactionStart | public function transactionStart($transactionMode = false, $sessionCharacteristics = false)
{
if ($this->transactionNesting > 0) {
$this->transactionSavepoint('NESTEDTRANSACTION' . $this->transactionNesting);
} elseif ($this->connector instanceof SQLServerConnector) {
$this->... | php | public function transactionStart($transactionMode = false, $sessionCharacteristics = false)
{
if ($this->transactionNesting > 0) {
$this->transactionSavepoint('NESTEDTRANSACTION' . $this->transactionNesting);
} elseif ($this->connector instanceof SQLServerConnector) {
$this->... | [
"public",
"function",
"transactionStart",
"(",
"$",
"transactionMode",
"=",
"false",
",",
"$",
"sessionCharacteristics",
"=",
"false",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"transactionNesting",
">",
"0",
")",
"{",
"$",
"this",
"->",
"transactionSavepoint",
... | Start transaction. READ ONLY not supported.
@param bool $transactionMode
@param bool $sessionCharacteristics | [
"Start",
"transaction",
".",
"READ",
"ONLY",
"not",
"supported",
"."
] | 34fb10580af3f403d69ba84984e78bcfc3f48bf3 | https://github.com/silverstripe/silverstripe-mssql/blob/34fb10580af3f403d69ba84984e78bcfc3f48bf3/code/MSSQLDatabase.php#L459-L469 |
221,845 | silverstripe/silverstripe-mssql | code/MSSQLDatabase.php | MSSQLDatabase.formattedDatetimeClause | public function formattedDatetimeClause($date, $format)
{
preg_match_all('/%(.)/', $format, $matches);
foreach ($matches[1] as $match) {
if (array_search($match, array('Y', 'm', 'd', 'H', 'i', 's', 'U')) === false) {
user_error('formattedDatetimeClause(): unsupported form... | php | public function formattedDatetimeClause($date, $format)
{
preg_match_all('/%(.)/', $format, $matches);
foreach ($matches[1] as $match) {
if (array_search($match, array('Y', 'm', 'd', 'H', 'i', 's', 'U')) === false) {
user_error('formattedDatetimeClause(): unsupported form... | [
"public",
"function",
"formattedDatetimeClause",
"(",
"$",
"date",
",",
"$",
"format",
")",
"{",
"preg_match_all",
"(",
"'/%(.)/'",
",",
"$",
"format",
",",
"$",
"matches",
")",
";",
"foreach",
"(",
"$",
"matches",
"[",
"1",
"]",
"as",
"$",
"match",
")... | Function to return an SQL datetime expression for MSSQL
used for querying a datetime in a certain format
@param string $date to be formated, can be either 'now', literal datetime like '1973-10-14 10:30:00' or field name, e.g. '"SiteTree"."Created"'
@param string $format to be used, supported specifiers:
%Y = Year (fou... | [
"Function",
"to",
"return",
"an",
"SQL",
"datetime",
"expression",
"for",
"MSSQL",
"used",
"for",
"querying",
"a",
"datetime",
"in",
"a",
"certain",
"format"
] | 34fb10580af3f403d69ba84984e78bcfc3f48bf3 | https://github.com/silverstripe/silverstripe-mssql/blob/34fb10580af3f403d69ba84984e78bcfc3f48bf3/code/MSSQLDatabase.php#L599-L648 |
221,846 | silverstripe/silverstripe-mssql | code/MSSQLDatabase.php | MSSQLDatabase.datetimeIntervalClause | public function datetimeIntervalClause($date, $interval)
{
$trans = array(
'year' => 'yy',
'month' => 'mm',
'day' => 'dd',
'hour' => 'hh',
'minute' => 'mi',
'second' => 'ss',
);
$singularinterval = preg_replace('/(year|... | php | public function datetimeIntervalClause($date, $interval)
{
$trans = array(
'year' => 'yy',
'month' => 'mm',
'day' => 'dd',
'hour' => 'hh',
'minute' => 'mi',
'second' => 'ss',
);
$singularinterval = preg_replace('/(year|... | [
"public",
"function",
"datetimeIntervalClause",
"(",
"$",
"date",
",",
"$",
"interval",
")",
"{",
"$",
"trans",
"=",
"array",
"(",
"'year'",
"=>",
"'yy'",
",",
"'month'",
"=>",
"'mm'",
",",
"'day'",
"=>",
"'dd'",
",",
"'hour'",
"=>",
"'hh'",
",",
"'min... | Function to return an SQL datetime expression for MSSQL.
used for querying a datetime addition
@param string $date, can be either 'now', literal datetime like '1973-10-14 10:30:00' or field name, e.g. '"SiteTree"."Created"'
@param string $interval to be added, use the format [sign][integer] [qualifier], e.g. -1 Day, +... | [
"Function",
"to",
"return",
"an",
"SQL",
"datetime",
"expression",
"for",
"MSSQL",
".",
"used",
"for",
"querying",
"a",
"datetime",
"addition"
] | 34fb10580af3f403d69ba84984e78bcfc3f48bf3 | https://github.com/silverstripe/silverstripe-mssql/blob/34fb10580af3f403d69ba84984e78bcfc3f48bf3/code/MSSQLDatabase.php#L666-L693 |
221,847 | silverstripe/silverstripe-mssql | code/MSSQLDatabase.php | MSSQLDatabase.datetimeDifferenceClause | public function datetimeDifferenceClause($date1, $date2)
{
if (preg_match('/^now$/i', $date1)) {
$date1 = "CURRENT_TIMESTAMP";
} elseif (preg_match('/^\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}$/i', $date1)) {
$date1 = "'$date1'";
}
if (preg_match('/^now$/i', $date2... | php | public function datetimeDifferenceClause($date1, $date2)
{
if (preg_match('/^now$/i', $date1)) {
$date1 = "CURRENT_TIMESTAMP";
} elseif (preg_match('/^\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}$/i', $date1)) {
$date1 = "'$date1'";
}
if (preg_match('/^now$/i', $date2... | [
"public",
"function",
"datetimeDifferenceClause",
"(",
"$",
"date1",
",",
"$",
"date2",
")",
"{",
"if",
"(",
"preg_match",
"(",
"'/^now$/i'",
",",
"$",
"date1",
")",
")",
"{",
"$",
"date1",
"=",
"\"CURRENT_TIMESTAMP\"",
";",
"}",
"elseif",
"(",
"preg_match... | Function to return an SQL datetime expression for MSSQL.
used for querying a datetime substraction
@param string $date1, can be either 'now', literal datetime like '1973-10-14 10:30:00' or field name, e.g. '"SiteTree"."Created"'
@param string $date2 to be substracted of $date1, can be either 'now', literal datetime li... | [
"Function",
"to",
"return",
"an",
"SQL",
"datetime",
"expression",
"for",
"MSSQL",
".",
"used",
"for",
"querying",
"a",
"datetime",
"substraction"
] | 34fb10580af3f403d69ba84984e78bcfc3f48bf3 | https://github.com/silverstripe/silverstripe-mssql/blob/34fb10580af3f403d69ba84984e78bcfc3f48bf3/code/MSSQLDatabase.php#L703-L718 |
221,848 | tabuna/VestaAPI | src/Services/User.php | User.regUser | public function regUser($username, $password, $email, $package, $fistName, $lastName)
{
return $this->send('v-add-user', $username, $password, $email, $package, $fistName, $lastName);
} | php | public function regUser($username, $password, $email, $package, $fistName, $lastName)
{
return $this->send('v-add-user', $username, $password, $email, $package, $fistName, $lastName);
} | [
"public",
"function",
"regUser",
"(",
"$",
"username",
",",
"$",
"password",
",",
"$",
"email",
",",
"$",
"package",
",",
"$",
"fistName",
",",
"$",
"lastName",
")",
"{",
"return",
"$",
"this",
"->",
"send",
"(",
"'v-add-user'",
",",
"$",
"username",
... | Registration User.
@param $username
@param $password
@param $email
@param $package
@param $fistName
@param $lastName
@return mixed | [
"Registration",
"User",
"."
] | 3f6e9c411b70d01d4cc38cb4e007803ff0abd457 | https://github.com/tabuna/VestaAPI/blob/3f6e9c411b70d01d4cc38cb4e007803ff0abd457/src/Services/User.php#L19-L22 |
221,849 | tabuna/VestaAPI | src/Services/User.php | User.showUserBackup | public function showUserBackup($backup)
{
$this->returnCode = 'no';
$answer = $this->send('v-list-user-backup', $this->userName, $backup, 'json');
$data = json_decode($answer, true);
return $data;
} | php | public function showUserBackup($backup)
{
$this->returnCode = 'no';
$answer = $this->send('v-list-user-backup', $this->userName, $backup, 'json');
$data = json_decode($answer, true);
return $data;
} | [
"public",
"function",
"showUserBackup",
"(",
"$",
"backup",
")",
"{",
"$",
"this",
"->",
"returnCode",
"=",
"'no'",
";",
"$",
"answer",
"=",
"$",
"this",
"->",
"send",
"(",
"'v-list-user-backup'",
",",
"$",
"this",
"->",
"userName",
",",
"$",
"backup",
... | Show Backup.
@param $backup
@return mixed | [
"Show",
"Backup",
"."
] | 3f6e9c411b70d01d4cc38cb4e007803ff0abd457 | https://github.com/tabuna/VestaAPI/blob/3f6e9c411b70d01d4cc38cb4e007803ff0abd457/src/Services/User.php#L103-L110 |
221,850 | xperseguers/doodle_client | src/Client.php | Client.getTokenFromCookie | protected function getTokenFromCookie()
{
$cookies = $this->getCookies();
if (!empty($cookies['token']) && $cookies['token']['expiration'] > time()) {
return $cookies['token']['value'];
}
return null;
} | php | protected function getTokenFromCookie()
{
$cookies = $this->getCookies();
if (!empty($cookies['token']) && $cookies['token']['expiration'] > time()) {
return $cookies['token']['value'];
}
return null;
} | [
"protected",
"function",
"getTokenFromCookie",
"(",
")",
"{",
"$",
"cookies",
"=",
"$",
"this",
"->",
"getCookies",
"(",
")",
";",
"if",
"(",
"!",
"empty",
"(",
"$",
"cookies",
"[",
"'token'",
"]",
")",
"&&",
"$",
"cookies",
"[",
"'token'",
"]",
"[",... | Returns the authentication token.
@return string|null | [
"Returns",
"the",
"authentication",
"token",
"."
] | 5ad422023d3d599631e908c852ef04fb7afa7087 | https://github.com/xperseguers/doodle_client/blob/5ad422023d3d599631e908c852ef04fb7afa7087/src/Client.php#L108-L116 |
221,851 | xperseguers/doodle_client | src/Client.php | Client.getCookies | public function getCookies(): array
{
$cookies = [];
$cookieFileName = $this->getCookieFileName();
if (!file_exists($cookieFileName)) {
return $cookies;
}
$contents = file_get_contents($cookieFileName);
$lines = explode(LF, $contents);
foreach ($l... | php | public function getCookies(): array
{
$cookies = [];
$cookieFileName = $this->getCookieFileName();
if (!file_exists($cookieFileName)) {
return $cookies;
}
$contents = file_get_contents($cookieFileName);
$lines = explode(LF, $contents);
foreach ($l... | [
"public",
"function",
"getCookies",
"(",
")",
":",
"array",
"{",
"$",
"cookies",
"=",
"[",
"]",
";",
"$",
"cookieFileName",
"=",
"$",
"this",
"->",
"getCookieFileName",
"(",
")",
";",
"if",
"(",
"!",
"file_exists",
"(",
"$",
"cookieFileName",
")",
")",... | Returns the available cookies.
@return array | [
"Returns",
"the",
"available",
"cookies",
"."
] | 5ad422023d3d599631e908c852ef04fb7afa7087 | https://github.com/xperseguers/doodle_client/blob/5ad422023d3d599631e908c852ef04fb7afa7087/src/Client.php#L123-L148 |
221,852 | xperseguers/doodle_client | src/Client.php | Client.getCookieFileName | protected function getCookieFileName(): string
{
return $this->cookiePath . sha1($this->username . chr(0) . $this->password . chr(0) . $this->userAgent);
} | php | protected function getCookieFileName(): string
{
return $this->cookiePath . sha1($this->username . chr(0) . $this->password . chr(0) . $this->userAgent);
} | [
"protected",
"function",
"getCookieFileName",
"(",
")",
":",
"string",
"{",
"return",
"$",
"this",
"->",
"cookiePath",
".",
"sha1",
"(",
"$",
"this",
"->",
"username",
".",
"chr",
"(",
"0",
")",
".",
"$",
"this",
"->",
"password",
".",
"chr",
"(",
"0... | Returns the cookie file name.
@return string | [
"Returns",
"the",
"cookie",
"file",
"name",
"."
] | 5ad422023d3d599631e908c852ef04fb7afa7087 | https://github.com/xperseguers/doodle_client/blob/5ad422023d3d599631e908c852ef04fb7afa7087/src/Client.php#L155-L158 |
221,853 | xperseguers/doodle_client | src/Client.php | Client.connect | public function connect(): bool
{
/** @var array $response */
$response = $this->doPost('/api/v2.0/users/oauth/token', [
'email' => $this->username,
'password' => $this->password
]);
// Define the token we want to use
$this->storeToken($response['acce... | php | public function connect(): bool
{
/** @var array $response */
$response = $this->doPost('/api/v2.0/users/oauth/token', [
'email' => $this->username,
'password' => $this->password
]);
// Define the token we want to use
$this->storeToken($response['acce... | [
"public",
"function",
"connect",
"(",
")",
":",
"bool",
"{",
"/** @var array $response */",
"$",
"response",
"=",
"$",
"this",
"->",
"doPost",
"(",
"'/api/v2.0/users/oauth/token'",
",",
"[",
"'email'",
"=>",
"$",
"this",
"->",
"username",
",",
"'password'",
"=... | Connects to Doodle.
@return bool Returns true if connection succeeded, otherwise false | [
"Connects",
"to",
"Doodle",
"."
] | 5ad422023d3d599631e908c852ef04fb7afa7087 | https://github.com/xperseguers/doodle_client/blob/5ad422023d3d599631e908c852ef04fb7afa7087/src/Client.php#L231-L245 |
221,854 | xperseguers/doodle_client | src/Client.php | Client.doRequest | protected function doRequest(string $method, string $relativeUrl, array $data)
{
$url = 'https://doodle.com' . $relativeUrl;
$cookieFileName = $this->getCookieFileName();
$dataQuery = '';
if (strpos($relativeUrl, 'api') !== false) {
if (!empty($data)) {
... | php | protected function doRequest(string $method, string $relativeUrl, array $data)
{
$url = 'https://doodle.com' . $relativeUrl;
$cookieFileName = $this->getCookieFileName();
$dataQuery = '';
if (strpos($relativeUrl, 'api') !== false) {
if (!empty($data)) {
... | [
"protected",
"function",
"doRequest",
"(",
"string",
"$",
"method",
",",
"string",
"$",
"relativeUrl",
",",
"array",
"$",
"data",
")",
"{",
"$",
"url",
"=",
"'https://doodle.com'",
".",
"$",
"relativeUrl",
";",
"$",
"cookieFileName",
"=",
"$",
"this",
"->"... | Sends a HTTP request to Doodle.
@param string $method
@param string $relativeUrl
@param array $data
@return string|array | [
"Sends",
"a",
"HTTP",
"request",
"to",
"Doodle",
"."
] | 5ad422023d3d599631e908c852ef04fb7afa7087 | https://github.com/xperseguers/doodle_client/blob/5ad422023d3d599631e908c852ef04fb7afa7087/src/Client.php#L280-L366 |
221,855 | xperseguers/doodle_client | src/Client.php | Client.storeToken | protected function storeToken(string $token)
{
$cookies = $this->getCookies();
$cookies['token']['domain'] = '.doodle.com';
$cookies['token']['truefalse'] = 'TRUE';
$cookies['token']['path'] = '/';
$cookies['token']['truefalse2'] = 'FALSE';
$cookies['token']['somethin... | php | protected function storeToken(string $token)
{
$cookies = $this->getCookies();
$cookies['token']['domain'] = '.doodle.com';
$cookies['token']['truefalse'] = 'TRUE';
$cookies['token']['path'] = '/';
$cookies['token']['truefalse2'] = 'FALSE';
$cookies['token']['somethin... | [
"protected",
"function",
"storeToken",
"(",
"string",
"$",
"token",
")",
"{",
"$",
"cookies",
"=",
"$",
"this",
"->",
"getCookies",
"(",
")",
";",
"$",
"cookies",
"[",
"'token'",
"]",
"[",
"'domain'",
"]",
"=",
"'.doodle.com'",
";",
"$",
"cookies",
"["... | Stores the authentication token.
Business logic is inspired from
http://doodle.com/builstatic/<timestamp>/doodle/js/common/loginUtils.js:updateToken()
@param string $token
@return void | [
"Stores",
"the",
"authentication",
"token",
"."
] | 5ad422023d3d599631e908c852ef04fb7afa7087 | https://github.com/xperseguers/doodle_client/blob/5ad422023d3d599631e908c852ef04fb7afa7087/src/Client.php#L377-L395 |
221,856 | xperseguers/doodle_client | src/Client.php | Client.persistCookies | protected function persistCookies(array $cookies)
{
$cookieFileName = $this->getCookieFileName();
$contents = <<<EOT
# Netscape HTTP Cookie File
# http://curl.haxx.se/docs/http-cookies.html
# This file was generated by libcurl! Edit at your own risk.
EOT;
foreach ($cookies as $cookie) {
... | php | protected function persistCookies(array $cookies)
{
$cookieFileName = $this->getCookieFileName();
$contents = <<<EOT
# Netscape HTTP Cookie File
# http://curl.haxx.se/docs/http-cookies.html
# This file was generated by libcurl! Edit at your own risk.
EOT;
foreach ($cookies as $cookie) {
... | [
"protected",
"function",
"persistCookies",
"(",
"array",
"$",
"cookies",
")",
"{",
"$",
"cookieFileName",
"=",
"$",
"this",
"->",
"getCookieFileName",
"(",
")",
";",
"$",
"contents",
"=",
" <<<EOT\n# Netscape HTTP Cookie File\n# http://curl.haxx.se/docs/http-cookies.html\... | Persists cookies.
@param array $cookies
@return void | [
"Persists",
"cookies",
"."
] | 5ad422023d3d599631e908c852ef04fb7afa7087 | https://github.com/xperseguers/doodle_client/blob/5ad422023d3d599631e908c852ef04fb7afa7087/src/Client.php#L403-L418 |
221,857 | xperseguers/doodle_client | src/Client.php | Client.disconnect | public function disconnect(): bool
{
$cookieFileName = $this->getCookieFileName();
if (file_exists($cookieFileName)) {
return unlink($cookieFileName);
}
return false;
} | php | public function disconnect(): bool
{
$cookieFileName = $this->getCookieFileName();
if (file_exists($cookieFileName)) {
return unlink($cookieFileName);
}
return false;
} | [
"public",
"function",
"disconnect",
"(",
")",
":",
"bool",
"{",
"$",
"cookieFileName",
"=",
"$",
"this",
"->",
"getCookieFileName",
"(",
")",
";",
"if",
"(",
"file_exists",
"(",
"$",
"cookieFileName",
")",
")",
"{",
"return",
"unlink",
"(",
"$",
"cookieF... | Disconnects from Doodle.
@return bool Returns true if disconnect succeeded, otherwise false | [
"Disconnects",
"from",
"Doodle",
"."
] | 5ad422023d3d599631e908c852ef04fb7afa7087 | https://github.com/xperseguers/doodle_client/blob/5ad422023d3d599631e908c852ef04fb7afa7087/src/Client.php#L437-L445 |
221,858 | xperseguers/doodle_client | src/Client.php | Client.getUserInfo | public function getUserInfo(): array
{
$data = [
'isMobile' => 'false',
'includeKalsysInfos' => 'false',
'token' => $this->token,
];
$response = $this->doGet('/np/users/me', $data);
$userInfo = json_decode($response, true);
return $userInf... | php | public function getUserInfo(): array
{
$data = [
'isMobile' => 'false',
'includeKalsysInfos' => 'false',
'token' => $this->token,
];
$response = $this->doGet('/np/users/me', $data);
$userInfo = json_decode($response, true);
return $userInf... | [
"public",
"function",
"getUserInfo",
"(",
")",
":",
"array",
"{",
"$",
"data",
"=",
"[",
"'isMobile'",
"=>",
"'false'",
",",
"'includeKalsysInfos'",
"=>",
"'false'",
",",
"'token'",
"=>",
"$",
"this",
"->",
"token",
",",
"]",
";",
"$",
"response",
"=",
... | Returns user information.
@return array | [
"Returns",
"user",
"information",
"."
] | 5ad422023d3d599631e908c852ef04fb7afa7087 | https://github.com/xperseguers/doodle_client/blob/5ad422023d3d599631e908c852ef04fb7afa7087/src/Client.php#L452-L463 |
221,859 | xperseguers/doodle_client | src/Client.php | Client.getPersonalPolls | public function getPersonalPolls()
{
$data = [
'fullList' => 'true',
'locale' => $this->locale,
'token' => $this->token,
];
$response = $this->doGet('/np/users/me/dashboard/myPolls', $data);
if (strpos($response, '<title>Doodle: Not found') !== fa... | php | public function getPersonalPolls()
{
$data = [
'fullList' => 'true',
'locale' => $this->locale,
'token' => $this->token,
];
$response = $this->doGet('/np/users/me/dashboard/myPolls', $data);
if (strpos($response, '<title>Doodle: Not found') !== fa... | [
"public",
"function",
"getPersonalPolls",
"(",
")",
"{",
"$",
"data",
"=",
"[",
"'fullList'",
"=>",
"'true'",
",",
"'locale'",
"=>",
"$",
"this",
"->",
"locale",
",",
"'token'",
"=>",
"$",
"this",
"->",
"token",
",",
"]",
";",
"$",
"response",
"=",
"... | Returns personal polls.
@return Poll[]
@throws \Causal\DoodleClient\Exception\UnauthenticatedException | [
"Returns",
"personal",
"polls",
"."
] | 5ad422023d3d599631e908c852ef04fb7afa7087 | https://github.com/xperseguers/doodle_client/blob/5ad422023d3d599631e908c852ef04fb7afa7087/src/Client.php#L471-L493 |
221,860 | xperseguers/doodle_client | src/Client.php | Client.getOtherPolls | public function getOtherPolls()
{
$data = [
'fullList' => 'true',
'locale' => $this->locale,
'token' => $this->token,
];
$response = $this->doGet('/np/users/me/dashboard/otherPolls', $data);
$polls = json_decode($response, true);
$objects ... | php | public function getOtherPolls()
{
$data = [
'fullList' => 'true',
'locale' => $this->locale,
'token' => $this->token,
];
$response = $this->doGet('/np/users/me/dashboard/otherPolls', $data);
$polls = json_decode($response, true);
$objects ... | [
"public",
"function",
"getOtherPolls",
"(",
")",
"{",
"$",
"data",
"=",
"[",
"'fullList'",
"=>",
"'true'",
",",
"'locale'",
"=>",
"$",
"this",
"->",
"locale",
",",
"'token'",
"=>",
"$",
"this",
"->",
"token",
",",
"]",
";",
"$",
"response",
"=",
"$",... | Returns other polls.
@return Poll[] | [
"Returns",
"other",
"polls",
"."
] | 5ad422023d3d599631e908c852ef04fb7afa7087 | https://github.com/xperseguers/doodle_client/blob/5ad422023d3d599631e908c852ef04fb7afa7087/src/Client.php#L500-L518 |
221,861 | xperseguers/doodle_client | src/Client.php | Client.deletePoll | public function deletePoll(Poll $poll): bool
{
if (empty($poll->getAdminKey())) {
throw new \Exception(sprintf('Admin key not available. Poll %s cannot be deleted.', $poll->getId()), 1443782170);
}
return $this->doDelete('/api/v2.0/polls/' . $poll->getId() . '?adminKey=' . $poll-... | php | public function deletePoll(Poll $poll): bool
{
if (empty($poll->getAdminKey())) {
throw new \Exception(sprintf('Admin key not available. Poll %s cannot be deleted.', $poll->getId()), 1443782170);
}
return $this->doDelete('/api/v2.0/polls/' . $poll->getId() . '?adminKey=' . $poll-... | [
"public",
"function",
"deletePoll",
"(",
"Poll",
"$",
"poll",
")",
":",
"bool",
"{",
"if",
"(",
"empty",
"(",
"$",
"poll",
"->",
"getAdminKey",
"(",
")",
")",
")",
"{",
"throw",
"new",
"\\",
"Exception",
"(",
"sprintf",
"(",
"'Admin key not available. Po... | Deletes a poll.
@param Poll $poll
@return bool
@throws \Exception | [
"Deletes",
"a",
"poll",
"."
] | 5ad422023d3d599631e908c852ef04fb7afa7087 | https://github.com/xperseguers/doodle_client/blob/5ad422023d3d599631e908c852ef04fb7afa7087/src/Client.php#L646-L652 |
221,862 | xperseguers/doodle_client | src/Client.php | Client.deleteParticipant | public function deleteParticipant(Poll $poll, int $participantid)
{
if (empty($poll->getAdminKey())) {
throw new \Exception(sprintf('Admin key not available. Poll %s cannot be deleted.', $poll->getId()), 1443782170);
}
return $this->doDelete('/api/v2.0/polls/' . $poll->getId() . ... | php | public function deleteParticipant(Poll $poll, int $participantid)
{
if (empty($poll->getAdminKey())) {
throw new \Exception(sprintf('Admin key not available. Poll %s cannot be deleted.', $poll->getId()), 1443782170);
}
return $this->doDelete('/api/v2.0/polls/' . $poll->getId() . ... | [
"public",
"function",
"deleteParticipant",
"(",
"Poll",
"$",
"poll",
",",
"int",
"$",
"participantid",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"poll",
"->",
"getAdminKey",
"(",
")",
")",
")",
"{",
"throw",
"new",
"\\",
"Exception",
"(",
"sprintf",
"(",... | Deletes a participant.
@param Poll $poll
@param int $participantid
@return string
@throws \Exception | [
"Deletes",
"a",
"participant",
"."
] | 5ad422023d3d599631e908c852ef04fb7afa7087 | https://github.com/xperseguers/doodle_client/blob/5ad422023d3d599631e908c852ef04fb7afa7087/src/Client.php#L662-L668 |
221,863 | tabuna/VestaAPI | src/Services/BD.php | BD.listOnlyBD | public function listOnlyBD($database)
{
$this->returnCode = 'no';
$listBd = $this->send('v-list-database', $this->userName, $database, 'json');
$data = json_decode($listBd, true);
return $data;
} | php | public function listOnlyBD($database)
{
$this->returnCode = 'no';
$listBd = $this->send('v-list-database', $this->userName, $database, 'json');
$data = json_decode($listBd, true);
return $data;
} | [
"public",
"function",
"listOnlyBD",
"(",
"$",
"database",
")",
"{",
"$",
"this",
"->",
"returnCode",
"=",
"'no'",
";",
"$",
"listBd",
"=",
"$",
"this",
"->",
"send",
"(",
"'v-list-database'",
",",
"$",
"this",
"->",
"userName",
",",
"$",
"database",
",... | List Only BD.
@param $database
@return mixed | [
"List",
"Only",
"BD",
"."
] | 3f6e9c411b70d01d4cc38cb4e007803ff0abd457 | https://github.com/tabuna/VestaAPI/blob/3f6e9c411b70d01d4cc38cb4e007803ff0abd457/src/Services/BD.php#L52-L59 |
221,864 | tabuna/VestaAPI | src/Services/BD.php | BD.addDateBase | public function addDateBase($database, $dbuser, $password, $type, $charset)
{
return $this->send('v-add-database', $this->userName, $database, $dbuser, $password, $type,
'localhost', $charset);
} | php | public function addDateBase($database, $dbuser, $password, $type, $charset)
{
return $this->send('v-add-database', $this->userName, $database, $dbuser, $password, $type,
'localhost', $charset);
} | [
"public",
"function",
"addDateBase",
"(",
"$",
"database",
",",
"$",
"dbuser",
",",
"$",
"password",
",",
"$",
"type",
",",
"$",
"charset",
")",
"{",
"return",
"$",
"this",
"->",
"send",
"(",
"'v-add-database'",
",",
"$",
"this",
"->",
"userName",
",",... | Add date base.
@param $database
@param $dbuser
@param $password
@param string $type
@param $charset
@return mixed | [
"Add",
"date",
"base",
"."
] | 3f6e9c411b70d01d4cc38cb4e007803ff0abd457 | https://github.com/tabuna/VestaAPI/blob/3f6e9c411b70d01d4cc38cb4e007803ff0abd457/src/Services/BD.php#L72-L76 |
221,865 | stackify/stackify-api-php | src/Stackify/Utils/TypeConverter.php | TypeConverter.stringify | public static function stringify($value)
{
$string = '';
if (is_scalar($value)) {
// integer, float, string, boolean
$string = (string)$value;
} elseif (is_resource($value)) {
// resource
$string = '[resource]';
} else {
// ... | php | public static function stringify($value)
{
$string = '';
if (is_scalar($value)) {
// integer, float, string, boolean
$string = (string)$value;
} elseif (is_resource($value)) {
// resource
$string = '[resource]';
} else {
// ... | [
"public",
"static",
"function",
"stringify",
"(",
"$",
"value",
")",
"{",
"$",
"string",
"=",
"''",
";",
"if",
"(",
"is_scalar",
"(",
"$",
"value",
")",
")",
"{",
"// integer, float, string, boolean",
"$",
"string",
"=",
"(",
"string",
")",
"$",
"value",... | Converts any PHP type to string
@param mixed $value
@return string | [
"Converts",
"any",
"PHP",
"type",
"to",
"string"
] | 73b4e67432dc532d1dd46b90d385feb321f24e0a | https://github.com/stackify/stackify-api-php/blob/73b4e67432dc532d1dd46b90d385feb321f24e0a/src/Stackify/Utils/TypeConverter.php#L13-L27 |
221,866 | tabuna/VestaAPI | src/Services/Cron.php | Cron.listCron | public function listCron()
{
$this->returnCode = 'no';
$listDns = $this->send('v-list-cron-jobs', $this->userName, 'json');
$data = json_decode($listDns, true);
return $data;
} | php | public function listCron()
{
$this->returnCode = 'no';
$listDns = $this->send('v-list-cron-jobs', $this->userName, 'json');
$data = json_decode($listDns, true);
return $data;
} | [
"public",
"function",
"listCron",
"(",
")",
"{",
"$",
"this",
"->",
"returnCode",
"=",
"'no'",
";",
"$",
"listDns",
"=",
"$",
"this",
"->",
"send",
"(",
"'v-list-cron-jobs'",
",",
"$",
"this",
"->",
"userName",
",",
"'json'",
")",
";",
"$",
"data",
"... | Cron list.
@return mixed | [
"Cron",
"list",
"."
] | 3f6e9c411b70d01d4cc38cb4e007803ff0abd457 | https://github.com/tabuna/VestaAPI/blob/3f6e9c411b70d01d4cc38cb4e007803ff0abd457/src/Services/Cron.php#L12-L19 |
221,867 | tabuna/VestaAPI | src/Services/Cron.php | Cron.addCron | public function addCron($min, $hour, $day, $month, $wday, $cmd)
{
return $this->send('v-add-cron-job', $this->userName, $min, $hour, $day, $month, $wday,
$cmd);
} | php | public function addCron($min, $hour, $day, $month, $wday, $cmd)
{
return $this->send('v-add-cron-job', $this->userName, $min, $hour, $day, $month, $wday,
$cmd);
} | [
"public",
"function",
"addCron",
"(",
"$",
"min",
",",
"$",
"hour",
",",
"$",
"day",
",",
"$",
"month",
",",
"$",
"wday",
",",
"$",
"cmd",
")",
"{",
"return",
"$",
"this",
"->",
"send",
"(",
"'v-add-cron-job'",
",",
"$",
"this",
"->",
"userName",
... | Add Cron.
@param $min
@param $hour
@param $day
@param $month
@param $wday
@param $cmd
@return mixed | [
"Add",
"Cron",
"."
] | 3f6e9c411b70d01d4cc38cb4e007803ff0abd457 | https://github.com/tabuna/VestaAPI/blob/3f6e9c411b70d01d4cc38cb4e007803ff0abd457/src/Services/Cron.php#L33-L37 |
221,868 | tabuna/VestaAPI | src/Services/Cron.php | Cron.showCron | public function showCron($job)
{
$this->returnCode = 'no';
$request = $this->send('v-list-cron-job', $this->userName, $job, 'json');
$data = json_decode($request, true);
return $data;
} | php | public function showCron($job)
{
$this->returnCode = 'no';
$request = $this->send('v-list-cron-job', $this->userName, $job, 'json');
$data = json_decode($request, true);
return $data;
} | [
"public",
"function",
"showCron",
"(",
"$",
"job",
")",
"{",
"$",
"this",
"->",
"returnCode",
"=",
"'no'",
";",
"$",
"request",
"=",
"$",
"this",
"->",
"send",
"(",
"'v-list-cron-job'",
",",
"$",
"this",
"->",
"userName",
",",
"$",
"job",
",",
"'json... | Show Cron.
@param $job
@return mixed | [
"Show",
"Cron",
"."
] | 3f6e9c411b70d01d4cc38cb4e007803ff0abd457 | https://github.com/tabuna/VestaAPI/blob/3f6e9c411b70d01d4cc38cb4e007803ff0abd457/src/Services/Cron.php#L46-L53 |
221,869 | tabuna/VestaAPI | src/Services/Cron.php | Cron.editCron | public function editCron($job, $min, $hour, $day, $month, $wday, $cmd)
{
return $this->send('v-change-cron-job', $this->userName, $job, $min, $hour, $day, $month,
$wday, $cmd);
} | php | public function editCron($job, $min, $hour, $day, $month, $wday, $cmd)
{
return $this->send('v-change-cron-job', $this->userName, $job, $min, $hour, $day, $month,
$wday, $cmd);
} | [
"public",
"function",
"editCron",
"(",
"$",
"job",
",",
"$",
"min",
",",
"$",
"hour",
",",
"$",
"day",
",",
"$",
"month",
",",
"$",
"wday",
",",
"$",
"cmd",
")",
"{",
"return",
"$",
"this",
"->",
"send",
"(",
"'v-change-cron-job'",
",",
"$",
"thi... | Edit cron.
@param $job
@param $min
@param $hour
@param $day
@param $month
@param $wday
@param $cmd
@return mixed | [
"Edit",
"cron",
"."
] | 3f6e9c411b70d01d4cc38cb4e007803ff0abd457 | https://github.com/tabuna/VestaAPI/blob/3f6e9c411b70d01d4cc38cb4e007803ff0abd457/src/Services/Cron.php#L80-L84 |
221,870 | tabuna/VestaAPI | src/Services/Web.php | Web.addFtpDomain | public function addFtpDomain($domain, $ftpUserName, $ftpPassword, $ftpPath)
{
return $this->send('v-add-web-domain-ftp', $this->userName, $domain, $ftpUserName, $ftpPassword,
$ftpPath);
} | php | public function addFtpDomain($domain, $ftpUserName, $ftpPassword, $ftpPath)
{
return $this->send('v-add-web-domain-ftp', $this->userName, $domain, $ftpUserName, $ftpPassword,
$ftpPath);
} | [
"public",
"function",
"addFtpDomain",
"(",
"$",
"domain",
",",
"$",
"ftpUserName",
",",
"$",
"ftpPassword",
",",
"$",
"ftpPath",
")",
"{",
"return",
"$",
"this",
"->",
"send",
"(",
"'v-add-web-domain-ftp'",
",",
"$",
"this",
"->",
"userName",
",",
"$",
"... | Add FTP domain.
@param $domain
@param $ftpUserName
@param $ftpPassword
@param $ftpPath
@return mixed | [
"Add",
"FTP",
"domain",
"."
] | 3f6e9c411b70d01d4cc38cb4e007803ff0abd457 | https://github.com/tabuna/VestaAPI/blob/3f6e9c411b70d01d4cc38cb4e007803ff0abd457/src/Services/Web.php#L135-L139 |
221,871 | tabuna/VestaAPI | src/Services/Web.php | Web.changeWebDomain | public function changeWebDomain($domain, $ftpUserName, $ftpPath)
{
return $this->send('v-change-web-domain-ftp-path', $this->userName, $domain, $ftpUserName,
$ftpPath);
} | php | public function changeWebDomain($domain, $ftpUserName, $ftpPath)
{
return $this->send('v-change-web-domain-ftp-path', $this->userName, $domain, $ftpUserName,
$ftpPath);
} | [
"public",
"function",
"changeWebDomain",
"(",
"$",
"domain",
",",
"$",
"ftpUserName",
",",
"$",
"ftpPath",
")",
"{",
"return",
"$",
"this",
"->",
"send",
"(",
"'v-change-web-domain-ftp-path'",
",",
"$",
"this",
"->",
"userName",
",",
"$",
"domain",
",",
"$... | Change web domain.
@param $domain
@param $ftpUserName
@param $ftpPath
@return mixed | [
"Change",
"web",
"domain",
"."
] | 3f6e9c411b70d01d4cc38cb4e007803ff0abd457 | https://github.com/tabuna/VestaAPI/blob/3f6e9c411b70d01d4cc38cb4e007803ff0abd457/src/Services/Web.php#L201-L205 |
221,872 | tabuna/VestaAPI | src/Services/Web.php | Web.changeFtpPassword | public function changeFtpPassword($domain, $ftpUserName, $password)
{
return $this->send('v-change-web-domain-ftp-password', $this->userName, $domain, $ftpUserName,
$password);
} | php | public function changeFtpPassword($domain, $ftpUserName, $password)
{
return $this->send('v-change-web-domain-ftp-password', $this->userName, $domain, $ftpUserName,
$password);
} | [
"public",
"function",
"changeFtpPassword",
"(",
"$",
"domain",
",",
"$",
"ftpUserName",
",",
"$",
"password",
")",
"{",
"return",
"$",
"this",
"->",
"send",
"(",
"'v-change-web-domain-ftp-password'",
",",
"$",
"this",
"->",
"userName",
",",
"$",
"domain",
",... | Change ftp password.
@param $domain
@param $ftpUserName
@param $password
@return mixed | [
"Change",
"ftp",
"password",
"."
] | 3f6e9c411b70d01d4cc38cb4e007803ff0abd457 | https://github.com/tabuna/VestaAPI/blob/3f6e9c411b70d01d4cc38cb4e007803ff0abd457/src/Services/Web.php#L216-L220 |
221,873 | xperseguers/doodle_client | src/Domain/Repository/PollRepository.php | PollRepository.create | public function create(array $data): Poll
{
$poll = new Poll($data['id'], $this);
$poll
->setType($data['type'])
->setTitle($data['title'])
->setState($data['state'])
->setMultiDay((bool)$data['multiDay'])
->setByInvitation((bool)$data['byI... | php | public function create(array $data): Poll
{
$poll = new Poll($data['id'], $this);
$poll
->setType($data['type'])
->setTitle($data['title'])
->setState($data['state'])
->setMultiDay((bool)$data['multiDay'])
->setByInvitation((bool)$data['byI... | [
"public",
"function",
"create",
"(",
"array",
"$",
"data",
")",
":",
"Poll",
"{",
"$",
"poll",
"=",
"new",
"Poll",
"(",
"$",
"data",
"[",
"'id'",
"]",
",",
"$",
"this",
")",
";",
"$",
"poll",
"->",
"setType",
"(",
"$",
"data",
"[",
"'type'",
"]... | Creates a new Poll object.
@param array $data
@return Poll | [
"Creates",
"a",
"new",
"Poll",
"object",
"."
] | 5ad422023d3d599631e908c852ef04fb7afa7087 | https://github.com/xperseguers/doodle_client/blob/5ad422023d3d599631e908c852ef04fb7afa7087/src/Domain/Repository/PollRepository.php#L55-L89 |
221,874 | xperseguers/doodle_client | src/Domain/Repository/PollRepository.php | PollRepository.injectInfo | public function injectInfo(Poll $poll): array
{
$info = $poll->_getInfo();
if ($info === null) {
$info = $this->client->_getInfo($poll);
$poll->_setInfo($info);
}
return $info;
} | php | public function injectInfo(Poll $poll): array
{
$info = $poll->_getInfo();
if ($info === null) {
$info = $this->client->_getInfo($poll);
$poll->_setInfo($info);
}
return $info;
} | [
"public",
"function",
"injectInfo",
"(",
"Poll",
"$",
"poll",
")",
":",
"array",
"{",
"$",
"info",
"=",
"$",
"poll",
"->",
"_getInfo",
"(",
")",
";",
"if",
"(",
"$",
"info",
"===",
"null",
")",
"{",
"$",
"info",
"=",
"$",
"this",
"->",
"client",
... | Injects the information of a given poll.
@param Poll $poll
@return array | [
"Injects",
"the",
"information",
"of",
"a",
"given",
"poll",
"."
] | 5ad422023d3d599631e908c852ef04fb7afa7087 | https://github.com/xperseguers/doodle_client/blob/5ad422023d3d599631e908c852ef04fb7afa7087/src/Domain/Repository/PollRepository.php#L97-L106 |
221,875 | xperseguers/doodle_client | src/Domain/Repository/PollRepository.php | PollRepository.injectDescription | public function injectDescription(Poll $poll)
{
$info = $this->injectInfo($poll);
$description = $this->decodeHtml($info['descriptionHTML']);
$poll->setDescription($description);
} | php | public function injectDescription(Poll $poll)
{
$info = $this->injectInfo($poll);
$description = $this->decodeHtml($info['descriptionHTML']);
$poll->setDescription($description);
} | [
"public",
"function",
"injectDescription",
"(",
"Poll",
"$",
"poll",
")",
"{",
"$",
"info",
"=",
"$",
"this",
"->",
"injectInfo",
"(",
"$",
"poll",
")",
";",
"$",
"description",
"=",
"$",
"this",
"->",
"decodeHtml",
"(",
"$",
"info",
"[",
"'description... | Injects the description of a given poll.
@param Poll $poll
@return void | [
"Injects",
"the",
"description",
"of",
"a",
"given",
"poll",
"."
] | 5ad422023d3d599631e908c852ef04fb7afa7087 | https://github.com/xperseguers/doodle_client/blob/5ad422023d3d599631e908c852ef04fb7afa7087/src/Domain/Repository/PollRepository.php#L114-L119 |
221,876 | xperseguers/doodle_client | src/Domain/Repository/PollRepository.php | PollRepository.injectOptions | public function injectOptions(Poll $poll)
{
$info = $this->injectInfo($poll);
$type = $poll->getType();
$options = array();
foreach ($info['options'] as $i => $optionText) {
if (!empty($optionText['text'])) {
$options[] = new Option($i, null, null, $option... | php | public function injectOptions(Poll $poll)
{
$info = $this->injectInfo($poll);
$type = $poll->getType();
$options = array();
foreach ($info['options'] as $i => $optionText) {
if (!empty($optionText['text'])) {
$options[] = new Option($i, null, null, $option... | [
"public",
"function",
"injectOptions",
"(",
"Poll",
"$",
"poll",
")",
"{",
"$",
"info",
"=",
"$",
"this",
"->",
"injectInfo",
"(",
"$",
"poll",
")",
";",
"$",
"type",
"=",
"$",
"poll",
"->",
"getType",
"(",
")",
";",
"$",
"options",
"=",
"array",
... | Injects the option of a given poll.
@param Poll $poll
@return void | [
"Injects",
"the",
"option",
"of",
"a",
"given",
"poll",
"."
] | 5ad422023d3d599631e908c852ef04fb7afa7087 | https://github.com/xperseguers/doodle_client/blob/5ad422023d3d599631e908c852ef04fb7afa7087/src/Domain/Repository/PollRepository.php#L127-L142 |
221,877 | xperseguers/doodle_client | src/Domain/Repository/PollRepository.php | PollRepository.injectParticipants | public function injectParticipants(Poll $poll)
{
$info = $this->injectInfo($poll);
$options = $poll->getOptions();
$countOptions = count($options);
$participants = [];
foreach ($info['participants'] as $p) {
$preferences = [];
for ($i = 0; $i < $countO... | php | public function injectParticipants(Poll $poll)
{
$info = $this->injectInfo($poll);
$options = $poll->getOptions();
$countOptions = count($options);
$participants = [];
foreach ($info['participants'] as $p) {
$preferences = [];
for ($i = 0; $i < $countO... | [
"public",
"function",
"injectParticipants",
"(",
"Poll",
"$",
"poll",
")",
"{",
"$",
"info",
"=",
"$",
"this",
"->",
"injectInfo",
"(",
"$",
"poll",
")",
";",
"$",
"options",
"=",
"$",
"poll",
"->",
"getOptions",
"(",
")",
";",
"$",
"countOptions",
"... | Injects the participants.
@param Poll $poll
@return void | [
"Injects",
"the",
"participants",
"."
] | 5ad422023d3d599631e908c852ef04fb7afa7087 | https://github.com/xperseguers/doodle_client/blob/5ad422023d3d599631e908c852ef04fb7afa7087/src/Domain/Repository/PollRepository.php#L150-L172 |
221,878 | xperseguers/doodle_client | src/Domain/Repository/PollRepository.php | PollRepository.injectLocation | public function injectLocation(Poll $poll)
{
$location = null;
$info = $this->injectInfo($poll);
if (!empty($info['location'])) {
$location = new Location($info['location']['name']);
if (!empty($info['location']['address'])) {
$location->setAddress($in... | php | public function injectLocation(Poll $poll)
{
$location = null;
$info = $this->injectInfo($poll);
if (!empty($info['location'])) {
$location = new Location($info['location']['name']);
if (!empty($info['location']['address'])) {
$location->setAddress($in... | [
"public",
"function",
"injectLocation",
"(",
"Poll",
"$",
"poll",
")",
"{",
"$",
"location",
"=",
"null",
";",
"$",
"info",
"=",
"$",
"this",
"->",
"injectInfo",
"(",
"$",
"poll",
")",
";",
"if",
"(",
"!",
"empty",
"(",
"$",
"info",
"[",
"'location... | Injects the location.
@param Poll $poll
@return void | [
"Injects",
"the",
"location",
"."
] | 5ad422023d3d599631e908c852ef04fb7afa7087 | https://github.com/xperseguers/doodle_client/blob/5ad422023d3d599631e908c852ef04fb7afa7087/src/Domain/Repository/PollRepository.php#L180-L194 |
221,879 | xperseguers/doodle_client | src/Domain/Repository/PollRepository.php | PollRepository.decodeHtml | protected function decodeHtml($html): string
{
$text = html_entity_decode($html);
$text = preg_replace('#<br\s*/?>#', LF, $text);
return $text;
} | php | protected function decodeHtml($html): string
{
$text = html_entity_decode($html);
$text = preg_replace('#<br\s*/?>#', LF, $text);
return $text;
} | [
"protected",
"function",
"decodeHtml",
"(",
"$",
"html",
")",
":",
"string",
"{",
"$",
"text",
"=",
"html_entity_decode",
"(",
"$",
"html",
")",
";",
"$",
"text",
"=",
"preg_replace",
"(",
"'#<br\\s*/?>#'",
",",
"LF",
",",
"$",
"text",
")",
";",
"retur... | Decodes HTML entities.
@param string $html
@return string | [
"Decodes",
"HTML",
"entities",
"."
] | 5ad422023d3d599631e908c852ef04fb7afa7087 | https://github.com/xperseguers/doodle_client/blob/5ad422023d3d599631e908c852ef04fb7afa7087/src/Domain/Repository/PollRepository.php#L202-L208 |
221,880 | jbboehr/PolynomialRegression.php | src/PolynomialRegression.php | PolynomialRegression.reset | public function reset()
{
$this->forcedValue = array();
$this->xPowers = array();
$this->xyPowers = array();
$this->index = 0;
$this->weightingInterface = NULL;
$squares = ( $this->numberOfCoefficient - 1 ) * 2;
// Initialize power arrays.
for ( $ind... | php | public function reset()
{
$this->forcedValue = array();
$this->xPowers = array();
$this->xyPowers = array();
$this->index = 0;
$this->weightingInterface = NULL;
$squares = ( $this->numberOfCoefficient - 1 ) * 2;
// Initialize power arrays.
for ( $ind... | [
"public",
"function",
"reset",
"(",
")",
"{",
"$",
"this",
"->",
"forcedValue",
"=",
"array",
"(",
")",
";",
"$",
"this",
"->",
"xPowers",
"=",
"array",
"(",
")",
";",
"$",
"this",
"->",
"xyPowers",
"=",
"array",
"(",
")",
";",
"$",
"this",
"->",... | Reset data.
Clear all internal data and prepare for new calculation.
Must be called *after* setNumberOfCoefficient if number of coefficients has
changed. | [
"Reset",
"data",
"."
] | e71d684ee05d5694a29b28f8ca61807f7770d0cd | https://github.com/jbboehr/PolynomialRegression.php/blob/e71d684ee05d5694a29b28f8ca61807f7770d0cd/src/PolynomialRegression.php#L157-L174 |
221,881 | jbboehr/PolynomialRegression.php | src/PolynomialRegression.php | PolynomialRegression.getForcedCoefficient | public function getForcedCoefficient( $coefficient )
{
$result = null;
if ( isset( $this->forcedValue[ $coefficient ] ) )
$result = $this->forcedValue[ $coefficient ];
return $result;
} | php | public function getForcedCoefficient( $coefficient )
{
$result = null;
if ( isset( $this->forcedValue[ $coefficient ] ) )
$result = $this->forcedValue[ $coefficient ];
return $result;
} | [
"public",
"function",
"getForcedCoefficient",
"(",
"$",
"coefficient",
")",
"{",
"$",
"result",
"=",
"null",
";",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"forcedValue",
"[",
"$",
"coefficient",
"]",
")",
")",
"$",
"result",
"=",
"$",
"this",
"->",
... | Get a forced coefficient.
Get a previously set forced coefficient.
@param int $coefficient Which coefficient.
@return float Value of this force this coefficient. Null if the
coefficient isn't being forced.
@since Version 1.1 | [
"Get",
"a",
"forced",
"coefficient",
"."
] | e71d684ee05d5694a29b28f8ca61807f7770d0cd | https://github.com/jbboehr/PolynomialRegression.php/blob/e71d684ee05d5694a29b28f8ca61807f7770d0cd/src/PolynomialRegression.php#L248-L256 |
221,882 | jbboehr/PolynomialRegression.php | src/PolynomialRegression.php | PolynomialRegression.RAdjusted | public function RAdjusted($r2, $predictors, $sample_size)
{
if( ($sample_size - $predictors - 1) != 0 ) {
$radjusted = 1 - ((1 - $r2) * ($sample_size - 1)) / ($sample_size - $predictors - 1);
} else {
$radjusted = 1.0;
}
return $radjusted;
} | php | public function RAdjusted($r2, $predictors, $sample_size)
{
if( ($sample_size - $predictors - 1) != 0 ) {
$radjusted = 1 - ((1 - $r2) * ($sample_size - 1)) / ($sample_size - $predictors - 1);
} else {
$radjusted = 1.0;
}
return $radjusted;
} | [
"public",
"function",
"RAdjusted",
"(",
"$",
"r2",
",",
"$",
"predictors",
",",
"$",
"sample_size",
")",
"{",
"if",
"(",
"(",
"$",
"sample_size",
"-",
"$",
"predictors",
"-",
"1",
")",
"!=",
"0",
")",
"{",
"$",
"radjusted",
"=",
"1",
"-",
"(",
"(... | 08 August, 2016
Calculate the 'Adjusted R Squared'.
Adjusted R2 also indicates how well terms fit a curve or line,
but adjusts for the number of terms in a model.
If you add more and more useless variables to a model, adjusted r-squared will decrease.
If you add more useful variables, adjusted r-squared will increase.... | [
"08",
"August",
"2016",
"Calculate",
"the",
"Adjusted",
"R",
"Squared",
"."
] | e71d684ee05d5694a29b28f8ca61807f7770d0cd | https://github.com/jbboehr/PolynomialRegression.php/blob/e71d684ee05d5694a29b28f8ca61807f7770d0cd/src/PolynomialRegression.php#L594-L603 |
221,883 | silverstripe/silverstripe-mssql | code/MSSQLDatabaseConfigurationHelper.php | MSSQLDatabaseConfigurationHelper.getPDODriver | public static function getPDODriver() {
if (!class_exists('PDO')) {
return null;
}
foreach(PDO::getAvailableDrivers() as $driver) {
if(in_array($driver, array('sqlsrv', 'dblib'))) {
return $driver;
}
}
return null;
} | php | public static function getPDODriver() {
if (!class_exists('PDO')) {
return null;
}
foreach(PDO::getAvailableDrivers() as $driver) {
if(in_array($driver, array('sqlsrv', 'dblib'))) {
return $driver;
}
}
return null;
} | [
"public",
"static",
"function",
"getPDODriver",
"(",
")",
"{",
"if",
"(",
"!",
"class_exists",
"(",
"'PDO'",
")",
")",
"{",
"return",
"null",
";",
"}",
"foreach",
"(",
"PDO",
"::",
"getAvailableDrivers",
"(",
")",
"as",
"$",
"driver",
")",
"{",
"if",
... | Get supported PDO driver
@return null | [
"Get",
"supported",
"PDO",
"driver"
] | 34fb10580af3f403d69ba84984e78bcfc3f48bf3 | https://github.com/silverstripe/silverstripe-mssql/blob/34fb10580af3f403d69ba84984e78bcfc3f48bf3/code/MSSQLDatabaseConfigurationHelper.php#L95-L105 |
221,884 | silverstripe/silverstripe-mssql | code/MSSQLDatabaseConfigurationHelper.php | MSSQLDatabaseConfigurationHelper.quote | protected function quote($conn, $value)
{
if ($conn instanceof PDO) {
return $conn->quote($value);
} elseif (is_resource($conn)) {
$value = str_replace("'", "''", $value);
$value = str_replace("\0", "[NULL]", $value);
return "N'$value'";
} else... | php | protected function quote($conn, $value)
{
if ($conn instanceof PDO) {
return $conn->quote($value);
} elseif (is_resource($conn)) {
$value = str_replace("'", "''", $value);
$value = str_replace("\0", "[NULL]", $value);
return "N'$value'";
} else... | [
"protected",
"function",
"quote",
"(",
"$",
"conn",
",",
"$",
"value",
")",
"{",
"if",
"(",
"$",
"conn",
"instanceof",
"PDO",
")",
"{",
"return",
"$",
"conn",
"->",
"quote",
"(",
"$",
"value",
")",
";",
"}",
"elseif",
"(",
"is_resource",
"(",
"$",
... | Helper function to quote a string value
@param mixed $conn Connection object/resource
@param string $value Value to quote
@return string Quoted string | [
"Helper",
"function",
"to",
"quote",
"a",
"string",
"value"
] | 34fb10580af3f403d69ba84984e78bcfc3f48bf3 | https://github.com/silverstripe/silverstripe-mssql/blob/34fb10580af3f403d69ba84984e78bcfc3f48bf3/code/MSSQLDatabaseConfigurationHelper.php#L114-L126 |
221,885 | silverstripe/silverstripe-mssql | code/MSSQLDatabaseConfigurationHelper.php | MSSQLDatabaseConfigurationHelper.query | protected function query($conn, $sql)
{
$items = array();
if ($conn instanceof PDO) {
$result = $conn->query($sql);
if ($result) {
foreach ($result as $row) {
$items[] = $row[0];
}
}
} elseif (is_resource... | php | protected function query($conn, $sql)
{
$items = array();
if ($conn instanceof PDO) {
$result = $conn->query($sql);
if ($result) {
foreach ($result as $row) {
$items[] = $row[0];
}
}
} elseif (is_resource... | [
"protected",
"function",
"query",
"(",
"$",
"conn",
",",
"$",
"sql",
")",
"{",
"$",
"items",
"=",
"array",
"(",
")",
";",
"if",
"(",
"$",
"conn",
"instanceof",
"PDO",
")",
"{",
"$",
"result",
"=",
"$",
"conn",
"->",
"query",
"(",
"$",
"sql",
")... | Helper function to execute a query
@param mixed $conn Connection object/resource
@param string $sql SQL string to execute
@return array List of first value from each resulting row | [
"Helper",
"function",
"to",
"execute",
"a",
"query"
] | 34fb10580af3f403d69ba84984e78bcfc3f48bf3 | https://github.com/silverstripe/silverstripe-mssql/blob/34fb10580af3f403d69ba84984e78bcfc3f48bf3/code/MSSQLDatabaseConfigurationHelper.php#L135-L154 |
221,886 | ins0/google-measurement-php-client | src/Racecore/GATracking/Tracking/Social.php | Social.createPackage | public function createPackage()
{
if (!$this->getSocialAction()) {
throw new MissingTrackingParameterException('social action must be set');
}
if (!$this->getSocialNetwork()) {
throw new MissingTrackingParameterException('social network must be set');
}
... | php | public function createPackage()
{
if (!$this->getSocialAction()) {
throw new MissingTrackingParameterException('social action must be set');
}
if (!$this->getSocialNetwork()) {
throw new MissingTrackingParameterException('social network must be set');
}
... | [
"public",
"function",
"createPackage",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"getSocialAction",
"(",
")",
")",
"{",
"throw",
"new",
"MissingTrackingParameterException",
"(",
"'social action must be set'",
")",
";",
"}",
"if",
"(",
"!",
"$",
"this... | Returns the Google Paket for Social Tracking
@return array
@throws \Racecore\GATracking\Exception\MissingTrackingParameterException | [
"Returns",
"the",
"Google",
"Paket",
"for",
"Social",
"Tracking"
] | 415cabca0c6d83cd0bd6a8ed6fb695b35f892018 | https://github.com/ins0/google-measurement-php-client/blob/415cabca0c6d83cd0bd6a8ed6fb695b35f892018/src/Racecore/GATracking/Tracking/Social.php#L106-L126 |
221,887 | ins0/google-measurement-php-client | src/Racecore/GATracking/Tracking/AbstractTracking.php | AbstractTracking.addCustomPayloadData | public function addCustomPayloadData($key, $value)
{
if (!is_string($value)) {
throw new Exception\InvalidArgumentException('Custom payload data value must be a string');
}
$this->customPayload[$key] = $value;
} | php | public function addCustomPayloadData($key, $value)
{
if (!is_string($value)) {
throw new Exception\InvalidArgumentException('Custom payload data value must be a string');
}
$this->customPayload[$key] = $value;
} | [
"public",
"function",
"addCustomPayloadData",
"(",
"$",
"key",
",",
"$",
"value",
")",
"{",
"if",
"(",
"!",
"is_string",
"(",
"$",
"value",
")",
")",
"{",
"throw",
"new",
"Exception",
"\\",
"InvalidArgumentException",
"(",
"'Custom payload data value must be a s... | Add Custom Tracking Payload Data send to Google
@param $key
@param $value
@throws Exception\InvalidArgumentException | [
"Add",
"Custom",
"Tracking",
"Payload",
"Data",
"send",
"to",
"Google"
] | 415cabca0c6d83cd0bd6a8ed6fb695b35f892018 | https://github.com/ins0/google-measurement-php-client/blob/415cabca0c6d83cd0bd6a8ed6fb695b35f892018/src/Racecore/GATracking/Tracking/AbstractTracking.php#L140-L147 |
221,888 | kkiernan/caesar-cipher-php | src/KKiernan/CaesarCipher.php | CaesarCipher.crack | public function crack($ciphertext)
{
$plaintexts = [];
foreach (range(0, 25) as $key) {
$plaintexts[$key] = substr_count(strtolower($this->decrypt($ciphertext, $key)), 'e');
}
return array_search(max($plaintexts), $plaintexts);
} | php | public function crack($ciphertext)
{
$plaintexts = [];
foreach (range(0, 25) as $key) {
$plaintexts[$key] = substr_count(strtolower($this->decrypt($ciphertext, $key)), 'e');
}
return array_search(max($plaintexts), $plaintexts);
} | [
"public",
"function",
"crack",
"(",
"$",
"ciphertext",
")",
"{",
"$",
"plaintexts",
"=",
"[",
"]",
";",
"foreach",
"(",
"range",
"(",
"0",
",",
"25",
")",
"as",
"$",
"key",
")",
"{",
"$",
"plaintexts",
"[",
"$",
"key",
"]",
"=",
"substr_count",
"... | Attempts to brute force the key. This is using an extremely simplified
version of frequency analysis. We are just looking for the most
frequently used character and assuming it is the letter e.
@param string $ciphertext
@return int | [
"Attempts",
"to",
"brute",
"force",
"the",
"key",
".",
"This",
"is",
"using",
"an",
"extremely",
"simplified",
"version",
"of",
"frequency",
"analysis",
".",
"We",
"are",
"just",
"looking",
"for",
"the",
"most",
"frequently",
"used",
"character",
"and",
"ass... | 30ef5e634ac1405be9c7c475d8401e298724cbe1 | https://github.com/kkiernan/caesar-cipher-php/blob/30ef5e634ac1405be9c7c475d8401e298724cbe1/src/KKiernan/CaesarCipher.php#L42-L51 |
221,889 | kkiernan/caesar-cipher-php | src/KKiernan/CaesarCipher.php | CaesarCipher.run | protected function run($string, $key)
{
return implode('', array_map(function ($char) use ($key) {
return $this->shift($char, $key);
}, str_split($string)));
} | php | protected function run($string, $key)
{
return implode('', array_map(function ($char) use ($key) {
return $this->shift($char, $key);
}, str_split($string)));
} | [
"protected",
"function",
"run",
"(",
"$",
"string",
",",
"$",
"key",
")",
"{",
"return",
"implode",
"(",
"''",
",",
"array_map",
"(",
"function",
"(",
"$",
"char",
")",
"use",
"(",
"$",
"key",
")",
"{",
"return",
"$",
"this",
"->",
"shift",
"(",
... | Runs the algorithm to encrypt or decrypt the given string.
@return string | [
"Runs",
"the",
"algorithm",
"to",
"encrypt",
"or",
"decrypt",
"the",
"given",
"string",
"."
] | 30ef5e634ac1405be9c7c475d8401e298724cbe1 | https://github.com/kkiernan/caesar-cipher-php/blob/30ef5e634ac1405be9c7c475d8401e298724cbe1/src/KKiernan/CaesarCipher.php#L58-L63 |
221,890 | kkiernan/caesar-cipher-php | src/KKiernan/CaesarCipher.php | CaesarCipher.shift | protected function shift($char, $shift)
{
$shift = $shift % 25;
$ascii = ord($char);
$shifted = $ascii + $shift;
if ($ascii >= 65 && $ascii <= 90) {
return chr($this->wrapUppercase($shifted));
}
if ($ascii >= 97 && $ascii <= 122) {
return chr... | php | protected function shift($char, $shift)
{
$shift = $shift % 25;
$ascii = ord($char);
$shifted = $ascii + $shift;
if ($ascii >= 65 && $ascii <= 90) {
return chr($this->wrapUppercase($shifted));
}
if ($ascii >= 97 && $ascii <= 122) {
return chr... | [
"protected",
"function",
"shift",
"(",
"$",
"char",
",",
"$",
"shift",
")",
"{",
"$",
"shift",
"=",
"$",
"shift",
"%",
"25",
";",
"$",
"ascii",
"=",
"ord",
"(",
"$",
"char",
")",
";",
"$",
"shifted",
"=",
"$",
"ascii",
"+",
"$",
"shift",
";",
... | Handles requests to shift a character by the given number of places.
@param string $char
@param int $shift
@return string | [
"Handles",
"requests",
"to",
"shift",
"a",
"character",
"by",
"the",
"given",
"number",
"of",
"places",
"."
] | 30ef5e634ac1405be9c7c475d8401e298724cbe1 | https://github.com/kkiernan/caesar-cipher-php/blob/30ef5e634ac1405be9c7c475d8401e298724cbe1/src/KKiernan/CaesarCipher.php#L73-L88 |
221,891 | subugoe/typo3-find | Classes/Controller/SearchController.php | SearchController.initializeAction | public function initializeAction()
{
ksort($this->settings['queryFields']);
$this->initializeConnection($this->settings['activeConnection']);
$this->requestArguments = $this->request->getArguments();
$this->requestArguments = ArrayUtility::cleanArgumentsArray($this->requestArgument... | php | public function initializeAction()
{
ksort($this->settings['queryFields']);
$this->initializeConnection($this->settings['activeConnection']);
$this->requestArguments = $this->request->getArguments();
$this->requestArguments = ArrayUtility::cleanArgumentsArray($this->requestArgument... | [
"public",
"function",
"initializeAction",
"(",
")",
"{",
"ksort",
"(",
"$",
"this",
"->",
"settings",
"[",
"'queryFields'",
"]",
")",
";",
"$",
"this",
"->",
"initializeConnection",
"(",
"$",
"this",
"->",
"settings",
"[",
"'activeConnection'",
"]",
")",
"... | Initialisation and setup. | [
"Initialisation",
"and",
"setup",
"."
] | d628a0b6a131d05f4842b08a556fe17cba9d7da0 | https://github.com/subugoe/typo3-find/blob/d628a0b6a131d05f4842b08a556fe17cba9d7da0/Classes/Controller/SearchController.php#L66-L77 |
221,892 | subugoe/typo3-find | Classes/Controller/SearchController.php | SearchController.indexAction | public function indexAction()
{
if (array_key_exists('id', $this->requestArguments)) {
$this->forward('detail');
} else {
$this->searchProvider->setCounter();
$this->response->addAdditionalHeaderData(
FrontendUtility::addQueryInformationAsJavaScrip... | php | public function indexAction()
{
if (array_key_exists('id', $this->requestArguments)) {
$this->forward('detail');
} else {
$this->searchProvider->setCounter();
$this->response->addAdditionalHeaderData(
FrontendUtility::addQueryInformationAsJavaScrip... | [
"public",
"function",
"indexAction",
"(",
")",
"{",
"if",
"(",
"array_key_exists",
"(",
"'id'",
",",
"$",
"this",
"->",
"requestArguments",
")",
")",
"{",
"$",
"this",
"->",
"forward",
"(",
"'detail'",
")",
";",
"}",
"else",
"{",
"$",
"this",
"->",
"... | Index Action. | [
"Index",
"Action",
"."
] | d628a0b6a131d05f4842b08a556fe17cba9d7da0 | https://github.com/subugoe/typo3-find/blob/d628a0b6a131d05f4842b08a556fe17cba9d7da0/Classes/Controller/SearchController.php#L95-L123 |
221,893 | subugoe/typo3-find | Classes/Controller/SearchController.php | SearchController.addStandardAssignments | protected function addStandardAssignments()
{
$this->searchProvider->setConfigurationValue('extendedSearch', $this->searchProvider->isExtendedSearch());
$this->searchProvider->setConfigurationValue(
'uid',
$this->configurationManager->getContentObject()->data['uid']
)... | php | protected function addStandardAssignments()
{
$this->searchProvider->setConfigurationValue('extendedSearch', $this->searchProvider->isExtendedSearch());
$this->searchProvider->setConfigurationValue(
'uid',
$this->configurationManager->getContentObject()->data['uid']
)... | [
"protected",
"function",
"addStandardAssignments",
"(",
")",
"{",
"$",
"this",
"->",
"searchProvider",
"->",
"setConfigurationValue",
"(",
"'extendedSearch'",
",",
"$",
"this",
"->",
"searchProvider",
"->",
"isExtendedSearch",
"(",
")",
")",
";",
"$",
"this",
"-... | Assigns standard variables to the view. | [
"Assigns",
"standard",
"variables",
"to",
"the",
"view",
"."
] | d628a0b6a131d05f4842b08a556fe17cba9d7da0 | https://github.com/subugoe/typo3-find/blob/d628a0b6a131d05f4842b08a556fe17cba9d7da0/Classes/Controller/SearchController.php#L168-L177 |
221,894 | ins0/google-measurement-php-client | src/Racecore/GATracking/Tracking/User/Timing.php | Timing.createPackage | public function createPackage()
{
return array(
't' => 'timing',
'utc' => $this->getTimingCategory(),
'utv' => $this->getTimingVariable(),
'utt' => $this->getTimingTime(),
'utl' => $this->getTimingLabel(),
'dns' => $this->getBrowserDnsL... | php | public function createPackage()
{
return array(
't' => 'timing',
'utc' => $this->getTimingCategory(),
'utv' => $this->getTimingVariable(),
'utt' => $this->getTimingTime(),
'utl' => $this->getTimingLabel(),
'dns' => $this->getBrowserDnsL... | [
"public",
"function",
"createPackage",
"(",
")",
"{",
"return",
"array",
"(",
"'t'",
"=>",
"'timing'",
",",
"'utc'",
"=>",
"$",
"this",
"->",
"getTimingCategory",
"(",
")",
",",
"'utv'",
"=>",
"$",
"this",
"->",
"getTimingVariable",
"(",
")",
",",
"'utt'... | Returns the Paket for User Timing Tracking
@return array | [
"Returns",
"the",
"Paket",
"for",
"User",
"Timing",
"Tracking"
] | 415cabca0c6d83cd0bd6a8ed6fb695b35f892018 | https://github.com/ins0/google-measurement-php-client/blob/415cabca0c6d83cd0bd6a8ed6fb695b35f892018/src/Racecore/GATracking/Tracking/User/Timing.php#L236-L250 |
221,895 | ins0/google-measurement-php-client | src/Racecore/GATracking/Tracking/Ecommerce/Item.php | Item.createPackage | public function createPackage()
{
if (!$this->getTransactionID()) {
throw new MissingTrackingParameterException('transaction id is missing');
}
if (!$this->getName()) {
throw new MissingTrackingParameterException('item name is missing');
}
return arr... | php | public function createPackage()
{
if (!$this->getTransactionID()) {
throw new MissingTrackingParameterException('transaction id is missing');
}
if (!$this->getName()) {
throw new MissingTrackingParameterException('item name is missing');
}
return arr... | [
"public",
"function",
"createPackage",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"getTransactionID",
"(",
")",
")",
"{",
"throw",
"new",
"MissingTrackingParameterException",
"(",
"'transaction id is missing'",
")",
";",
"}",
"if",
"(",
"!",
"$",
"thi... | Create the Package
@return array
@throws \Racecore\GATracking\Exception\MissingTrackingParameterException | [
"Create",
"the",
"Package"
] | 415cabca0c6d83cd0bd6a8ed6fb695b35f892018 | https://github.com/ins0/google-measurement-php-client/blob/415cabca0c6d83cd0bd6a8ed6fb695b35f892018/src/Racecore/GATracking/Tracking/Ecommerce/Item.php#L193-L213 |
221,896 | wallee-payment/php-sdk | lib/Http/CurlHttpClient.php | CurlHttpClient.handleResponse | private function handleResponse(ApiClient $apiClient, HttpRequest $request, $curl, $response, $url) {
$httpHeaderSize = curl_getinfo($curl, CURLINFO_HEADER_SIZE);
$httpHeader = substr($response, 0, $httpHeaderSize);
$httpBody = substr($response, $httpHeaderSize);
$responseInfo = curl_getinfo($curl);
// debug... | php | private function handleResponse(ApiClient $apiClient, HttpRequest $request, $curl, $response, $url) {
$httpHeaderSize = curl_getinfo($curl, CURLINFO_HEADER_SIZE);
$httpHeader = substr($response, 0, $httpHeaderSize);
$httpBody = substr($response, $httpHeaderSize);
$responseInfo = curl_getinfo($curl);
// debug... | [
"private",
"function",
"handleResponse",
"(",
"ApiClient",
"$",
"apiClient",
",",
"HttpRequest",
"$",
"request",
",",
"$",
"curl",
",",
"$",
"response",
",",
"$",
"url",
")",
"{",
"$",
"httpHeaderSize",
"=",
"curl_getinfo",
"(",
"$",
"curl",
",",
"CURLINFO... | Puts together the HTTP response.
@param ApiClient $apiClient the API client instance
@param HttpRequest $request the HTTP request
@param resource $curl the cURL handler
@param mixed $response the response the of HTTP request
@param string $url the url of the HTTP request
@return HttpResponse | [
"Puts",
"together",
"the",
"HTTP",
"response",
"."
] | e1d18453855382af3144e845f2d9704efb93e9cb | https://github.com/wallee-payment/php-sdk/blob/e1d18453855382af3144e845f2d9704efb93e9cb/lib/Http/CurlHttpClient.php#L120-L143 |
221,897 | subugoe/typo3-find | Classes/ViewHelpers/Find/HighlightFieldViewHelper.php | HighlightFieldViewHelper.highlightField | protected static function highlightField($fieldContent, $arguments)
{
$highlightInfo = self::getHighlightInfo($arguments);
if (is_array($fieldContent)) {
$result = [];
foreach ($fieldContent as $singleField) {
$result[] = self::highlightSingleField($singleFie... | php | protected static function highlightField($fieldContent, $arguments)
{
$highlightInfo = self::getHighlightInfo($arguments);
if (is_array($fieldContent)) {
$result = [];
foreach ($fieldContent as $singleField) {
$result[] = self::highlightSingleField($singleFie... | [
"protected",
"static",
"function",
"highlightField",
"(",
"$",
"fieldContent",
",",
"$",
"arguments",
")",
"{",
"$",
"highlightInfo",
"=",
"self",
"::",
"getHighlightInfo",
"(",
"$",
"arguments",
")",
";",
"if",
"(",
"is_array",
"(",
"$",
"fieldContent",
")"... | Returns string or array of strings with highlighted areas enclosed
by \ueeee and \ueeef.
@param array|string $fieldContent content of the field to highlight
@param array $arguments
@return array|string | [
"Returns",
"string",
"or",
"array",
"of",
"strings",
"with",
"highlighted",
"areas",
"enclosed",
"by",
"\\",
"ueeee",
"and",
"\\",
"ueeef",
"."
] | d628a0b6a131d05f4842b08a556fe17cba9d7da0 | https://github.com/subugoe/typo3-find/blob/d628a0b6a131d05f4842b08a556fe17cba9d7da0/Classes/ViewHelpers/Find/HighlightFieldViewHelper.php#L104-L118 |
221,898 | subugoe/typo3-find | Classes/ViewHelpers/Find/HighlightFieldViewHelper.php | HighlightFieldViewHelper.getHighlightInfo | protected static function getHighlightInfo($arguments)
{
$highlightInfo = [];
$documentID = $arguments['document'][$arguments['idKey']];
if ($documentID) {
$highlighting = $arguments['results']->getHighlighting();
if ($highlighting) {
if ($arguments['... | php | protected static function getHighlightInfo($arguments)
{
$highlightInfo = [];
$documentID = $arguments['document'][$arguments['idKey']];
if ($documentID) {
$highlighting = $arguments['results']->getHighlighting();
if ($highlighting) {
if ($arguments['... | [
"protected",
"static",
"function",
"getHighlightInfo",
"(",
"$",
"arguments",
")",
"{",
"$",
"highlightInfo",
"=",
"[",
"]",
";",
"$",
"documentID",
"=",
"$",
"arguments",
"[",
"'document'",
"]",
"[",
"$",
"arguments",
"[",
"'idKey'",
"]",
"]",
";",
"if"... | Returns highlight information for the document and field configured in
our arguments.
@return array | [
"Returns",
"highlight",
"information",
"for",
"the",
"document",
"and",
"field",
"configured",
"in",
"our",
"arguments",
"."
] | d628a0b6a131d05f4842b08a556fe17cba9d7da0 | https://github.com/subugoe/typo3-find/blob/d628a0b6a131d05f4842b08a556fe17cba9d7da0/Classes/ViewHelpers/Find/HighlightFieldViewHelper.php#L126-L143 |
221,899 | ins0/google-measurement-php-client | src/Racecore/GATracking/Client/Adapter/Socket.php | Socket.createConnection | private function createConnection($endpoint)
{
// port
$port = $this->getOption('ssl') == true ? 443 : 80;
if (!($connection = socket_create(AF_INET, SOCK_STREAM, SOL_TCP))) {
$errorcode = socket_last_error();
$errormsg = socket_strerror($errorcode);
thro... | php | private function createConnection($endpoint)
{
// port
$port = $this->getOption('ssl') == true ? 443 : 80;
if (!($connection = socket_create(AF_INET, SOCK_STREAM, SOL_TCP))) {
$errorcode = socket_last_error();
$errormsg = socket_strerror($errorcode);
thro... | [
"private",
"function",
"createConnection",
"(",
"$",
"endpoint",
")",
"{",
"// port",
"$",
"port",
"=",
"$",
"this",
"->",
"getOption",
"(",
"'ssl'",
")",
"==",
"true",
"?",
"443",
":",
"80",
";",
"if",
"(",
"!",
"(",
"$",
"connection",
"=",
"socket_... | Create Connection to the Google Server
@param $endpoint
@throws Exception\EndpointServerException | [
"Create",
"Connection",
"to",
"the",
"Google",
"Server"
] | 415cabca0c6d83cd0bd6a8ed6fb695b35f892018 | https://github.com/ins0/google-measurement-php-client/blob/415cabca0c6d83cd0bd6a8ed6fb695b35f892018/src/Racecore/GATracking/Client/Adapter/Socket.php#L21-L45 |
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.