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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
235,200 | makinacorpus/drupal-ucms | ucms_seo/src/Path/AliasManager.php | AliasManager.computePathAlias | public function computePathAlias($nodeId, $siteId)
{
$nodeIdList = [];
$menuId = $this->treeProvider->findTreeForNode($nodeId, ['site_id' => $siteId]);
if ($menuId) {
// Load the tree, with no access checks, else some parents might
// be hidden from it and the result... | php | public function computePathAlias($nodeId, $siteId)
{
$nodeIdList = [];
$menuId = $this->treeProvider->findTreeForNode($nodeId, ['site_id' => $siteId]);
if ($menuId) {
// Load the tree, with no access checks, else some parents might
// be hidden from it and the result... | [
"public",
"function",
"computePathAlias",
"(",
"$",
"nodeId",
",",
"$",
"siteId",
")",
"{",
"$",
"nodeIdList",
"=",
"[",
"]",
";",
"$",
"menuId",
"=",
"$",
"this",
"->",
"treeProvider",
"->",
"findTreeForNode",
"(",
"$",
"nodeId",
",",
"[",
"'site_id'",
... | Compute alias for node on site
@todo this algorithm does up to 3 sql queries, one for finding the
correct menu tree, another for loading it, and the third to lookup
the segments, a better approach would be to merge this code in umenu
itself, buy adding the 'segment' column in the menu, with a unique
constraint on (par... | [
"Compute",
"alias",
"for",
"node",
"on",
"site"
] | 6b8a84305472d2cad816102672f10274b3bbb535 | https://github.com/makinacorpus/drupal-ucms/blob/6b8a84305472d2cad816102672f10274b3bbb535/ucms_seo/src/Path/AliasManager.php#L62-L109 |
235,201 | makinacorpus/drupal-ucms | ucms_seo/src/Path/AliasManager.php | AliasManager.deduplicate | private function deduplicate($nodeId, $siteId, $alias)
{
$dupFound = false;
$current = $alias;
$increment = 0;
do {
$dupFound = (bool)$this
->database
->query(
"SELECT 1 FROM {ucms_seo_route} WHERE route = :route ... | php | private function deduplicate($nodeId, $siteId, $alias)
{
$dupFound = false;
$current = $alias;
$increment = 0;
do {
$dupFound = (bool)$this
->database
->query(
"SELECT 1 FROM {ucms_seo_route} WHERE route = :route ... | [
"private",
"function",
"deduplicate",
"(",
"$",
"nodeId",
",",
"$",
"siteId",
",",
"$",
"alias",
")",
"{",
"$",
"dupFound",
"=",
"false",
";",
"$",
"current",
"=",
"$",
"alias",
";",
"$",
"increment",
"=",
"0",
";",
"do",
"{",
"$",
"dupFound",
"=",... | Deduplicate alias if one or more already exsist
@param int $nodeId
@param int $siteId
@param string $alias
@return string | [
"Deduplicate",
"alias",
"if",
"one",
"or",
"more",
"already",
"exsist"
] | 6b8a84305472d2cad816102672f10274b3bbb535 | https://github.com/makinacorpus/drupal-ucms/blob/6b8a84305472d2cad816102672f10274b3bbb535/ucms_seo/src/Path/AliasManager.php#L120-L143 |
235,202 | makinacorpus/drupal-ucms | ucms_seo/src/Path/AliasManager.php | AliasManager.computeAndStorePathAlias | private function computeAndStorePathAlias($nodeId, $siteId, $outdated = null)
{
$transaction = null;
try {
$transaction = $this->database->startTransaction();
$computed = $this->computePathAlias($nodeId, $siteId);
// In all cases, delete outdated item if exists ... | php | private function computeAndStorePathAlias($nodeId, $siteId, $outdated = null)
{
$transaction = null;
try {
$transaction = $this->database->startTransaction();
$computed = $this->computePathAlias($nodeId, $siteId);
// In all cases, delete outdated item if exists ... | [
"private",
"function",
"computeAndStorePathAlias",
"(",
"$",
"nodeId",
",",
"$",
"siteId",
",",
"$",
"outdated",
"=",
"null",
")",
"{",
"$",
"transaction",
"=",
"null",
";",
"try",
"{",
"$",
"transaction",
"=",
"$",
"this",
"->",
"database",
"->",
"start... | Store given node alias in given site
@param int $nodeId
@param int $siteId
@param string $outdated
Outdated route if exists
@return string | [
"Store",
"given",
"node",
"alias",
"in",
"given",
"site"
] | 6b8a84305472d2cad816102672f10274b3bbb535 | https://github.com/makinacorpus/drupal-ucms/blob/6b8a84305472d2cad816102672f10274b3bbb535/ucms_seo/src/Path/AliasManager.php#L155-L227 |
235,203 | makinacorpus/drupal-ucms | ucms_seo/src/Path/AliasManager.php | AliasManager.invalidate | public function invalidate(array $conditions)
{
if (empty($conditions)) {
throw new \InvalidArgumentException("cannot invalidate aliases with no conditions");
}
$query = $this
->database
->update('ucms_seo_route')
->fields(['is_outdated' => 1]... | php | public function invalidate(array $conditions)
{
if (empty($conditions)) {
throw new \InvalidArgumentException("cannot invalidate aliases with no conditions");
}
$query = $this
->database
->update('ucms_seo_route')
->fields(['is_outdated' => 1]... | [
"public",
"function",
"invalidate",
"(",
"array",
"$",
"conditions",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"conditions",
")",
")",
"{",
"throw",
"new",
"\\",
"InvalidArgumentException",
"(",
"\"cannot invalidate aliases with no conditions\"",
")",
";",
"}",
"$... | Invalidate aliases with the given conditions
@param array $conditions
Keys are column names, values are either single value or an array of
value to match to invalidate; allowed keys are:
- node_id: one or more node identifiers
- site_id: one or more site identifiers | [
"Invalidate",
"aliases",
"with",
"the",
"given",
"conditions"
] | 6b8a84305472d2cad816102672f10274b3bbb535 | https://github.com/makinacorpus/drupal-ucms/blob/6b8a84305472d2cad816102672f10274b3bbb535/ucms_seo/src/Path/AliasManager.php#L238-L268 |
235,204 | makinacorpus/drupal-ucms | ucms_seo/src/Path/AliasManager.php | AliasManager.invalidateRelated | public function invalidateRelated($nodeIdList)
{
if (!$nodeIdList) {
return;
}
$this
->database
->query("
UPDATE {ucms_seo_route}
SET
is_outdated = 1
WHERE
is_outdated... | php | public function invalidateRelated($nodeIdList)
{
if (!$nodeIdList) {
return;
}
$this
->database
->query("
UPDATE {ucms_seo_route}
SET
is_outdated = 1
WHERE
is_outdated... | [
"public",
"function",
"invalidateRelated",
"(",
"$",
"nodeIdList",
")",
"{",
"if",
"(",
"!",
"$",
"nodeIdList",
")",
"{",
"return",
";",
"}",
"$",
"this",
"->",
"database",
"->",
"query",
"(",
"\"\n UPDATE {ucms_seo_route}\n SET\n ... | Invalidate aliases related with the given node
@todo this will a few SQL indices
@param int[] $nodeIdList | [
"Invalidate",
"aliases",
"related",
"with",
"the",
"given",
"node"
] | 6b8a84305472d2cad816102672f10274b3bbb535 | https://github.com/makinacorpus/drupal-ucms/blob/6b8a84305472d2cad816102672f10274b3bbb535/ucms_seo/src/Path/AliasManager.php#L277-L326 |
235,205 | makinacorpus/drupal-ucms | ucms_seo/src/Path/AliasManager.php | AliasManager.setCustomAlias | public function setCustomAlias($nodeId, $siteId, $alias)
{
$this
->database
->merge('ucms_seo_route')
->key([
'node_id' => $nodeId,
'site_id' => $siteId,
])
->fields([
'route' => $alias,
... | php | public function setCustomAlias($nodeId, $siteId, $alias)
{
$this
->database
->merge('ucms_seo_route')
->key([
'node_id' => $nodeId,
'site_id' => $siteId,
])
->fields([
'route' => $alias,
... | [
"public",
"function",
"setCustomAlias",
"(",
"$",
"nodeId",
",",
"$",
"siteId",
",",
"$",
"alias",
")",
"{",
"$",
"this",
"->",
"database",
"->",
"merge",
"(",
"'ucms_seo_route'",
")",
"->",
"key",
"(",
"[",
"'node_id'",
"=>",
"$",
"nodeId",
",",
"'sit... | Set custom alias for
@param int $nodeId
@param int $siteId
@param string $siteId | [
"Set",
"custom",
"alias",
"for"
] | 6b8a84305472d2cad816102672f10274b3bbb535 | https://github.com/makinacorpus/drupal-ucms/blob/6b8a84305472d2cad816102672f10274b3bbb535/ucms_seo/src/Path/AliasManager.php#L335-L351 |
235,206 | makinacorpus/drupal-ucms | ucms_seo/src/Path/AliasManager.php | AliasManager.removeCustomAlias | public function removeCustomAlias($nodeId, $siteId)
{
$this
->database
->update('ucms_seo_route')
->condition('node_id', $nodeId)
->condition('site_id', $siteId)
->fields(['is_protected' => 0, 'is_outdated' => 1])
->execute()
;
... | php | public function removeCustomAlias($nodeId, $siteId)
{
$this
->database
->update('ucms_seo_route')
->condition('node_id', $nodeId)
->condition('site_id', $siteId)
->fields(['is_protected' => 0, 'is_outdated' => 1])
->execute()
;
... | [
"public",
"function",
"removeCustomAlias",
"(",
"$",
"nodeId",
",",
"$",
"siteId",
")",
"{",
"$",
"this",
"->",
"database",
"->",
"update",
"(",
"'ucms_seo_route'",
")",
"->",
"condition",
"(",
"'node_id'",
",",
"$",
"nodeId",
")",
"->",
"condition",
"(",
... | Remove custom alias for
@param int $nodeId
@param int $siteId | [
"Remove",
"custom",
"alias",
"for"
] | 6b8a84305472d2cad816102672f10274b3bbb535 | https://github.com/makinacorpus/drupal-ucms/blob/6b8a84305472d2cad816102672f10274b3bbb535/ucms_seo/src/Path/AliasManager.php#L359-L369 |
235,207 | makinacorpus/drupal-ucms | ucms_seo/src/Path/AliasManager.php | AliasManager.getPathAlias | public function getPathAlias($nodeId, $siteId)
{
$route = $this
->database
->query(
"SELECT route, is_outdated FROM {ucms_seo_route} WHERE node_id = :node AND site_id = :site",
[':node' => $nodeId, ':site' => $siteId]
)
->fetch(... | php | public function getPathAlias($nodeId, $siteId)
{
$route = $this
->database
->query(
"SELECT route, is_outdated FROM {ucms_seo_route} WHERE node_id = :node AND site_id = :site",
[':node' => $nodeId, ':site' => $siteId]
)
->fetch(... | [
"public",
"function",
"getPathAlias",
"(",
"$",
"nodeId",
",",
"$",
"siteId",
")",
"{",
"$",
"route",
"=",
"$",
"this",
"->",
"database",
"->",
"query",
"(",
"\"SELECT route, is_outdated FROM {ucms_seo_route} WHERE node_id = :node AND site_id = :site\"",
",",
"[",
"':... | Get alias for node on site
Internally, if no alias was already computed, this will recompute
and store it into a custom route match table.
@param int $nodeId
@param int $siteId
@return string | [
"Get",
"alias",
"for",
"node",
"on",
"site"
] | 6b8a84305472d2cad816102672f10274b3bbb535 | https://github.com/makinacorpus/drupal-ucms/blob/6b8a84305472d2cad816102672f10274b3bbb535/ucms_seo/src/Path/AliasManager.php#L402-L418 |
235,208 | makinacorpus/drupal-ucms | ucms_seo/src/Path/AliasManager.php | AliasManager.matchPath | public function matchPath($alias, $siteId)
{
$nodeId = $this
->database
->query(
"SELECT node_id FROM {ucms_seo_route} WHERE route = :route AND site_id = :site",
[':route' => $alias, ':site' => $siteId]
)
->fetchField()
... | php | public function matchPath($alias, $siteId)
{
$nodeId = $this
->database
->query(
"SELECT node_id FROM {ucms_seo_route} WHERE route = :route AND site_id = :site",
[':route' => $alias, ':site' => $siteId]
)
->fetchField()
... | [
"public",
"function",
"matchPath",
"(",
"$",
"alias",
",",
"$",
"siteId",
")",
"{",
"$",
"nodeId",
"=",
"$",
"this",
"->",
"database",
"->",
"query",
"(",
"\"SELECT node_id FROM {ucms_seo_route} WHERE route = :route AND site_id = :site\"",
",",
"[",
"':route'",
"=>"... | Match path on given site
@todo this one will be *very* hard to compute without umenu taking
care of it for us;
@param string $alias
@param int $siteId
@return null|int
The node identifier if found | [
"Match",
"path",
"on",
"given",
"site"
] | 6b8a84305472d2cad816102672f10274b3bbb535 | https://github.com/makinacorpus/drupal-ucms/blob/6b8a84305472d2cad816102672f10274b3bbb535/ucms_seo/src/Path/AliasManager.php#L432-L444 |
235,209 | makinacorpus/drupal-ucms | ucms_site/src/Controller/AutocompleteController.php | AutocompleteController.userAutocompleteAction | public function userAutocompleteAction($string)
{
$manager = $this->getSiteManager();
$account = $this->getCurrentUser();
if (!$manager->getAccess()->userIsWebmaster($account) && !$this->isGranted(Access::PERM_USER_MANAGE_ALL)) {
throw $this->createAccessDeniedException();
... | php | public function userAutocompleteAction($string)
{
$manager = $this->getSiteManager();
$account = $this->getCurrentUser();
if (!$manager->getAccess()->userIsWebmaster($account) && !$this->isGranted(Access::PERM_USER_MANAGE_ALL)) {
throw $this->createAccessDeniedException();
... | [
"public",
"function",
"userAutocompleteAction",
"(",
"$",
"string",
")",
"{",
"$",
"manager",
"=",
"$",
"this",
"->",
"getSiteManager",
"(",
")",
";",
"$",
"account",
"=",
"$",
"this",
"->",
"getCurrentUser",
"(",
")",
";",
"if",
"(",
"!",
"$",
"manage... | User autocomplete callback | [
"User",
"autocomplete",
"callback"
] | 6b8a84305472d2cad816102672f10274b3bbb535 | https://github.com/makinacorpus/drupal-ucms/blob/6b8a84305472d2cad816102672f10274b3bbb535/ucms_site/src/Controller/AutocompleteController.php#L45-L73 |
235,210 | makinacorpus/drupal-ucms | ucms_composition/src/Command/MigrateFromLayoutCommand.php | MigrateFromLayoutCommand.parseSquash | private function parseSquash(string $string) : array
{
// As always, regexes to the rescue
$matches = [];
// @todo find out why using /^...$/ does not work capturing all groups
if (!preg_match_all('/((\(\w+(?:\s+\w+)+\)\s*)+?)/ui', trim($string), $matches)) {
throw new \I... | php | private function parseSquash(string $string) : array
{
// As always, regexes to the rescue
$matches = [];
// @todo find out why using /^...$/ does not work capturing all groups
if (!preg_match_all('/((\(\w+(?:\s+\w+)+\)\s*)+?)/ui', trim($string), $matches)) {
throw new \I... | [
"private",
"function",
"parseSquash",
"(",
"string",
"$",
"string",
")",
":",
"array",
"{",
"// As always, regexes to the rescue",
"$",
"matches",
"=",
"[",
"]",
";",
"// @todo find out why using /^...$/ does not work capturing all groups",
"if",
"(",
"!",
"preg_match_all... | Parse the squash option
@param string $string
@return null|string[][] | [
"Parse",
"the",
"squash",
"option"
] | 6b8a84305472d2cad816102672f10274b3bbb535 | https://github.com/makinacorpus/drupal-ucms/blob/6b8a84305472d2cad816102672f10274b3bbb535/ucms_composition/src/Command/MigrateFromLayoutCommand.php#L62-L78 |
235,211 | despark/ignicms | src/Console/Commands/File/ClearTemp.php | ClearTemp.handle | public function handle()
{
$deleteBefore = Carbon::now()->subWeek();
$filesToDelete = $this->tempModel->where('created_at', '<=', $deleteBefore)->get();
$failed = [];
foreach ($filesToDelete as $file) {
// delete the file
if (! \File::delete($file->getTempPat... | php | public function handle()
{
$deleteBefore = Carbon::now()->subWeek();
$filesToDelete = $this->tempModel->where('created_at', '<=', $deleteBefore)->get();
$failed = [];
foreach ($filesToDelete as $file) {
// delete the file
if (! \File::delete($file->getTempPat... | [
"public",
"function",
"handle",
"(",
")",
"{",
"$",
"deleteBefore",
"=",
"Carbon",
"::",
"now",
"(",
")",
"->",
"subWeek",
"(",
")",
";",
"$",
"filesToDelete",
"=",
"$",
"this",
"->",
"tempModel",
"->",
"where",
"(",
"'created_at'",
",",
"'<='",
",",
... | Run command. | [
"Run",
"command",
"."
] | d55775a4656a7e99017d2ef3f8160599d600d2a7 | https://github.com/despark/ignicms/blob/d55775a4656a7e99017d2ef3f8160599d600d2a7/src/Console/Commands/File/ClearTemp.php#L47-L65 |
235,212 | despark/ignicms | public/admin_assets/plugins/tinymce/plugins/jbimages/ci/system/core/Config.php | CI_Config.load | function load($file = '', $use_sections = FALSE, $fail_gracefully = FALSE)
{
$file = ($file == '') ? 'config' : str_replace('.php', '', $file);
$found = FALSE;
$loaded = FALSE;
$check_locations = defined('ENVIRONMENT')
? array(ENVIRONMENT.'/'.$file, $file)
: array($file);
foreach ($this->_config_path... | php | function load($file = '', $use_sections = FALSE, $fail_gracefully = FALSE)
{
$file = ($file == '') ? 'config' : str_replace('.php', '', $file);
$found = FALSE;
$loaded = FALSE;
$check_locations = defined('ENVIRONMENT')
? array(ENVIRONMENT.'/'.$file, $file)
: array($file);
foreach ($this->_config_path... | [
"function",
"load",
"(",
"$",
"file",
"=",
"''",
",",
"$",
"use_sections",
"=",
"FALSE",
",",
"$",
"fail_gracefully",
"=",
"FALSE",
")",
"{",
"$",
"file",
"=",
"(",
"$",
"file",
"==",
"''",
")",
"?",
"'config'",
":",
"str_replace",
"(",
"'.php'",
"... | Load Config File
@access public
@param string the config file name
@param boolean if configuration values should be loaded into their own section
@param boolean true if errors should just return false, false if an error message should be displayed
@return boolean if the file was loaded correctly | [
"Load",
"Config",
"File"
] | d55775a4656a7e99017d2ef3f8160599d600d2a7 | https://github.com/despark/ignicms/blob/d55775a4656a7e99017d2ef3f8160599d600d2a7/public/admin_assets/plugins/tinymce/plugins/jbimages/ci/system/core/Config.php#L96-L175 |
235,213 | despark/ignicms | public/admin_assets/plugins/tinymce/plugins/jbimages/ci/system/core/Config.php | CI_Config.item | function item($item, $index = '')
{
if ($index == '')
{
if ( ! isset($this->config[$item]))
{
return FALSE;
}
$pref = $this->config[$item];
}
else
{
if ( ! isset($this->config[$index]))
{
return FALSE;
}
if ( ! isset($this->config[$index][$item]))
{
return FALSE;
}... | php | function item($item, $index = '')
{
if ($index == '')
{
if ( ! isset($this->config[$item]))
{
return FALSE;
}
$pref = $this->config[$item];
}
else
{
if ( ! isset($this->config[$index]))
{
return FALSE;
}
if ( ! isset($this->config[$index][$item]))
{
return FALSE;
}... | [
"function",
"item",
"(",
"$",
"item",
",",
"$",
"index",
"=",
"''",
")",
"{",
"if",
"(",
"$",
"index",
"==",
"''",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"config",
"[",
"$",
"item",
"]",
")",
")",
"{",
"return",
"FALSE",
... | Fetch a config file item
@access public
@param string the config item name
@param string the index name
@param bool
@return string | [
"Fetch",
"a",
"config",
"file",
"item"
] | d55775a4656a7e99017d2ef3f8160599d600d2a7 | https://github.com/despark/ignicms/blob/d55775a4656a7e99017d2ef3f8160599d600d2a7/public/admin_assets/plugins/tinymce/plugins/jbimages/ci/system/core/Config.php#L189-L216 |
235,214 | loyals-online/silverstripe-tinymce4 | code/forms/CustomHtmlEditorConfig.php | CustomHtmlEditorConfig.get | public static function get($identifier = 'default') {
if (!array_key_exists($identifier, self::$configs)) self::$configs[$identifier] = new CustomHtmlEditorConfig();
return self::$configs[$identifier];
} | php | public static function get($identifier = 'default') {
if (!array_key_exists($identifier, self::$configs)) self::$configs[$identifier] = new CustomHtmlEditorConfig();
return self::$configs[$identifier];
} | [
"public",
"static",
"function",
"get",
"(",
"$",
"identifier",
"=",
"'default'",
")",
"{",
"if",
"(",
"!",
"array_key_exists",
"(",
"$",
"identifier",
",",
"self",
"::",
"$",
"configs",
")",
")",
"self",
"::",
"$",
"configs",
"[",
"$",
"identifier",
"]... | Get the HtmlEditorConfig object for the given identifier. This is a correct way to get an HtmlEditorConfig
instance - do not call 'new'
@param $identifier string - the identifier for the config set
@return HtmlEditorConfig - the configuration object. This will be created if it does not yet exist for that
identifier | [
"Get",
"the",
"HtmlEditorConfig",
"object",
"for",
"the",
"given",
"identifier",
".",
"This",
"is",
"a",
"correct",
"way",
"to",
"get",
"an",
"HtmlEditorConfig",
"instance",
"-",
"do",
"not",
"call",
"new"
] | c0603d074ebbb6b8a429f2d2856778e3643bba34 | https://github.com/loyals-online/silverstripe-tinymce4/blob/c0603d074ebbb6b8a429f2d2856778e3643bba34/code/forms/CustomHtmlEditorConfig.php#L28-L31 |
235,215 | artkonekt/gears | src/Backend/BackendFactory.php | BackendFactory.create | public static function create(string $driver) : Backend
{
if (strpos($driver, '\\') === false) {
$class = __NAMESPACE__ . '\\Drivers\\' . studly_case($driver);
} else {
$class = $driver;
}
if (!class_exists($class)) {
throw new \InvalidArgumentExc... | php | public static function create(string $driver) : Backend
{
if (strpos($driver, '\\') === false) {
$class = __NAMESPACE__ . '\\Drivers\\' . studly_case($driver);
} else {
$class = $driver;
}
if (!class_exists($class)) {
throw new \InvalidArgumentExc... | [
"public",
"static",
"function",
"create",
"(",
"string",
"$",
"driver",
")",
":",
"Backend",
"{",
"if",
"(",
"strpos",
"(",
"$",
"driver",
",",
"'\\\\'",
")",
"===",
"false",
")",
"{",
"$",
"class",
"=",
"__NAMESPACE__",
".",
"'\\\\Drivers\\\\'",
".",
... | Creates a new backend instance based on the passed driver
@param string $driver Can be a short name for built in drivers eg. 'database' or a FQCN
@return Backend | [
"Creates",
"a",
"new",
"backend",
"instance",
"based",
"on",
"the",
"passed",
"driver"
] | 6c006a3e8e334d8100aab768a2a5e807bcac5695 | https://github.com/artkonekt/gears/blob/6c006a3e8e334d8100aab768a2a5e807bcac5695/src/Backend/BackendFactory.php#L25-L43 |
235,216 | makinacorpus/drupal-ucms | ucms_site/src/NodeManager.php | NodeManager.createReference | public function createReference(Site $site, NodeInterface $node)
{
$nodeId = $node->id();
$siteId = $site->getId();
$this
->db
->merge('ucms_site_node')
->key(['nid' => $nodeId, 'site_id' => $siteId])
->execute()
;
if (!in_arr... | php | public function createReference(Site $site, NodeInterface $node)
{
$nodeId = $node->id();
$siteId = $site->getId();
$this
->db
->merge('ucms_site_node')
->key(['nid' => $nodeId, 'site_id' => $siteId])
->execute()
;
if (!in_arr... | [
"public",
"function",
"createReference",
"(",
"Site",
"$",
"site",
",",
"NodeInterface",
"$",
"node",
")",
"{",
"$",
"nodeId",
"=",
"$",
"node",
"->",
"id",
"(",
")",
";",
"$",
"siteId",
"=",
"$",
"site",
"->",
"getId",
"(",
")",
";",
"$",
"this",
... | Reference node into a site
@param Site $site
@param NodeInterface $node | [
"Reference",
"node",
"into",
"a",
"site"
] | 6b8a84305472d2cad816102672f10274b3bbb535 | https://github.com/makinacorpus/drupal-ucms/blob/6b8a84305472d2cad816102672f10274b3bbb535/ucms_site/src/NodeManager.php#L91-L109 |
235,217 | makinacorpus/drupal-ucms | ucms_site/src/NodeManager.php | NodeManager.createReferenceBulkForNode | public function createReferenceBulkForNode($nodeId, $siteIdList)
{
// @todo Optimize me
foreach ($siteIdList as $siteId) {
$this
->db
->merge('ucms_site_node')
->key(['nid' => $nodeId, 'site_id' => $siteId])
->execute()
... | php | public function createReferenceBulkForNode($nodeId, $siteIdList)
{
// @todo Optimize me
foreach ($siteIdList as $siteId) {
$this
->db
->merge('ucms_site_node')
->key(['nid' => $nodeId, 'site_id' => $siteId])
->execute()
... | [
"public",
"function",
"createReferenceBulkForNode",
"(",
"$",
"nodeId",
",",
"$",
"siteIdList",
")",
"{",
"// @todo Optimize me",
"foreach",
"(",
"$",
"siteIdList",
"as",
"$",
"siteId",
")",
"{",
"$",
"this",
"->",
"db",
"->",
"merge",
"(",
"'ucms_site_node'",... | Reference a single within multiple sites
@param int $nodeId
@param int[] $siteIdList | [
"Reference",
"a",
"single",
"within",
"multiple",
"sites"
] | 6b8a84305472d2cad816102672f10274b3bbb535 | https://github.com/makinacorpus/drupal-ucms/blob/6b8a84305472d2cad816102672f10274b3bbb535/ucms_site/src/NodeManager.php#L117-L137 |
235,218 | makinacorpus/drupal-ucms | ucms_site/src/NodeManager.php | NodeManager.createReferenceBulkInSite | public function createReferenceBulkInSite($siteId, $nodeIdList)
{
// @todo Optimize me
foreach ($nodeIdList as $nodeId) {
$this
->db
->merge('ucms_site_node')
->key(['nid' => $nodeId, 'site_id' => $siteId])
->execute()
... | php | public function createReferenceBulkInSite($siteId, $nodeIdList)
{
// @todo Optimize me
foreach ($nodeIdList as $nodeId) {
$this
->db
->merge('ucms_site_node')
->key(['nid' => $nodeId, 'site_id' => $siteId])
->execute()
... | [
"public",
"function",
"createReferenceBulkInSite",
"(",
"$",
"siteId",
",",
"$",
"nodeIdList",
")",
"{",
"// @todo Optimize me",
"foreach",
"(",
"$",
"nodeIdList",
"as",
"$",
"nodeId",
")",
"{",
"$",
"this",
"->",
"db",
"->",
"merge",
"(",
"'ucms_site_node'",
... | Reference multiple nodes within a single site
@param int $siteId
@param int[] $nodeIdList | [
"Reference",
"multiple",
"nodes",
"within",
"a",
"single",
"site"
] | 6b8a84305472d2cad816102672f10274b3bbb535 | https://github.com/makinacorpus/drupal-ucms/blob/6b8a84305472d2cad816102672f10274b3bbb535/ucms_site/src/NodeManager.php#L145-L165 |
235,219 | makinacorpus/drupal-ucms | ucms_site/src/NodeManager.php | NodeManager.createUnsavedClone | public function createUnsavedClone(NodeInterface $original, array $updates = [])
{
// This method, instead of the clone operator, will actually drop all
// existing references and pointers and give you raw values.
// All credits to https://stackoverflow.com/a/10831885/5826569
$node =... | php | public function createUnsavedClone(NodeInterface $original, array $updates = [])
{
// This method, instead of the clone operator, will actually drop all
// existing references and pointers and give you raw values.
// All credits to https://stackoverflow.com/a/10831885/5826569
$node =... | [
"public",
"function",
"createUnsavedClone",
"(",
"NodeInterface",
"$",
"original",
",",
"array",
"$",
"updates",
"=",
"[",
"]",
")",
"{",
"// This method, instead of the clone operator, will actually drop all",
"// existing references and pointers and give you raw values.",
"// A... | Create unsaved node clone
@param NodeInterface $original
Original node to clone
@param array $updates
Any fields that will replace properties on the new node object, set
the 'uid' property as user identifier
@return NodeInterface
Unsaved clone | [
"Create",
"unsaved",
"node",
"clone"
] | 6b8a84305472d2cad816102672f10274b3bbb535 | https://github.com/makinacorpus/drupal-ucms/blob/6b8a84305472d2cad816102672f10274b3bbb535/ucms_site/src/NodeManager.php#L179-L222 |
235,220 | makinacorpus/drupal-ucms | ucms_site/src/NodeManager.php | NodeManager.createAndSaveClone | public function createAndSaveClone(NodeInterface $original, array $updates = [])
{
$clone = $this->createUnsavedClone($original, $updates);
$this->entityManager->getStorage('node')->save($clone);
return $clone;
} | php | public function createAndSaveClone(NodeInterface $original, array $updates = [])
{
$clone = $this->createUnsavedClone($original, $updates);
$this->entityManager->getStorage('node')->save($clone);
return $clone;
} | [
"public",
"function",
"createAndSaveClone",
"(",
"NodeInterface",
"$",
"original",
",",
"array",
"$",
"updates",
"=",
"[",
"]",
")",
"{",
"$",
"clone",
"=",
"$",
"this",
"->",
"createUnsavedClone",
"(",
"$",
"original",
",",
"$",
"updates",
")",
";",
"$"... | Clone the given node
@param NodeInterface $original
Original node to clone
@param array $updates
Any fields that will replace properties on the new node object, set
the 'uid' property as user identifier
@return NodeInterface
New duplicated node, it has already been saved, to update values use
the $updates parameter | [
"Clone",
"the",
"given",
"node"
] | 6b8a84305472d2cad816102672f10274b3bbb535 | https://github.com/makinacorpus/drupal-ucms/blob/6b8a84305472d2cad816102672f10274b3bbb535/ucms_site/src/NodeManager.php#L237-L243 |
235,221 | makinacorpus/drupal-ucms | ucms_site/src/NodeManager.php | NodeManager.deleteReferenceBulkFromSite | public function deleteReferenceBulkFromSite($siteId, $nodeIdList)
{
if (!$nodeIdList) {
return;
}
$this
->db
->delete('ucms_site_node')
->condition('nid', $nodeIdList)
->condition('site_id', $siteId)
->execute()
... | php | public function deleteReferenceBulkFromSite($siteId, $nodeIdList)
{
if (!$nodeIdList) {
return;
}
$this
->db
->delete('ucms_site_node')
->condition('nid', $nodeIdList)
->condition('site_id', $siteId)
->execute()
... | [
"public",
"function",
"deleteReferenceBulkFromSite",
"(",
"$",
"siteId",
",",
"$",
"nodeIdList",
")",
"{",
"if",
"(",
"!",
"$",
"nodeIdList",
")",
"{",
"return",
";",
"}",
"$",
"this",
"->",
"db",
"->",
"delete",
"(",
"'ucms_site_node'",
")",
"->",
"cond... | Unreference node for a site
@param int $siteId
@param int[] $nodeIdList | [
"Unreference",
"node",
"for",
"a",
"site"
] | 6b8a84305472d2cad816102672f10274b3bbb535 | https://github.com/makinacorpus/drupal-ucms/blob/6b8a84305472d2cad816102672f10274b3bbb535/ucms_site/src/NodeManager.php#L251-L273 |
235,222 | makinacorpus/drupal-ucms | ucms_site/src/NodeManager.php | NodeManager.findSiteCandidatesForReference | public function findSiteCandidatesForReference(NodeInterface $node, $userId)
{
$ne = $this
->db
->select('ucms_site_node', 'sn')
->where("sn.site_id = sa.site_id")
->condition('sn.nid', $node->id())
;
$ne->addExpression('1');
$idList =... | php | public function findSiteCandidatesForReference(NodeInterface $node, $userId)
{
$ne = $this
->db
->select('ucms_site_node', 'sn')
->where("sn.site_id = sa.site_id")
->condition('sn.nid', $node->id())
;
$ne->addExpression('1');
$idList =... | [
"public",
"function",
"findSiteCandidatesForReference",
"(",
"NodeInterface",
"$",
"node",
",",
"$",
"userId",
")",
"{",
"$",
"ne",
"=",
"$",
"this",
"->",
"db",
"->",
"select",
"(",
"'ucms_site_node'",
",",
"'sn'",
")",
"->",
"where",
"(",
"\"sn.site_id = s... | Find candidate sites for referencing this node
@param NodeInterface $node
@param int $userId
@return Site[] | [
"Find",
"candidate",
"sites",
"for",
"referencing",
"this",
"node"
] | 6b8a84305472d2cad816102672f10274b3bbb535 | https://github.com/makinacorpus/drupal-ucms/blob/6b8a84305472d2cad816102672f10274b3bbb535/ucms_site/src/NodeManager.php#L283-L305 |
235,223 | makinacorpus/drupal-ucms | ucms_site/src/NodeManager.php | NodeManager.findSiteCandidatesForCloning | public function findSiteCandidatesForCloning(NodeInterface $node, $userId)
{
/*
* The right and only working query for this.
*
SELECT DISTINCT(sa.site_id)
FROM ucms_site_access sa
JOIN ucms_site_node sn ON sn.site_id = sa.site_id
WHERE
... | php | public function findSiteCandidatesForCloning(NodeInterface $node, $userId)
{
/*
* The right and only working query for this.
*
SELECT DISTINCT(sa.site_id)
FROM ucms_site_access sa
JOIN ucms_site_node sn ON sn.site_id = sa.site_id
WHERE
... | [
"public",
"function",
"findSiteCandidatesForCloning",
"(",
"NodeInterface",
"$",
"node",
",",
"$",
"userId",
")",
"{",
"/*\n * The right and only working query for this.\n *\n SELECT DISTINCT(sa.site_id)\n FROM ucms_site_access sa\n JOIN ucms_... | Find candidate sites for cloning this node
@param NodeInterface $node
@param int $userId
@return Site[] | [
"Find",
"candidate",
"sites",
"for",
"cloning",
"this",
"node"
] | 6b8a84305472d2cad816102672f10274b3bbb535 | https://github.com/makinacorpus/drupal-ucms/blob/6b8a84305472d2cad816102672f10274b3bbb535/ucms_site/src/NodeManager.php#L315-L374 |
235,224 | makinacorpus/drupal-ucms | ucms_site/src/NodeManager.php | NodeManager.getCloningMapping | public function getCloningMapping(Site $site)
{
if (isset($this->cloningMapping[$site->getId()])) {
return $this->cloningMapping[$site->getId()];
}
$q = $this->db
->select('node', 'n')
->fields('n', ['parent_nid', 'nid'])
->isNotNull('parent_n... | php | public function getCloningMapping(Site $site)
{
if (isset($this->cloningMapping[$site->getId()])) {
return $this->cloningMapping[$site->getId()];
}
$q = $this->db
->select('node', 'n')
->fields('n', ['parent_nid', 'nid'])
->isNotNull('parent_n... | [
"public",
"function",
"getCloningMapping",
"(",
"Site",
"$",
"site",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"cloningMapping",
"[",
"$",
"site",
"->",
"getId",
"(",
")",
"]",
")",
")",
"{",
"return",
"$",
"this",
"->",
"cloningMapping",
... | Provides a mapping array of parent identifiers to clone identifiers.
If there is several clones for a same parent,
the first created will be passed.
@param Site $site
@return integer[] | [
"Provides",
"a",
"mapping",
"array",
"of",
"parent",
"identifiers",
"to",
"clone",
"identifiers",
"."
] | 6b8a84305472d2cad816102672f10274b3bbb535 | https://github.com/makinacorpus/drupal-ucms/blob/6b8a84305472d2cad816102672f10274b3bbb535/ucms_site/src/NodeManager.php#L386-L413 |
235,225 | tck/zf-imageresizer | src/TckImageResizer/Service/ImageProcessing.php | ImageProcessing.process | public function process($source, $target, $commands)
{
$targetFolder = pathinfo($target, PATHINFO_DIRNAME);
if (!file_exists($targetFolder)) {
mkdir($targetFolder, 0777, true);
}
$this->image = $this->getImagineService()->open($source);
foreach ($this->analyseComm... | php | public function process($source, $target, $commands)
{
$targetFolder = pathinfo($target, PATHINFO_DIRNAME);
if (!file_exists($targetFolder)) {
mkdir($targetFolder, 0777, true);
}
$this->image = $this->getImagineService()->open($source);
foreach ($this->analyseComm... | [
"public",
"function",
"process",
"(",
"$",
"source",
",",
"$",
"target",
",",
"$",
"commands",
")",
"{",
"$",
"targetFolder",
"=",
"pathinfo",
"(",
"$",
"target",
",",
"PATHINFO_DIRNAME",
")",
";",
"if",
"(",
"!",
"file_exists",
"(",
"$",
"targetFolder",... | Process command to image source and save to target
@param string $source
@param string $target
@param string $commands
@return void | [
"Process",
"command",
"to",
"image",
"source",
"and",
"save",
"to",
"target"
] | 7461f588bbf12cbf9544a68778541d052b68fd07 | https://github.com/tck/zf-imageresizer/blob/7461f588bbf12cbf9544a68778541d052b68fd07/src/TckImageResizer/Service/ImageProcessing.php#L82-L97 |
235,226 | tck/zf-imageresizer | src/TckImageResizer/Service/ImageProcessing.php | ImageProcessing.process404 | public function process404($target, $commands)
{
if (file_exists($target)) {
return;
}
$targetFolder = pathinfo($target, PATHINFO_DIRNAME);
if (!file_exists($targetFolder)) {
mkdir($targetFolder, 0777, true);
}
$text = 'Not fo... | php | public function process404($target, $commands)
{
if (file_exists($target)) {
return;
}
$targetFolder = pathinfo($target, PATHINFO_DIRNAME);
if (!file_exists($targetFolder)) {
mkdir($targetFolder, 0777, true);
}
$text = 'Not fo... | [
"public",
"function",
"process404",
"(",
"$",
"target",
",",
"$",
"commands",
")",
"{",
"if",
"(",
"file_exists",
"(",
"$",
"target",
")",
")",
"{",
"return",
";",
"}",
"$",
"targetFolder",
"=",
"pathinfo",
"(",
"$",
"target",
",",
"PATHINFO_DIRNAME",
... | Process command to create 404 image and save to target
@param string $target
@param string $commands
@return void | [
"Process",
"command",
"to",
"create",
"404",
"image",
"and",
"save",
"to",
"target"
] | 7461f588bbf12cbf9544a68778541d052b68fd07 | https://github.com/tck/zf-imageresizer/blob/7461f588bbf12cbf9544a68778541d052b68fd07/src/TckImageResizer/Service/ImageProcessing.php#L107-L149 |
235,227 | tck/zf-imageresizer | src/TckImageResizer/Service/ImageProcessing.php | ImageProcessing.runCommand | protected function runCommand($command)
{
$method = 'image' . ucfirst(strtolower($command['command']));
if (!method_exists($this, $method)) {
return false;
}
call_user_func_array([$this, $method], $command['params']);
return true;
} | php | protected function runCommand($command)
{
$method = 'image' . ucfirst(strtolower($command['command']));
if (!method_exists($this, $method)) {
return false;
}
call_user_func_array([$this, $method], $command['params']);
return true;
} | [
"protected",
"function",
"runCommand",
"(",
"$",
"command",
")",
"{",
"$",
"method",
"=",
"'image'",
".",
"ucfirst",
"(",
"strtolower",
"(",
"$",
"command",
"[",
"'command'",
"]",
")",
")",
";",
"if",
"(",
"!",
"method_exists",
"(",
"$",
"this",
",",
... | Run command if exists
@param array $command
@return boolean | [
"Run",
"command",
"if",
"exists"
] | 7461f588bbf12cbf9544a68778541d052b68fd07 | https://github.com/tck/zf-imageresizer/blob/7461f588bbf12cbf9544a68778541d052b68fd07/src/TckImageResizer/Service/ImageProcessing.php#L179-L188 |
235,228 | tck/zf-imageresizer | src/TckImageResizer/Service/ImageProcessing.php | ImageProcessing.runCustomCommand | protected function runCustomCommand($command)
{
if (!CommandRegistry::hasCommand($command['command'])) {
throw new BadMethodCallException('Command "' . $command['command'] . '" not found');
}
$customCommand = CommandRegistry::getCommand($command['command']);
arra... | php | protected function runCustomCommand($command)
{
if (!CommandRegistry::hasCommand($command['command'])) {
throw new BadMethodCallException('Command "' . $command['command'] . '" not found');
}
$customCommand = CommandRegistry::getCommand($command['command']);
arra... | [
"protected",
"function",
"runCustomCommand",
"(",
"$",
"command",
")",
"{",
"if",
"(",
"!",
"CommandRegistry",
"::",
"hasCommand",
"(",
"$",
"command",
"[",
"'command'",
"]",
")",
")",
"{",
"throw",
"new",
"BadMethodCallException",
"(",
"'Command \"'",
".",
... | Run custom command if exists
@param array $command
@return boolean | [
"Run",
"custom",
"command",
"if",
"exists"
] | 7461f588bbf12cbf9544a68778541d052b68fd07 | https://github.com/tck/zf-imageresizer/blob/7461f588bbf12cbf9544a68778541d052b68fd07/src/TckImageResizer/Service/ImageProcessing.php#L197-L208 |
235,229 | tck/zf-imageresizer | src/TckImageResizer/Service/ImageProcessing.php | ImageProcessing.imageThumb | protected function imageThumb($width, $height)
{
$width = (int) $width;
$height = (int) $height;
if ($width <= 0) {
throw new BadMethodCallException('Invalid parameter width for command "thumb"');
}
if ($height <= 0) {
throw new BadMethodCallException(... | php | protected function imageThumb($width, $height)
{
$width = (int) $width;
$height = (int) $height;
if ($width <= 0) {
throw new BadMethodCallException('Invalid parameter width for command "thumb"');
}
if ($height <= 0) {
throw new BadMethodCallException(... | [
"protected",
"function",
"imageThumb",
"(",
"$",
"width",
",",
"$",
"height",
")",
"{",
"$",
"width",
"=",
"(",
"int",
")",
"$",
"width",
";",
"$",
"height",
"=",
"(",
"int",
")",
"$",
"height",
";",
"if",
"(",
"$",
"width",
"<=",
"0",
")",
"{"... | Command image thumb
@param int $width
@param int $height
@return void | [
"Command",
"image",
"thumb"
] | 7461f588bbf12cbf9544a68778541d052b68fd07 | https://github.com/tck/zf-imageresizer/blob/7461f588bbf12cbf9544a68778541d052b68fd07/src/TckImageResizer/Service/ImageProcessing.php#L218-L229 |
235,230 | tck/zf-imageresizer | src/TckImageResizer/Service/ImageProcessing.php | ImageProcessing.imageGamma | protected function imageGamma($correction)
{
$correction = (float) $correction;
$this->image->effects()->gamma($correction);
} | php | protected function imageGamma($correction)
{
$correction = (float) $correction;
$this->image->effects()->gamma($correction);
} | [
"protected",
"function",
"imageGamma",
"(",
"$",
"correction",
")",
"{",
"$",
"correction",
"=",
"(",
"float",
")",
"$",
"correction",
";",
"$",
"this",
"->",
"image",
"->",
"effects",
"(",
")",
"->",
"gamma",
"(",
"$",
"correction",
")",
";",
"}"
] | Command image gamma
@param float $correction
@return void | [
"Command",
"image",
"gamma"
] | 7461f588bbf12cbf9544a68778541d052b68fd07 | https://github.com/tck/zf-imageresizer/blob/7461f588bbf12cbf9544a68778541d052b68fd07/src/TckImageResizer/Service/ImageProcessing.php#L279-L284 |
235,231 | tck/zf-imageresizer | src/TckImageResizer/Service/ImageProcessing.php | ImageProcessing.imageColorize | protected function imageColorize($hexColor)
{
if (strlen($hexColor) != 6 || !preg_match('![0-9abcdef]!i', $hexColor)) {
throw new BadMethodCallException('Invalid parameter color for command "colorize"');
}
$color = $this->image->palette()->color('#' . $hexColor);
... | php | protected function imageColorize($hexColor)
{
if (strlen($hexColor) != 6 || !preg_match('![0-9abcdef]!i', $hexColor)) {
throw new BadMethodCallException('Invalid parameter color for command "colorize"');
}
$color = $this->image->palette()->color('#' . $hexColor);
... | [
"protected",
"function",
"imageColorize",
"(",
"$",
"hexColor",
")",
"{",
"if",
"(",
"strlen",
"(",
"$",
"hexColor",
")",
"!=",
"6",
"||",
"!",
"preg_match",
"(",
"'![0-9abcdef]!i'",
",",
"$",
"hexColor",
")",
")",
"{",
"throw",
"new",
"BadMethodCallExcept... | Command image colorize
@param string $hexColor
@return void | [
"Command",
"image",
"colorize"
] | 7461f588bbf12cbf9544a68778541d052b68fd07 | https://github.com/tck/zf-imageresizer/blob/7461f588bbf12cbf9544a68778541d052b68fd07/src/TckImageResizer/Service/ImageProcessing.php#L293-L301 |
235,232 | tck/zf-imageresizer | src/TckImageResizer/Service/ImageProcessing.php | ImageProcessing.imageBlur | protected function imageBlur($sigma = 1)
{
$sigma = (float) $sigma;
$this->image->effects()->blur($sigma);
} | php | protected function imageBlur($sigma = 1)
{
$sigma = (float) $sigma;
$this->image->effects()->blur($sigma);
} | [
"protected",
"function",
"imageBlur",
"(",
"$",
"sigma",
"=",
"1",
")",
"{",
"$",
"sigma",
"=",
"(",
"float",
")",
"$",
"sigma",
";",
"$",
"this",
"->",
"image",
"->",
"effects",
"(",
")",
"->",
"blur",
"(",
"$",
"sigma",
")",
";",
"}"
] | Command image blur
@param float $sigma
@return void | [
"Command",
"image",
"blur"
] | 7461f588bbf12cbf9544a68778541d052b68fd07 | https://github.com/tck/zf-imageresizer/blob/7461f588bbf12cbf9544a68778541d052b68fd07/src/TckImageResizer/Service/ImageProcessing.php#L320-L325 |
235,233 | tck/zf-imageresizer | src/TckImageResizer/Service/ImageProcessing.php | ImageProcessing.drawCenteredText | protected function drawCenteredText($text, $color)
{
$width = $this->image->getSize()->getWidth();
$height = $this->image->getSize()->getHeight();
$fontColor = $this->image->palette()->color('#' . $color);
$fontSize = 48;
$widthFactor = $width > 160 ? 0.8 : 0.9;
$heig... | php | protected function drawCenteredText($text, $color)
{
$width = $this->image->getSize()->getWidth();
$height = $this->image->getSize()->getHeight();
$fontColor = $this->image->palette()->color('#' . $color);
$fontSize = 48;
$widthFactor = $width > 160 ? 0.8 : 0.9;
$heig... | [
"protected",
"function",
"drawCenteredText",
"(",
"$",
"text",
",",
"$",
"color",
")",
"{",
"$",
"width",
"=",
"$",
"this",
"->",
"image",
"->",
"getSize",
"(",
")",
"->",
"getWidth",
"(",
")",
";",
"$",
"height",
"=",
"$",
"this",
"->",
"image",
"... | Draw centered text in current image
@param string $text
@param string $color
@return void | [
"Draw",
"centered",
"text",
"in",
"current",
"image"
] | 7461f588bbf12cbf9544a68778541d052b68fd07 | https://github.com/tck/zf-imageresizer/blob/7461f588bbf12cbf9544a68778541d052b68fd07/src/TckImageResizer/Service/ImageProcessing.php#L385-L406 |
235,234 | runcmf/runbb | src/RunBB/Model/Admin/Plugins.php | Plugins.deactivate | public function deactivate($name)
{
$name = Container::get('hooks')->fire('model.plugin.deactivate.name', $name);
$activePlugins = $this->manager->getActivePlugins();
// Check if plugin is actually activated
if (($k = array_search($name, $activePlugins)) !== false) {
$pl... | php | public function deactivate($name)
{
$name = Container::get('hooks')->fire('model.plugin.deactivate.name', $name);
$activePlugins = $this->manager->getActivePlugins();
// Check if plugin is actually activated
if (($k = array_search($name, $activePlugins)) !== false) {
$pl... | [
"public",
"function",
"deactivate",
"(",
"$",
"name",
")",
"{",
"$",
"name",
"=",
"Container",
"::",
"get",
"(",
"'hooks'",
")",
"->",
"fire",
"(",
"'model.plugin.deactivate.name'",
",",
"$",
"name",
")",
";",
"$",
"activePlugins",
"=",
"$",
"this",
"->"... | Deactivate a plugin | [
"Deactivate",
"a",
"plugin"
] | d4f4098bcece48b78ea2d1ae5eeead7ac9a8b463 | https://github.com/runcmf/runbb/blob/d4f4098bcece48b78ea2d1ae5eeead7ac9a8b463/src/RunBB/Model/Admin/Plugins.php#L99-L123 |
235,235 | runcmf/runbb | src/RunBB/Model/Admin/Plugins.php | Plugins.uninstall | public function uninstall($name)
{
$name = Container::get('hooks')->fire('model.plugin.uninstall.name', $name);
$activePlugins = $this->manager->getActivePlugins();
// Check if plugin is disabled, for security
if (!in_array($name, $activePlugins)) {
$plugin = DB::forTabl... | php | public function uninstall($name)
{
$name = Container::get('hooks')->fire('model.plugin.uninstall.name', $name);
$activePlugins = $this->manager->getActivePlugins();
// Check if plugin is disabled, for security
if (!in_array($name, $activePlugins)) {
$plugin = DB::forTabl... | [
"public",
"function",
"uninstall",
"(",
"$",
"name",
")",
"{",
"$",
"name",
"=",
"Container",
"::",
"get",
"(",
"'hooks'",
")",
"->",
"fire",
"(",
"'model.plugin.uninstall.name'",
",",
"$",
"name",
")",
";",
"$",
"activePlugins",
"=",
"$",
"this",
"->",
... | Uninstall a plugin after deactivated | [
"Uninstall",
"a",
"plugin",
"after",
"deactivated"
] | d4f4098bcece48b78ea2d1ae5eeead7ac9a8b463 | https://github.com/runcmf/runbb/blob/d4f4098bcece48b78ea2d1ae5eeead7ac9a8b463/src/RunBB/Model/Admin/Plugins.php#L128-L151 |
235,236 | bitExpert/adroit | src/bitExpert/Adroit/Resolver/AbstractResolverMiddleware.php | AbstractResolverMiddleware.validateResolvers | private function validateResolvers(array $resolvers)
{
foreach ($resolvers as $index => $resolver) {
if (!$this->isValidResolver($resolver)) {
throw new \InvalidArgumentException(sprintf(
'Resolver at index %s of type "%s" is not valid resolver type',
... | php | private function validateResolvers(array $resolvers)
{
foreach ($resolvers as $index => $resolver) {
if (!$this->isValidResolver($resolver)) {
throw new \InvalidArgumentException(sprintf(
'Resolver at index %s of type "%s" is not valid resolver type',
... | [
"private",
"function",
"validateResolvers",
"(",
"array",
"$",
"resolvers",
")",
"{",
"foreach",
"(",
"$",
"resolvers",
"as",
"$",
"index",
"=>",
"$",
"resolver",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"isValidResolver",
"(",
"$",
"resolver",
")",
... | Internal resolver setter which validates the resolvers
@param \bitExpert\Adroit\Resolver\Resolver[] $resolvers
@throws \InvalidArgumentException | [
"Internal",
"resolver",
"setter",
"which",
"validates",
"the",
"resolvers"
] | ecba7e59b864c88bd4639c87194ad842320e5f76 | https://github.com/bitExpert/adroit/blob/ecba7e59b864c88bd4639c87194ad842320e5f76/src/bitExpert/Adroit/Resolver/AbstractResolverMiddleware.php#L47-L58 |
235,237 | despark/ignicms | src/Models/Image.php | Image.__isset | public function __isset($key)
{
$result = parent::__isset($key);
if ($result) {
return $result;
}
// if (! $result && $key == 'identifier') {
// $resourceModel = $this->getResourceModel();
// if ($resourceModel && $resourceMode... | php | public function __isset($key)
{
$result = parent::__isset($key);
if ($result) {
return $result;
}
// if (! $result && $key == 'identifier') {
// $resourceModel = $this->getResourceModel();
// if ($resourceModel && $resourceMode... | [
"public",
"function",
"__isset",
"(",
"$",
"key",
")",
"{",
"$",
"result",
"=",
"parent",
"::",
"__isset",
"(",
"$",
"key",
")",
";",
"if",
"(",
"$",
"result",
")",
"{",
"return",
"$",
"result",
";",
"}",
"// if (! $result && $key == 'identifier') {... | Override magic isset so we can check for identifier metadata and properties.
@param string $key
@return bool | [
"Override",
"magic",
"isset",
"so",
"we",
"can",
"check",
"for",
"identifier",
"metadata",
"and",
"properties",
"."
] | d55775a4656a7e99017d2ef3f8160599d600d2a7 | https://github.com/despark/ignicms/blob/d55775a4656a7e99017d2ef3f8160599d600d2a7/src/Models/Image.php#L423-L440 |
235,238 | accompli/accompli | src/Configuration/Configuration.php | Configuration.load | public function load($configurationFile = null)
{
$this->hosts = array();
$this->configuration = array();
if (isset($configurationFile)) {
$this->configurationFile = $configurationFile;
}
if (file_exists($this->configurationFile) === false) {
throw n... | php | public function load($configurationFile = null)
{
$this->hosts = array();
$this->configuration = array();
if (isset($configurationFile)) {
$this->configurationFile = $configurationFile;
}
if (file_exists($this->configurationFile) === false) {
throw n... | [
"public",
"function",
"load",
"(",
"$",
"configurationFile",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"hosts",
"=",
"array",
"(",
")",
";",
"$",
"this",
"->",
"configuration",
"=",
"array",
"(",
")",
";",
"if",
"(",
"isset",
"(",
"$",
"configuration... | Loads and validates the JSON configuration.
@param string|null $configurationFile
@throws InvalidArgumentException | [
"Loads",
"and",
"validates",
"the",
"JSON",
"configuration",
"."
] | 618f28377448d8caa90d63bfa5865a3ee15e49e7 | https://github.com/accompli/accompli/blob/618f28377448d8caa90d63bfa5865a3ee15e49e7/src/Configuration/Configuration.php#L73-L96 |
235,239 | accompli/accompli | src/Configuration/Configuration.php | Configuration.processEventSubscribers | private function processEventSubscribers()
{
if (isset($this->configuration['events']['subscribers'])) {
foreach ($this->configuration['events']['subscribers'] as $i => $subscriber) {
if (is_string($subscriber)) {
$this->configuration['events']['subscribers'][... | php | private function processEventSubscribers()
{
if (isset($this->configuration['events']['subscribers'])) {
foreach ($this->configuration['events']['subscribers'] as $i => $subscriber) {
if (is_string($subscriber)) {
$this->configuration['events']['subscribers'][... | [
"private",
"function",
"processEventSubscribers",
"(",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"configuration",
"[",
"'events'",
"]",
"[",
"'subscribers'",
"]",
")",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"configuration",
"[",
"'events'... | Processes event subscriber configurations to match the same format. | [
"Processes",
"event",
"subscriber",
"configurations",
"to",
"match",
"the",
"same",
"format",
"."
] | 618f28377448d8caa90d63bfa5865a3ee15e49e7 | https://github.com/accompli/accompli/blob/618f28377448d8caa90d63bfa5865a3ee15e49e7/src/Configuration/Configuration.php#L180-L189 |
235,240 | accompli/accompli | src/Configuration/Configuration.php | Configuration.getHosts | public function getHosts()
{
if (empty($this->hosts) && isset($this->configuration['hosts'])) {
foreach ($this->configuration['hosts'] as $host) {
$this->hosts[] = ObjectFactory::getInstance()->newInstance(Host::class, $host);
}
}
return $this->hosts;... | php | public function getHosts()
{
if (empty($this->hosts) && isset($this->configuration['hosts'])) {
foreach ($this->configuration['hosts'] as $host) {
$this->hosts[] = ObjectFactory::getInstance()->newInstance(Host::class, $host);
}
}
return $this->hosts;... | [
"public",
"function",
"getHosts",
"(",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"this",
"->",
"hosts",
")",
"&&",
"isset",
"(",
"$",
"this",
"->",
"configuration",
"[",
"'hosts'",
"]",
")",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"configuration",... | Returns the configured hosts.
@return Host[] | [
"Returns",
"the",
"configured",
"hosts",
"."
] | 618f28377448d8caa90d63bfa5865a3ee15e49e7 | https://github.com/accompli/accompli/blob/618f28377448d8caa90d63bfa5865a3ee15e49e7/src/Configuration/Configuration.php#L196-L205 |
235,241 | shopgate/cart-integration-sdk | src/configuration.php | ShopgateConfig.loadArray | public function loadArray(array $data = array())
{
// if no $data was passed try loading the default configuration file
if (empty($data)) {
$this->loadFile();
return;
}
// if data was passed, map via setters
$unmappedData = parent::loadArray($data);
... | php | public function loadArray(array $data = array())
{
// if no $data was passed try loading the default configuration file
if (empty($data)) {
$this->loadFile();
return;
}
// if data was passed, map via setters
$unmappedData = parent::loadArray($data);
... | [
"public",
"function",
"loadArray",
"(",
"array",
"$",
"data",
"=",
"array",
"(",
")",
")",
"{",
"// if no $data was passed try loading the default configuration file",
"if",
"(",
"empty",
"(",
"$",
"data",
")",
")",
"{",
"$",
"this",
"->",
"loadFile",
"(",
")"... | Tries to assign the values of an array to the configuration fields or load it from a file.
This overrides ShopgateContainer::loadArray() which is called on object instantiation. It tries to assign
the values of $data to the class attributes by $data's keys. If a key is not the name of a
class attribute it's appended t... | [
"Tries",
"to",
"assign",
"the",
"values",
"of",
"an",
"array",
"to",
"the",
"configuration",
"fields",
"or",
"load",
"it",
"from",
"a",
"file",
"."
] | cf12ecf8bdb8f4c407209000002fd00261e53b06 | https://github.com/shopgate/cart-integration-sdk/blob/cf12ecf8bdb8f4c407209000002fd00261e53b06/src/configuration.php#L705-L719 |
235,242 | shopgate/cart-integration-sdk | src/configuration.php | ShopgateConfig.loadFile | public function loadFile($path = null)
{
$config = null;
// try loading files
if (!empty($path) && file_exists($path)) {
// try $path
$config = $this->includeFile($path);
if (!$config) {
throw new ShopgateLibraryException(
... | php | public function loadFile($path = null)
{
$config = null;
// try loading files
if (!empty($path) && file_exists($path)) {
// try $path
$config = $this->includeFile($path);
if (!$config) {
throw new ShopgateLibraryException(
... | [
"public",
"function",
"loadFile",
"(",
"$",
"path",
"=",
"null",
")",
"{",
"$",
"config",
"=",
"null",
";",
"// try loading files",
"if",
"(",
"!",
"empty",
"(",
"$",
"path",
")",
"&&",
"file_exists",
"(",
"$",
"path",
")",
")",
"{",
"// try $path",
... | Tries to load the configuration from a file.
If a $path is passed, this method tries to include the file. If that fails an exception is thrown.<br />
<br />
If $path is empty it tries to load .../shopgate_library/config/myconfig.php or if that fails,
.../shopgate_library/config/config.php is tried to be loaded. If tha... | [
"Tries",
"to",
"load",
"the",
"configuration",
"from",
"a",
"file",
"."
] | cf12ecf8bdb8f4c407209000002fd00261e53b06 | https://github.com/shopgate/cart-integration-sdk/blob/cf12ecf8bdb8f4c407209000002fd00261e53b06/src/configuration.php#L739-L767 |
235,243 | shopgate/cart-integration-sdk | src/configuration.php | ShopgateConfig.loadByShopNumber | public function loadByShopNumber($shopNumber)
{
if (empty($shopNumber) || !preg_match($this->coreValidations['shop_number'], $shopNumber)) {
throw new ShopgateLibraryException(
ShopgateLibraryException::CONFIG_READ_WRITE_ERROR,
'configuration file cannot be found ... | php | public function loadByShopNumber($shopNumber)
{
if (empty($shopNumber) || !preg_match($this->coreValidations['shop_number'], $shopNumber)) {
throw new ShopgateLibraryException(
ShopgateLibraryException::CONFIG_READ_WRITE_ERROR,
'configuration file cannot be found ... | [
"public",
"function",
"loadByShopNumber",
"(",
"$",
"shopNumber",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"shopNumber",
")",
"||",
"!",
"preg_match",
"(",
"$",
"this",
"->",
"coreValidations",
"[",
"'shop_number'",
"]",
",",
"$",
"shopNumber",
")",
")",
... | Loads the configuration file for a given Shopgate shop number.
@param string $shopNumber The shop number.
@throws ShopgateLibraryException in case the $shopNumber is empty or no configuration file can be found. | [
"Loads",
"the",
"configuration",
"file",
"for",
"a",
"given",
"Shopgate",
"shop",
"number",
"."
] | cf12ecf8bdb8f4c407209000002fd00261e53b06 | https://github.com/shopgate/cart-integration-sdk/blob/cf12ecf8bdb8f4c407209000002fd00261e53b06/src/configuration.php#L776-L815 |
235,244 | shopgate/cart-integration-sdk | src/configuration.php | ShopgateConfig.loadByLanguage | public function loadByLanguage($language)
{
if (!is_null($language) && !preg_match('/[a-z]{2}/', $language)) {
throw new ShopgateLibraryException(
ShopgateLibraryException::CONFIG_READ_WRITE_ERROR,
'invalid language code "' . $language . '"',
true,... | php | public function loadByLanguage($language)
{
if (!is_null($language) && !preg_match('/[a-z]{2}/', $language)) {
throw new ShopgateLibraryException(
ShopgateLibraryException::CONFIG_READ_WRITE_ERROR,
'invalid language code "' . $language . '"',
true,... | [
"public",
"function",
"loadByLanguage",
"(",
"$",
"language",
")",
"{",
"if",
"(",
"!",
"is_null",
"(",
"$",
"language",
")",
"&&",
"!",
"preg_match",
"(",
"'/[a-z]{2}/'",
",",
"$",
"language",
")",
")",
"{",
"throw",
"new",
"ShopgateLibraryException",
"("... | Loads the configuration file by a given language or the global configuration file.
@param string|null $language the ISO-639 code of the language or null to load global configuration
@throws ShopgateLibraryException | [
"Loads",
"the",
"configuration",
"file",
"by",
"a",
"given",
"language",
"or",
"the",
"global",
"configuration",
"file",
"."
] | cf12ecf8bdb8f4c407209000002fd00261e53b06 | https://github.com/shopgate/cart-integration-sdk/blob/cf12ecf8bdb8f4c407209000002fd00261e53b06/src/configuration.php#L824-L837 |
235,245 | shopgate/cart-integration-sdk | src/configuration.php | ShopgateConfig.initFileNames | protected function initFileNames()
{
$this->items_csv_filename = 'items-' . $this->language . '.csv';
$this->items_xml_filename = 'items-' . $this->language . '.xml';
$this->items_json_filename = 'items-' . $this->language . '.json';
$this->media_csv_filename = 'media-' . $this->l... | php | protected function initFileNames()
{
$this->items_csv_filename = 'items-' . $this->language . '.csv';
$this->items_xml_filename = 'items-' . $this->language . '.xml';
$this->items_json_filename = 'items-' . $this->language . '.json';
$this->media_csv_filename = 'media-' . $this->l... | [
"protected",
"function",
"initFileNames",
"(",
")",
"{",
"$",
"this",
"->",
"items_csv_filename",
"=",
"'items-'",
".",
"$",
"this",
"->",
"language",
".",
"'.csv'",
";",
"$",
"this",
"->",
"items_xml_filename",
"=",
"'items-'",
".",
"$",
"this",
"->",
"la... | Sets the file names according to the language of the configuration. | [
"Sets",
"the",
"file",
"names",
"according",
"to",
"the",
"language",
"of",
"the",
"configuration",
"."
] | cf12ecf8bdb8f4c407209000002fd00261e53b06 | https://github.com/shopgate/cart-integration-sdk/blob/cf12ecf8bdb8f4c407209000002fd00261e53b06/src/configuration.php#L842-L863 |
235,246 | shopgate/cart-integration-sdk | src/configuration.php | ShopgateConfig.saveFile | public function saveFile(array $fieldList, $path = null, $validate = true)
{
// if desired, validate before doing anything else
if ($validate) {
$this->validate($fieldList);
}
// preserve values of the fields to save
$saveFields = array();
$currentConf... | php | public function saveFile(array $fieldList, $path = null, $validate = true)
{
// if desired, validate before doing anything else
if ($validate) {
$this->validate($fieldList);
}
// preserve values of the fields to save
$saveFields = array();
$currentConf... | [
"public",
"function",
"saveFile",
"(",
"array",
"$",
"fieldList",
",",
"$",
"path",
"=",
"null",
",",
"$",
"validate",
"=",
"true",
")",
"{",
"// if desired, validate before doing anything else",
"if",
"(",
"$",
"validate",
")",
"{",
"$",
"this",
"->",
"vali... | Saves the desired configuration fields to the specified file or myconfig.php.
This calls $this->loadFile() with the given $path to load the current configuration. In case that fails, the
$shopgate_config array is initialized empty. The values defined in $fieldList are then validated (if desired),
assigned to $shopgate... | [
"Saves",
"the",
"desired",
"configuration",
"fields",
"to",
"the",
"specified",
"file",
"or",
"myconfig",
".",
"php",
"."
] | cf12ecf8bdb8f4c407209000002fd00261e53b06 | https://github.com/shopgate/cart-integration-sdk/blob/cf12ecf8bdb8f4c407209000002fd00261e53b06/src/configuration.php#L895-L936 |
235,247 | shopgate/cart-integration-sdk | src/configuration.php | ShopgateConfig.saveFileForLanguage | public function saveFileForLanguage(array $fieldList, $language = null, $validate = true)
{
$fileName = null;
if (!is_null($language)) {
$this->setLanguage($language);
$fieldList[] = 'language';
$fileName = $this->buildConfigFilePath('myconfig-' . $language . '... | php | public function saveFileForLanguage(array $fieldList, $language = null, $validate = true)
{
$fileName = null;
if (!is_null($language)) {
$this->setLanguage($language);
$fieldList[] = 'language';
$fileName = $this->buildConfigFilePath('myconfig-' . $language . '... | [
"public",
"function",
"saveFileForLanguage",
"(",
"array",
"$",
"fieldList",
",",
"$",
"language",
"=",
"null",
",",
"$",
"validate",
"=",
"true",
")",
"{",
"$",
"fileName",
"=",
"null",
";",
"if",
"(",
"!",
"is_null",
"(",
"$",
"language",
")",
")",
... | Saves the desired fields to the configuration file for a given language or global configuration
@param string[] $fieldList the list of fieldnames that should be saved to the configuration file.
@param string $language the ISO-639 code of the language or null to save to global configuration
@param bool $validate... | [
"Saves",
"the",
"desired",
"fields",
"to",
"the",
"configuration",
"file",
"for",
"a",
"given",
"language",
"or",
"global",
"configuration"
] | cf12ecf8bdb8f4c407209000002fd00261e53b06 | https://github.com/shopgate/cart-integration-sdk/blob/cf12ecf8bdb8f4c407209000002fd00261e53b06/src/configuration.php#L947-L957 |
235,248 | shopgate/cart-integration-sdk | src/configuration.php | ShopgateConfig.checkDuplicates | public function checkDuplicates()
{
$shopNumbers = array();
$files = scandir(dirname($this->buildConfigFilePath()));
foreach ($files as $file) {
if (!is_file($this->buildConfigFilePath($file))) {
continue;
}
$shopgate_config = null;... | php | public function checkDuplicates()
{
$shopNumbers = array();
$files = scandir(dirname($this->buildConfigFilePath()));
foreach ($files as $file) {
if (!is_file($this->buildConfigFilePath($file))) {
continue;
}
$shopgate_config = null;... | [
"public",
"function",
"checkDuplicates",
"(",
")",
"{",
"$",
"shopNumbers",
"=",
"array",
"(",
")",
";",
"$",
"files",
"=",
"scandir",
"(",
"dirname",
"(",
"$",
"this",
"->",
"buildConfigFilePath",
"(",
")",
")",
")",
";",
"foreach",
"(",
"$",
"files",... | Checks for duplicate shop numbers in multiple configurations.
This checks all files in the configuration folder and shop numbers in all
configuration files.
@return bool true if there are duplicates, false otherwise. | [
"Checks",
"for",
"duplicate",
"shop",
"numbers",
"in",
"multiple",
"configurations",
"."
] | cf12ecf8bdb8f4c407209000002fd00261e53b06 | https://github.com/shopgate/cart-integration-sdk/blob/cf12ecf8bdb8f4c407209000002fd00261e53b06/src/configuration.php#L967-L990 |
235,249 | shopgate/cart-integration-sdk | src/configuration.php | ShopgateConfig.checkMultipleConfigs | public function checkMultipleConfigs()
{
$files = scandir(dirname($this->buildConfigFilePath()));
$counter = 0;
foreach ($files as $file) {
if (!is_file($this->buildConfigFilePath($file))) {
continue;
}
if (substr($file, -4) !== '.php')... | php | public function checkMultipleConfigs()
{
$files = scandir(dirname($this->buildConfigFilePath()));
$counter = 0;
foreach ($files as $file) {
if (!is_file($this->buildConfigFilePath($file))) {
continue;
}
if (substr($file, -4) !== '.php')... | [
"public",
"function",
"checkMultipleConfigs",
"(",
")",
"{",
"$",
"files",
"=",
"scandir",
"(",
"dirname",
"(",
"$",
"this",
"->",
"buildConfigFilePath",
"(",
")",
")",
")",
";",
"$",
"counter",
"=",
"0",
";",
"foreach",
"(",
"$",
"files",
"as",
"$",
... | Checks if there is more than one configuration file available.
@return bool true if multiple configuration files are available, false otherwise. | [
"Checks",
"if",
"there",
"is",
"more",
"than",
"one",
"configuration",
"file",
"available",
"."
] | cf12ecf8bdb8f4c407209000002fd00261e53b06 | https://github.com/shopgate/cart-integration-sdk/blob/cf12ecf8bdb8f4c407209000002fd00261e53b06/src/configuration.php#L997-L1024 |
235,250 | shopgate/cart-integration-sdk | src/configuration.php | ShopgateConfig.useGlobalFor | public function useGlobalFor($language)
{
$fileName = $this->buildConfigFilePath('myconfig-' . $language . '.php');
if (file_exists($fileName)) {
if (!@unlink($fileName)) {
throw new ShopgateLibraryException(
ShopgateLibraryException::CONFIG_READ_WRITE... | php | public function useGlobalFor($language)
{
$fileName = $this->buildConfigFilePath('myconfig-' . $language . '.php');
if (file_exists($fileName)) {
if (!@unlink($fileName)) {
throw new ShopgateLibraryException(
ShopgateLibraryException::CONFIG_READ_WRITE... | [
"public",
"function",
"useGlobalFor",
"(",
"$",
"language",
")",
"{",
"$",
"fileName",
"=",
"$",
"this",
"->",
"buildConfigFilePath",
"(",
"'myconfig-'",
".",
"$",
"language",
".",
"'.php'",
")",
";",
"if",
"(",
"file_exists",
"(",
"$",
"fileName",
")",
... | Removes the configuration file for the language requested.
@param string $language the ISO-639 code of the language or null to load global configuration
@throws ShopgateLibraryException in case the file exists but cannot be deleted. | [
"Removes",
"the",
"configuration",
"file",
"for",
"the",
"language",
"requested",
"."
] | cf12ecf8bdb8f4c407209000002fd00261e53b06 | https://github.com/shopgate/cart-integration-sdk/blob/cf12ecf8bdb8f4c407209000002fd00261e53b06/src/configuration.php#L1045-L1056 |
235,251 | shopgate/cart-integration-sdk | src/configuration.php | ShopgateConfig.mapAdditionalSettings | private function mapAdditionalSettings($data = array())
{
foreach ($data as $key => $value) {
$this->additionalSettings[$key] = $value;
}
} | php | private function mapAdditionalSettings($data = array())
{
foreach ($data as $key => $value) {
$this->additionalSettings[$key] = $value;
}
} | [
"private",
"function",
"mapAdditionalSettings",
"(",
"$",
"data",
"=",
"array",
"(",
")",
")",
"{",
"foreach",
"(",
"$",
"data",
"as",
"$",
"key",
"=>",
"$",
"value",
")",
"{",
"$",
"this",
"->",
"additionalSettings",
"[",
"$",
"key",
"]",
"=",
"$",
... | Maps the passed data to the additional settings array.
@param array <string, mixed> $data The data to map. | [
"Maps",
"the",
"passed",
"data",
"to",
"the",
"additional",
"settings",
"array",
"."
] | cf12ecf8bdb8f4c407209000002fd00261e53b06 | https://github.com/shopgate/cart-integration-sdk/blob/cf12ecf8bdb8f4c407209000002fd00261e53b06/src/configuration.php#L2305-L2310 |
235,252 | shopgate/cart-integration-sdk | src/configuration.php | ShopgateConfigOld.deprecated | private static function deprecated($methodName)
{
$message = 'Use of ' . $methodName . ' and the whole ShopgateConfigOld class is deprecated.';
trigger_error($message, E_USER_DEPRECATED);
ShopgateLogger::getInstance()->log($message);
} | php | private static function deprecated($methodName)
{
$message = 'Use of ' . $methodName . ' and the whole ShopgateConfigOld class is deprecated.';
trigger_error($message, E_USER_DEPRECATED);
ShopgateLogger::getInstance()->log($message);
} | [
"private",
"static",
"function",
"deprecated",
"(",
"$",
"methodName",
")",
"{",
"$",
"message",
"=",
"'Use of '",
".",
"$",
"methodName",
".",
"' and the whole ShopgateConfigOld class is deprecated.'",
";",
"trigger_error",
"(",
"$",
"message",
",",
"E_USER_DEPRECATE... | Issues a PHP deprecated warning and log entry for calls to deprecated ShopgateConfigOld methods.
@param string $methodName The name of the called method. | [
"Issues",
"a",
"PHP",
"deprecated",
"warning",
"and",
"log",
"entry",
"for",
"calls",
"to",
"deprecated",
"ShopgateConfigOld",
"methods",
"."
] | cf12ecf8bdb8f4c407209000002fd00261e53b06 | https://github.com/shopgate/cart-integration-sdk/blob/cf12ecf8bdb8f4c407209000002fd00261e53b06/src/configuration.php#L2838-L2843 |
235,253 | mosbth/Anax-MVC | src/View/CViewContainerBasic.php | CViewContainerBasic.addString | public function addString($content, $region = 'main', $sort = 0)
{
$view = $this->di->get('view');
$view->set($content, [], $sort, 'string');
$view->setDI($this->di);
$this->views[$region][] = $view;
return $this;
} | php | public function addString($content, $region = 'main', $sort = 0)
{
$view = $this->di->get('view');
$view->set($content, [], $sort, 'string');
$view->setDI($this->di);
$this->views[$region][] = $view;
return $this;
} | [
"public",
"function",
"addString",
"(",
"$",
"content",
",",
"$",
"region",
"=",
"'main'",
",",
"$",
"sort",
"=",
"0",
")",
"{",
"$",
"view",
"=",
"$",
"this",
"->",
"di",
"->",
"get",
"(",
"'view'",
")",
";",
"$",
"view",
"->",
"set",
"(",
"$"... | Add a string as a view.
@param string $content the content
@param string $region which region to attach the view
@param int $sort which order to display the views
@return $this | [
"Add",
"a",
"string",
"as",
"a",
"view",
"."
] | 5574d105bcec9df8e57532a321585f6521b4581c | https://github.com/mosbth/Anax-MVC/blob/5574d105bcec9df8e57532a321585f6521b4581c/src/View/CViewContainerBasic.php#L88-L96 |
235,254 | mosbth/Anax-MVC | src/View/CViewContainerBasic.php | CViewContainerBasic.setBasePath | public function setBasePath($path)
{
if (!is_dir($path)) {
throw new \Exception("Base path for views is not a directory: " . $path);
}
$this->path = rtrim($path, '/') . '/';
} | php | public function setBasePath($path)
{
if (!is_dir($path)) {
throw new \Exception("Base path for views is not a directory: " . $path);
}
$this->path = rtrim($path, '/') . '/';
} | [
"public",
"function",
"setBasePath",
"(",
"$",
"path",
")",
"{",
"if",
"(",
"!",
"is_dir",
"(",
"$",
"path",
")",
")",
"{",
"throw",
"new",
"\\",
"Exception",
"(",
"\"Base path for views is not a directory: \"",
".",
"$",
"path",
")",
";",
"}",
"$",
"thi... | Set base path where to find views.
@param string $path where all views reside
@return $this
@throws \Exception | [
"Set",
"base",
"path",
"where",
"to",
"find",
"views",
"."
] | 5574d105bcec9df8e57532a321585f6521b4581c | https://github.com/mosbth/Anax-MVC/blob/5574d105bcec9df8e57532a321585f6521b4581c/src/View/CViewContainerBasic.php#L121-L127 |
235,255 | mosbth/Anax-MVC | src/View/CViewContainerBasic.php | CViewContainerBasic.render | public function render($region = 'main')
{
if (!isset($this->views[$region])) {
return $this;
}
mergesort($this->views[$region], function ($a, $b) {
$sa = $a->sortOrder();
$sb = $b->sortOrder();
if ($sa == $sb) {
return 0;
... | php | public function render($region = 'main')
{
if (!isset($this->views[$region])) {
return $this;
}
mergesort($this->views[$region], function ($a, $b) {
$sa = $a->sortOrder();
$sb = $b->sortOrder();
if ($sa == $sb) {
return 0;
... | [
"public",
"function",
"render",
"(",
"$",
"region",
"=",
"'main'",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"views",
"[",
"$",
"region",
"]",
")",
")",
"{",
"return",
"$",
"this",
";",
"}",
"mergesort",
"(",
"$",
"this",
"->",
... | Render all views for a specific region.
@param string $region which region to use
@return $this | [
"Render",
"all",
"views",
"for",
"a",
"specific",
"region",
"."
] | 5574d105bcec9df8e57532a321585f6521b4581c | https://github.com/mosbth/Anax-MVC/blob/5574d105bcec9df8e57532a321585f6521b4581c/src/View/CViewContainerBasic.php#L152-L174 |
235,256 | shopgate/cart-integration-sdk | src/models/Abstract.php | Shopgate_Model_Abstract.getData | public function getData($key = '', $index = null)
{
if ('' === $key) {
return $this->data;
}
$default = null;
if (isset($this->data[$key])) {
if (is_null($index)) {
return $this->data[$key];
}
$value = $this->data[$key... | php | public function getData($key = '', $index = null)
{
if ('' === $key) {
return $this->data;
}
$default = null;
if (isset($this->data[$key])) {
if (is_null($index)) {
return $this->data[$key];
}
$value = $this->data[$key... | [
"public",
"function",
"getData",
"(",
"$",
"key",
"=",
"''",
",",
"$",
"index",
"=",
"null",
")",
"{",
"if",
"(",
"''",
"===",
"$",
"key",
")",
"{",
"return",
"$",
"this",
"->",
"data",
";",
"}",
"$",
"default",
"=",
"null",
";",
"if",
"(",
"... | returns data from key or all
@param string $key
@param null $index
@return array|null | [
"returns",
"data",
"from",
"key",
"or",
"all"
] | cf12ecf8bdb8f4c407209000002fd00261e53b06 | https://github.com/shopgate/cart-integration-sdk/blob/cf12ecf8bdb8f4c407209000002fd00261e53b06/src/models/Abstract.php#L131-L156 |
235,257 | BugBuster1701/contao-xing-bundle | src/Resources/contao/classes/XingImage.php | XingImage.getXingImageLink | public function getXingImageLink($xinglayout, $xing_source = 'xing_local')
{
$arrXingImageDefinitions= array();
$xingSrcProfile = '//www.xing.com/img/buttons/';
$xingSrcCompany = '//www.xing.com/img/xing/xe/corporate_pages/';
$xingSrcLocal = 'bundles/bugbusterxing/';
if (file_exists(TL... | php | public function getXingImageLink($xinglayout, $xing_source = 'xing_local')
{
$arrXingImageDefinitions= array();
$xingSrcProfile = '//www.xing.com/img/buttons/';
$xingSrcCompany = '//www.xing.com/img/xing/xe/corporate_pages/';
$xingSrcLocal = 'bundles/bugbusterxing/';
if (file_exists(TL... | [
"public",
"function",
"getXingImageLink",
"(",
"$",
"xinglayout",
",",
"$",
"xing_source",
"=",
"'xing_local'",
")",
"{",
"$",
"arrXingImageDefinitions",
"=",
"array",
"(",
")",
";",
"$",
"xingSrcProfile",
"=",
"'//www.xing.com/img/buttons/'",
";",
"$",
"xingSrcCo... | get Image Link | [
"get",
"Image",
"Link"
] | e2816a6e6ff439812de6599712c5b8b756e4738a | https://github.com/BugBuster1701/contao-xing-bundle/blob/e2816a6e6ff439812de6599712c5b8b756e4738a/src/Resources/contao/classes/XingImage.php#L32-L66 |
235,258 | shopgate/cart-integration-sdk | src/models/AbstractExport.php | Shopgate_Model_AbstractExport.generateData | public function generateData()
{
foreach ($this->fireMethods as $method) {
$this->log(
"Calling function \"{$method}\": Actual memory usage before method: " .
$this->getMemoryUsageString(),
ShopgateLogger::LOGTYPE_DEBUG
);
$... | php | public function generateData()
{
foreach ($this->fireMethods as $method) {
$this->log(
"Calling function \"{$method}\": Actual memory usage before method: " .
$this->getMemoryUsageString(),
ShopgateLogger::LOGTYPE_DEBUG
);
$... | [
"public",
"function",
"generateData",
"(",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"fireMethods",
"as",
"$",
"method",
")",
"{",
"$",
"this",
"->",
"log",
"(",
"\"Calling function \\\"{$method}\\\": Actual memory usage before method: \"",
".",
"$",
"this",
"-... | generate data dom object
@return $this | [
"generate",
"data",
"dom",
"object"
] | cf12ecf8bdb8f4c407209000002fd00261e53b06 | https://github.com/shopgate/cart-integration-sdk/blob/cf12ecf8bdb8f4c407209000002fd00261e53b06/src/models/AbstractExport.php#L134-L146 |
235,259 | accompli/accompli | src/Console/Logger/ConsoleLogger.php | ConsoleLogger.getTaskActionStatusSectionFromContext | private function getTaskActionStatusSectionFromContext(array $context)
{
$actionStatusSection = '';
if ($this->output->isDecorated()) {
$actionStatusSection = sprintf(self::ANSI_CURSOR_BACKWARD_FORMAT, 1);
}
if (isset($context['event.task.action']) && isset($this->taskAct... | php | private function getTaskActionStatusSectionFromContext(array $context)
{
$actionStatusSection = '';
if ($this->output->isDecorated()) {
$actionStatusSection = sprintf(self::ANSI_CURSOR_BACKWARD_FORMAT, 1);
}
if (isset($context['event.task.action']) && isset($this->taskAct... | [
"private",
"function",
"getTaskActionStatusSectionFromContext",
"(",
"array",
"$",
"context",
")",
"{",
"$",
"actionStatusSection",
"=",
"''",
";",
"if",
"(",
"$",
"this",
"->",
"output",
"->",
"isDecorated",
"(",
")",
")",
"{",
"$",
"actionStatusSection",
"="... | Returns the task status section based on the context.
@param array $context
@return string | [
"Returns",
"the",
"task",
"status",
"section",
"based",
"on",
"the",
"context",
"."
] | 618f28377448d8caa90d63bfa5865a3ee15e49e7 | https://github.com/accompli/accompli/blob/618f28377448d8caa90d63bfa5865a3ee15e49e7/src/Console/Logger/ConsoleLogger.php#L233-L244 |
235,260 | accompli/accompli | src/Console/Logger/ConsoleLogger.php | ConsoleLogger.getMessageLineCount | private function getMessageLineCount($message)
{
$messageLength = FormatterHelper::strlenWithoutDecoration($this->output->getFormatter(), $message);
return ceil($messageLength / $this->getTerminalWidth());
} | php | private function getMessageLineCount($message)
{
$messageLength = FormatterHelper::strlenWithoutDecoration($this->output->getFormatter(), $message);
return ceil($messageLength / $this->getTerminalWidth());
} | [
"private",
"function",
"getMessageLineCount",
"(",
"$",
"message",
")",
"{",
"$",
"messageLength",
"=",
"FormatterHelper",
"::",
"strlenWithoutDecoration",
"(",
"$",
"this",
"->",
"output",
"->",
"getFormatter",
"(",
")",
",",
"$",
"message",
")",
";",
"return... | Returns the line count of the message based on the terminal width.
@param string $message
@return int | [
"Returns",
"the",
"line",
"count",
"of",
"the",
"message",
"based",
"on",
"the",
"terminal",
"width",
"."
] | 618f28377448d8caa90d63bfa5865a3ee15e49e7 | https://github.com/accompli/accompli/blob/618f28377448d8caa90d63bfa5865a3ee15e49e7/src/Console/Logger/ConsoleLogger.php#L275-L280 |
235,261 | silverstripe/silverstripe-versionfeed | src/VersionFeed.php | VersionFeed.getDiff | public function getDiff()
{
$changes = $this->getDiffList($this->owner->Version, 1);
if ($changes && $changes->Count()) {
return $changes->First();
}
return null;
} | php | public function getDiff()
{
$changes = $this->getDiffList($this->owner->Version, 1);
if ($changes && $changes->Count()) {
return $changes->First();
}
return null;
} | [
"public",
"function",
"getDiff",
"(",
")",
"{",
"$",
"changes",
"=",
"$",
"this",
"->",
"getDiffList",
"(",
"$",
"this",
"->",
"owner",
"->",
"Version",
",",
"1",
")",
";",
"if",
"(",
"$",
"changes",
"&&",
"$",
"changes",
"->",
"Count",
"(",
")",
... | Return a single diff representing this version.
Returns the initial version if there is nothing to compare to.
@return DataObject|null Object with relevant fields diffed. | [
"Return",
"a",
"single",
"diff",
"representing",
"this",
"version",
".",
"Returns",
"the",
"initial",
"version",
"if",
"there",
"is",
"nothing",
"to",
"compare",
"to",
"."
] | 831f03a2b85602c7a7fba110e0ef51c36ad4f204 | https://github.com/silverstripe/silverstripe-versionfeed/blob/831f03a2b85602c7a7fba110e0ef51c36ad4f204/src/VersionFeed.php#L161-L169 |
235,262 | aimeos/ai-admin-extadm | controller/extjs/src/Controller/ExtJS/Product/Import/Text/Standard.php | Standard.uploadFile | public function uploadFile( \stdClass $params )
{
$this->checkParams( $params, array( 'site' ) );
$this->setLocale( $params->site );
$clientFilename = '';
$context = $this->getContext();
$request = $context->getView()->request();
$dest = $this->storeFile( $request, $clientFilename );
$result = (object... | php | public function uploadFile( \stdClass $params )
{
$this->checkParams( $params, array( 'site' ) );
$this->setLocale( $params->site );
$clientFilename = '';
$context = $this->getContext();
$request = $context->getView()->request();
$dest = $this->storeFile( $request, $clientFilename );
$result = (object... | [
"public",
"function",
"uploadFile",
"(",
"\\",
"stdClass",
"$",
"params",
")",
"{",
"$",
"this",
"->",
"checkParams",
"(",
"$",
"params",
",",
"array",
"(",
"'site'",
")",
")",
";",
"$",
"this",
"->",
"setLocale",
"(",
"$",
"params",
"->",
"site",
")... | Uploads a CSV file with all product texts.
@param \stdClass $params Object containing the properties | [
"Uploads",
"a",
"CSV",
"file",
"with",
"all",
"product",
"texts",
"."
] | 594ee7cec90fd63a4773c05c93f353e66d9b3408 | https://github.com/aimeos/ai-admin-extadm/blob/594ee7cec90fd63a4773c05c93f353e66d9b3408/controller/extjs/src/Controller/ExtJS/Product/Import/Text/Standard.php#L42-L75 |
235,263 | aimeos/ai-admin-extadm | controller/extjs/src/Controller/ExtJS/Product/Import/Text/Standard.php | Standard.importFile | public function importFile( \stdClass $params )
{
$this->checkParams( $params, array( 'site', 'items' ) );
$this->setLocale( $params->site );
$fs = $this->getContext()->getFilesystemManager()->get( 'fs-admin' );
$items = ( !is_array( $params->items ) ? array( $params->items ) : $params->items );
foreach( $... | php | public function importFile( \stdClass $params )
{
$this->checkParams( $params, array( 'site', 'items' ) );
$this->setLocale( $params->site );
$fs = $this->getContext()->getFilesystemManager()->get( 'fs-admin' );
$items = ( !is_array( $params->items ) ? array( $params->items ) : $params->items );
foreach( $... | [
"public",
"function",
"importFile",
"(",
"\\",
"stdClass",
"$",
"params",
")",
"{",
"$",
"this",
"->",
"checkParams",
"(",
"$",
"params",
",",
"array",
"(",
"'site'",
",",
"'items'",
")",
")",
";",
"$",
"this",
"->",
"setLocale",
"(",
"$",
"params",
... | Imports a CSV file with all product texts.
@param \stdClass $params Object containing the properties | [
"Imports",
"a",
"CSV",
"file",
"with",
"all",
"product",
"texts",
"."
] | 594ee7cec90fd63a4773c05c93f353e66d9b3408 | https://github.com/aimeos/ai-admin-extadm/blob/594ee7cec90fd63a4773c05c93f353e66d9b3408/controller/extjs/src/Controller/ExtJS/Product/Import/Text/Standard.php#L83-L176 |
235,264 | artkonekt/gears | src/Backend/Drivers/CachedDatabase.php | CachedDatabase.pkey | protected function pkey(string $key, $userId): string
{
return sprintf('%s(%s).%s', self::PREFERENCES_KEY_PREFIX, $userId, $key);
} | php | protected function pkey(string $key, $userId): string
{
return sprintf('%s(%s).%s', self::PREFERENCES_KEY_PREFIX, $userId, $key);
} | [
"protected",
"function",
"pkey",
"(",
"string",
"$",
"key",
",",
"$",
"userId",
")",
":",
"string",
"{",
"return",
"sprintf",
"(",
"'%s(%s).%s'",
",",
"self",
"::",
"PREFERENCES_KEY_PREFIX",
",",
"$",
"userId",
",",
"$",
"key",
")",
";",
"}"
] | Returns the cache key for a preference for user
@param string $key
@param int $userId
@return string | [
"Returns",
"the",
"cache",
"key",
"for",
"a",
"preference",
"for",
"user"
] | 6c006a3e8e334d8100aab768a2a5e807bcac5695 | https://github.com/artkonekt/gears/blob/6c006a3e8e334d8100aab768a2a5e807bcac5695/src/Backend/Drivers/CachedDatabase.php#L168-L171 |
235,265 | artkonekt/gears | src/Backend/Drivers/CachedDatabase.php | CachedDatabase.sforget | protected function sforget($key)
{
$keys = is_array($key) ? $key : [$key];
foreach ($keys as $key) {
$this->cache->forget($this->skey($key));
}
$this->cache->forget($this->skey('*'));
} | php | protected function sforget($key)
{
$keys = is_array($key) ? $key : [$key];
foreach ($keys as $key) {
$this->cache->forget($this->skey($key));
}
$this->cache->forget($this->skey('*'));
} | [
"protected",
"function",
"sforget",
"(",
"$",
"key",
")",
"{",
"$",
"keys",
"=",
"is_array",
"(",
"$",
"key",
")",
"?",
"$",
"key",
":",
"[",
"$",
"key",
"]",
";",
"foreach",
"(",
"$",
"keys",
"as",
"$",
"key",
")",
"{",
"$",
"this",
"->",
"c... | Removes a setting from the cache by its key
@param string|array $key One or more keys | [
"Removes",
"a",
"setting",
"from",
"the",
"cache",
"by",
"its",
"key"
] | 6c006a3e8e334d8100aab768a2a5e807bcac5695 | https://github.com/artkonekt/gears/blob/6c006a3e8e334d8100aab768a2a5e807bcac5695/src/Backend/Drivers/CachedDatabase.php#L178-L187 |
235,266 | artkonekt/gears | src/Backend/Drivers/CachedDatabase.php | CachedDatabase.pforget | protected function pforget($key, $userId)
{
$keys = is_array($key) ? $key : [$key];
foreach ($keys as $key) {
$this->cache->forget($this->pkey($key, $userId));
}
$this->cache->forget($this->pkey('*', $userId));
} | php | protected function pforget($key, $userId)
{
$keys = is_array($key) ? $key : [$key];
foreach ($keys as $key) {
$this->cache->forget($this->pkey($key, $userId));
}
$this->cache->forget($this->pkey('*', $userId));
} | [
"protected",
"function",
"pforget",
"(",
"$",
"key",
",",
"$",
"userId",
")",
"{",
"$",
"keys",
"=",
"is_array",
"(",
"$",
"key",
")",
"?",
"$",
"key",
":",
"[",
"$",
"key",
"]",
";",
"foreach",
"(",
"$",
"keys",
"as",
"$",
"key",
")",
"{",
"... | Removes a preference from the cache by key and user
@param string|array $key One or more keys
@param int $userId | [
"Removes",
"a",
"preference",
"from",
"the",
"cache",
"by",
"key",
"and",
"user"
] | 6c006a3e8e334d8100aab768a2a5e807bcac5695 | https://github.com/artkonekt/gears/blob/6c006a3e8e334d8100aab768a2a5e807bcac5695/src/Backend/Drivers/CachedDatabase.php#L195-L204 |
235,267 | ZimTis/array-validation | src/ValidationBuilder.php | ValidationBuilder.buildValidation | public static function buildValidation(array $schema, $name = null)
{
$validation = new NestedValidation($name);
foreach ($schema as $key => $value) {
if (!is_array($value)) {
trigger_error('parsing error', E_USER_ERROR);
}
if (self::i... | php | public static function buildValidation(array $schema, $name = null)
{
$validation = new NestedValidation($name);
foreach ($schema as $key => $value) {
if (!is_array($value)) {
trigger_error('parsing error', E_USER_ERROR);
}
if (self::i... | [
"public",
"static",
"function",
"buildValidation",
"(",
"array",
"$",
"schema",
",",
"$",
"name",
"=",
"null",
")",
"{",
"$",
"validation",
"=",
"new",
"NestedValidation",
"(",
"$",
"name",
")",
";",
"foreach",
"(",
"$",
"schema",
"as",
"$",
"key",
"=>... | This function builds a validation acording to the specifgications of the json file
@param array $schema
@param null $name
@return NestedValidation | [
"This",
"function",
"builds",
"a",
"validation",
"acording",
"to",
"the",
"specifgications",
"of",
"the",
"json",
"file"
] | e908e9598d806e7e5a8da5d46480137c474f93fb | https://github.com/ZimTis/array-validation/blob/e908e9598d806e7e5a8da5d46480137c474f93fb/src/ValidationBuilder.php#L29-L47 |
235,268 | ZimTis/array-validation | src/ValidationBuilder.php | ValidationBuilder.isNestedValidation | private static function isNestedValidation(array $value)
{
return !(key_exists(Properties::TYPE, $value) && !is_array($value[Properties::TYPE]));
} | php | private static function isNestedValidation(array $value)
{
return !(key_exists(Properties::TYPE, $value) && !is_array($value[Properties::TYPE]));
} | [
"private",
"static",
"function",
"isNestedValidation",
"(",
"array",
"$",
"value",
")",
"{",
"return",
"!",
"(",
"key_exists",
"(",
"Properties",
"::",
"TYPE",
",",
"$",
"value",
")",
"&&",
"!",
"is_array",
"(",
"$",
"value",
"[",
"Properties",
"::",
"TY... | Check if the found value is a nestedValidation
@param array $value
@return boolean
@see NestedValidation | [
"Check",
"if",
"the",
"found",
"value",
"is",
"a",
"nestedValidation"
] | e908e9598d806e7e5a8da5d46480137c474f93fb | https://github.com/ZimTis/array-validation/blob/e908e9598d806e7e5a8da5d46480137c474f93fb/src/ValidationBuilder.php#L57-L60 |
235,269 | ZimTis/array-validation | src/ValidationBuilder.php | ValidationBuilder.buildKeyValidation | public static function buildKeyValidation(array $options, $name)
{
if (!key_exists(Properties::TYPE, $options)) {
trigger_error($name . ' must have a type');
}
switch ($options[Properties::TYPE]) {
case Types::STR:
case Types::STRING:
... | php | public static function buildKeyValidation(array $options, $name)
{
if (!key_exists(Properties::TYPE, $options)) {
trigger_error($name . ' must have a type');
}
switch ($options[Properties::TYPE]) {
case Types::STR:
case Types::STRING:
... | [
"public",
"static",
"function",
"buildKeyValidation",
"(",
"array",
"$",
"options",
",",
"$",
"name",
")",
"{",
"if",
"(",
"!",
"key_exists",
"(",
"Properties",
"::",
"TYPE",
",",
"$",
"options",
")",
")",
"{",
"trigger_error",
"(",
"$",
"name",
".",
"... | Builds a KeyValidation
@param array $options
@param string $name
@return \zimtis\arrayvalidation\validations\KeyValidation | [
"Builds",
"a",
"KeyValidation"
] | e908e9598d806e7e5a8da5d46480137c474f93fb | https://github.com/ZimTis/array-validation/blob/e908e9598d806e7e5a8da5d46480137c474f93fb/src/ValidationBuilder.php#L70-L92 |
235,270 | sellerlabs/nucleus | src/SellerLabs/Nucleus/Support/Html.php | Html.escape | public static function escape($string)
{
Arguments::define(
Boa::either(
Boa::either(
Boa::instance(SafeHtmlWrapper::class),
Boa::instance(SafeHtmlProducerInterface::class)
),
Boa::string()
)
... | php | public static function escape($string)
{
Arguments::define(
Boa::either(
Boa::either(
Boa::instance(SafeHtmlWrapper::class),
Boa::instance(SafeHtmlProducerInterface::class)
),
Boa::string()
)
... | [
"public",
"static",
"function",
"escape",
"(",
"$",
"string",
")",
"{",
"Arguments",
"::",
"define",
"(",
"Boa",
"::",
"either",
"(",
"Boa",
"::",
"either",
"(",
"Boa",
"::",
"instance",
"(",
"SafeHtmlWrapper",
"::",
"class",
")",
",",
"Boa",
"::",
"in... | Escape the provided string.
@param SafeHtmlWrapper|SafeHtmlProducerInterface|string $string
@throws CoreException
@throws InvalidArgumentException
@return SafeHtmlWrapper|string | [
"Escape",
"the",
"provided",
"string",
"."
] | c05d9c23d424a6bd5ab2e29140805cc6e37e4623 | https://github.com/sellerlabs/nucleus/blob/c05d9c23d424a6bd5ab2e29140805cc6e37e4623/src/SellerLabs/Nucleus/Support/Html.php#L42-L73 |
235,271 | clacy-builders/calendar-php | src/DateTime.php | DateTime.forceWorkday | public function forceWorkday($next = false)
{
$weekday = $this->format('N');
if ($weekday == 7) $this->addDays(1);
elseif ($weekday == 6) $next ? $this->addDays(2) : $this->addDays(-1);
return $this;
} | php | public function forceWorkday($next = false)
{
$weekday = $this->format('N');
if ($weekday == 7) $this->addDays(1);
elseif ($weekday == 6) $next ? $this->addDays(2) : $this->addDays(-1);
return $this;
} | [
"public",
"function",
"forceWorkday",
"(",
"$",
"next",
"=",
"false",
")",
"{",
"$",
"weekday",
"=",
"$",
"this",
"->",
"format",
"(",
"'N'",
")",
";",
"if",
"(",
"$",
"weekday",
"==",
"7",
")",
"$",
"this",
"->",
"addDays",
"(",
"1",
")",
";",
... | Sets the current date to the nearest or next workday.
Sunday always becomes monday.
@param string $next if <code>true</code> saturday becomes monday, otherwise friday.
@return DateTime | [
"Sets",
"the",
"current",
"date",
"to",
"the",
"nearest",
"or",
"next",
"workday",
"."
] | 9e868c4fa37f6c81da0e7444a8e0da25cc6c9051 | https://github.com/clacy-builders/calendar-php/blob/9e868c4fa37f6c81da0e7444a8e0da25cc6c9051/src/DateTime.php#L50-L56 |
235,272 | clacy-builders/calendar-php | src/DateTime.php | DateTime.formatLocalized | public function formatLocalized($format, $encoding = 'UTF-8')
{
$str = strftime($format, $this->getTimestamp());
if ($encoding == 'UTF-8') {
$str = utf8_encode($str);
}
return $str;
} | php | public function formatLocalized($format, $encoding = 'UTF-8')
{
$str = strftime($format, $this->getTimestamp());
if ($encoding == 'UTF-8') {
$str = utf8_encode($str);
}
return $str;
} | [
"public",
"function",
"formatLocalized",
"(",
"$",
"format",
",",
"$",
"encoding",
"=",
"'UTF-8'",
")",
"{",
"$",
"str",
"=",
"strftime",
"(",
"$",
"format",
",",
"$",
"this",
"->",
"getTimestamp",
"(",
")",
")",
";",
"if",
"(",
"$",
"encoding",
"=="... | Returns a string representation according to locale settings.
@link http://php.net/manual/en/function.strftime.php
@link http://php.net/manual/en/class.datetime.php
@param string $format A format string containing specifiers like <code>%a</code>,
<code>%B</code> etc.
@param string $encoding For example 'UTF-8... | [
"Returns",
"a",
"string",
"representation",
"according",
"to",
"locale",
"settings",
"."
] | 9e868c4fa37f6c81da0e7444a8e0da25cc6c9051 | https://github.com/clacy-builders/calendar-php/blob/9e868c4fa37f6c81da0e7444a8e0da25cc6c9051/src/DateTime.php#L69-L76 |
235,273 | wasabi-cms/cms | src/Model/Table/MenusTable.php | MenusTable.getLinkTypes | public function getLinkTypes()
{
$event = new Event('Wasabi.Backend.MenuItems.getLinkTypes', $this);
EventManager::instance()->dispatch($event);
$typeExternal = ['type' => 'external'];
$typeCustom = ['type' => 'custom'];
$event->result[__d('wasabi_core', 'General')] = [
... | php | public function getLinkTypes()
{
$event = new Event('Wasabi.Backend.MenuItems.getLinkTypes', $this);
EventManager::instance()->dispatch($event);
$typeExternal = ['type' => 'external'];
$typeCustom = ['type' => 'custom'];
$event->result[__d('wasabi_core', 'General')] = [
... | [
"public",
"function",
"getLinkTypes",
"(",
")",
"{",
"$",
"event",
"=",
"new",
"Event",
"(",
"'Wasabi.Backend.MenuItems.getLinkTypes'",
",",
"$",
"this",
")",
";",
"EventManager",
"::",
"instance",
"(",
")",
"->",
"dispatch",
"(",
"$",
"event",
")",
";",
"... | Get available link types via an Event trigger
This fetches avilable Links from all activated Plugins.
@return array | [
"Get",
"available",
"link",
"types",
"via",
"an",
"Event",
"trigger",
"This",
"fetches",
"avilable",
"Links",
"from",
"all",
"activated",
"Plugins",
"."
] | 2787b6422ea1d719cf49951b3253fd0ac31d22ca | https://github.com/wasabi-cms/cms/blob/2787b6422ea1d719cf49951b3253fd0ac31d22ca/src/Model/Table/MenusTable.php#L75-L89 |
235,274 | squire-assistant/dependency-injection | Definition.php | Definition.replaceArgument | public function replaceArgument($index, $argument)
{
if (0 === count($this->arguments)) {
throw new OutOfBoundsException('Cannot replace arguments if none have been configured yet.');
}
if ($index < 0 || $index > count($this->arguments) - 1) {
throw new OutOfBoundsEx... | php | public function replaceArgument($index, $argument)
{
if (0 === count($this->arguments)) {
throw new OutOfBoundsException('Cannot replace arguments if none have been configured yet.');
}
if ($index < 0 || $index > count($this->arguments) - 1) {
throw new OutOfBoundsEx... | [
"public",
"function",
"replaceArgument",
"(",
"$",
"index",
",",
"$",
"argument",
")",
"{",
"if",
"(",
"0",
"===",
"count",
"(",
"$",
"this",
"->",
"arguments",
")",
")",
"{",
"throw",
"new",
"OutOfBoundsException",
"(",
"'Cannot replace arguments if none have... | Sets a specific argument.
@param int $index
@param mixed $argument
@return $this
@throws OutOfBoundsException When the replaced argument does not exist | [
"Sets",
"a",
"specific",
"argument",
"."
] | c61d77bf8814369344fd71b015d7238322126041 | https://github.com/squire-assistant/dependency-injection/blob/c61d77bf8814369344fd71b015d7238322126041/Definition.php#L199-L212 |
235,275 | jaredtking/jaqb | src/Statement/LimitStatement.php | LimitStatement.getLimit | public function getLimit()
{
if ($this->max > 0) {
return min($this->max, $this->limit);
}
return $this->limit;
} | php | public function getLimit()
{
if ($this->max > 0) {
return min($this->max, $this->limit);
}
return $this->limit;
} | [
"public",
"function",
"getLimit",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"max",
">",
"0",
")",
"{",
"return",
"min",
"(",
"$",
"this",
"->",
"max",
",",
"$",
"this",
"->",
"limit",
")",
";",
"}",
"return",
"$",
"this",
"->",
"limit",
";",... | Gets the limit.
@return int | [
"Gets",
"the",
"limit",
"."
] | 04a853b530fcc12a9863349d3d0da6377d1b9995 | https://github.com/jaredtking/jaqb/blob/04a853b530fcc12a9863349d3d0da6377d1b9995/src/Statement/LimitStatement.php#L72-L79 |
235,276 | marando/phpSOFA | src/Marando/IAU/iauTaiut1.php | iauTaiut1.Taiut1 | public static function Taiut1($tai1, $tai2, $dta, &$ut11, &$ut12) {
$dtad;
/* Result, safeguarding precision. */
$dtad = $dta / DAYSEC;
if ($tai1 > $tai2) {
$ut11 = $tai1;
$ut12 = $tai2 + $dtad;
}
else {
$ut11 = $tai1 + $dtad;
$ut12 = $tai2;
}
/* Status (always ... | php | public static function Taiut1($tai1, $tai2, $dta, &$ut11, &$ut12) {
$dtad;
/* Result, safeguarding precision. */
$dtad = $dta / DAYSEC;
if ($tai1 > $tai2) {
$ut11 = $tai1;
$ut12 = $tai2 + $dtad;
}
else {
$ut11 = $tai1 + $dtad;
$ut12 = $tai2;
}
/* Status (always ... | [
"public",
"static",
"function",
"Taiut1",
"(",
"$",
"tai1",
",",
"$",
"tai2",
",",
"$",
"dta",
",",
"&",
"$",
"ut11",
",",
"&",
"$",
"ut12",
")",
"{",
"$",
"dtad",
";",
"/* Result, safeguarding precision. */",
"$",
"dtad",
"=",
"$",
"dta",
"/",
"DAYS... | - - - - - - - - - -
i a u T a i u t 1
- - - - - - - - - -
Time scale transformation: International Atomic Time, TAI, to
Universal Time, UT1.
This function is part of the International Astronomical Union's
SOFA (Standards of Fundamental Astronomy) software collection.
Status: canonical.
Given:
tai1,tai2 double ... | [
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"i",
"a",
"u",
"T",
"a",
"i",
"u",
"t",
"1",
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"-"
] | 757fa49fe335ae1210eaa7735473fd4388b13f07 | https://github.com/marando/phpSOFA/blob/757fa49fe335ae1210eaa7735473fd4388b13f07/src/Marando/IAU/iauTaiut1.php#L52-L68 |
235,277 | 10usb/css-lib | src/query/Specificity.php | Specificity.compare | public static function compare($left, $right){
if($left->a != $right->a) return $left->a <=> $right->a;
if($left->b != $right->b) return $left->b <=> $right->b;
if($left->c != $right->c) return $left->c <=> $right->c;
if($left->i < 0 || $right->i < 0) return 0;
return $left->i <=> $right->i;
} | php | public static function compare($left, $right){
if($left->a != $right->a) return $left->a <=> $right->a;
if($left->b != $right->b) return $left->b <=> $right->b;
if($left->c != $right->c) return $left->c <=> $right->c;
if($left->i < 0 || $right->i < 0) return 0;
return $left->i <=> $right->i;
} | [
"public",
"static",
"function",
"compare",
"(",
"$",
"left",
",",
"$",
"right",
")",
"{",
"if",
"(",
"$",
"left",
"->",
"a",
"!=",
"$",
"right",
"->",
"a",
")",
"return",
"$",
"left",
"->",
"a",
"<=>",
"$",
"right",
"->",
"a",
";",
"if",
"(",
... | Compares to specificities
@param \csslib\query\Specificity $left
@param \csslib\query\Specificity $right
@return integer | [
"Compares",
"to",
"specificities"
] | 6370b1404bae3eecb44c214ed4eaaf33113858dd | https://github.com/10usb/css-lib/blob/6370b1404bae3eecb44c214ed4eaaf33113858dd/src/query/Specificity.php#L40-L46 |
235,278 | 10usb/css-lib | src/query/Specificity.php | Specificity.get | public static function get($selector){
$specificity = $selector->hasNext() ? self::get($selector->getNext()) : new self();
if($selector->getIdentification()) $specificity->a++;
if($selector->getClasses()) $specificity->b+= count($selector->getClasses());
if($selector->getAttributes()) $specificity->b+= count... | php | public static function get($selector){
$specificity = $selector->hasNext() ? self::get($selector->getNext()) : new self();
if($selector->getIdentification()) $specificity->a++;
if($selector->getClasses()) $specificity->b+= count($selector->getClasses());
if($selector->getAttributes()) $specificity->b+= count... | [
"public",
"static",
"function",
"get",
"(",
"$",
"selector",
")",
"{",
"$",
"specificity",
"=",
"$",
"selector",
"->",
"hasNext",
"(",
")",
"?",
"self",
"::",
"get",
"(",
"$",
"selector",
"->",
"getNext",
"(",
")",
")",
":",
"new",
"self",
"(",
")"... | Calculated the specificity of a selector
@param \csslib\Selector $selector
@return \csslib\query\Specificity | [
"Calculated",
"the",
"specificity",
"of",
"a",
"selector"
] | 6370b1404bae3eecb44c214ed4eaaf33113858dd | https://github.com/10usb/css-lib/blob/6370b1404bae3eecb44c214ed4eaaf33113858dd/src/query/Specificity.php#L53-L63 |
235,279 | EcomDev/phpspec-file-matcher | src/MatchLexer.php | MatchLexer.supports | public function supports($phrase, array $arguments)
{
if (!isset($this->forms[$phrase])) {
return false;
}
$argumentMatch = $this->forms[$phrase];
if ($this->validateNoArgumentsCondition($arguments, $argumentMatch)
|| $this->validateStrictArgumentCountCondit... | php | public function supports($phrase, array $arguments)
{
if (!isset($this->forms[$phrase])) {
return false;
}
$argumentMatch = $this->forms[$phrase];
if ($this->validateNoArgumentsCondition($arguments, $argumentMatch)
|| $this->validateStrictArgumentCountCondit... | [
"public",
"function",
"supports",
"(",
"$",
"phrase",
",",
"array",
"$",
"arguments",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"forms",
"[",
"$",
"phrase",
"]",
")",
")",
"{",
"return",
"false",
";",
"}",
"$",
"argumentMatch",
"="... | Validates matcher condition based on specified rules
@param string $phrase
@param mixed[] $arguments
@return bool | [
"Validates",
"matcher",
"condition",
"based",
"on",
"specified",
"rules"
] | 5323bf833774c3d9d763bc01cdc7354a2985b47c | https://github.com/EcomDev/phpspec-file-matcher/blob/5323bf833774c3d9d763bc01cdc7354a2985b47c/src/MatchLexer.php#L46-L60 |
235,280 | sasedev/extra-tools-bundle | src/Sasedev/ExtraToolsBundle/Command/UpdateTransCommand.php | UpdateTransCommand._crawlNode | private function _crawlNode(\Twig_Node $node)
{
if ($node instanceof TransNode && !$node->getNode('body') instanceof \Twig_Node_Expression_GetAttr) {
// trans block
$domain = $node->getNode('domain')->getAttribute('value');
$message = $node->getNode('body')->getAttribute('data');
$this->messages->set($me... | php | private function _crawlNode(\Twig_Node $node)
{
if ($node instanceof TransNode && !$node->getNode('body') instanceof \Twig_Node_Expression_GetAttr) {
// trans block
$domain = $node->getNode('domain')->getAttribute('value');
$message = $node->getNode('body')->getAttribute('data');
$this->messages->set($me... | [
"private",
"function",
"_crawlNode",
"(",
"\\",
"Twig_Node",
"$",
"node",
")",
"{",
"if",
"(",
"$",
"node",
"instanceof",
"TransNode",
"&&",
"!",
"$",
"node",
"->",
"getNode",
"(",
"'body'",
")",
"instanceof",
"\\",
"Twig_Node_Expression_GetAttr",
")",
"{",
... | Recursive function that extract trans message from a twig tree
@param
\Twig_Node The twig tree root | [
"Recursive",
"function",
"that",
"extract",
"trans",
"message",
"from",
"a",
"twig",
"tree"
] | 14037d6b5c8ba9520ffe33f26057e2e53bea7a75 | https://github.com/sasedev/extra-tools-bundle/blob/14037d6b5c8ba9520ffe33f26057e2e53bea7a75/src/Sasedev/ExtraToolsBundle/Command/UpdateTransCommand.php#L184-L206 |
235,281 | sasedev/extra-tools-bundle | src/Sasedev/ExtraToolsBundle/Command/UpdateTransCommand.php | UpdateTransCommand._extractMessage | private function _extractMessage(\Twig_Node $node)
{
if ($node->hasNode('node')) {
return $this->_extractMessage($node->getNode('node'));
}
if ($node instanceof \Twig_Node_Expression_Constant) {
return $node->getAttribute('value');
}
return null;
} | php | private function _extractMessage(\Twig_Node $node)
{
if ($node->hasNode('node')) {
return $this->_extractMessage($node->getNode('node'));
}
if ($node instanceof \Twig_Node_Expression_Constant) {
return $node->getAttribute('value');
}
return null;
} | [
"private",
"function",
"_extractMessage",
"(",
"\\",
"Twig_Node",
"$",
"node",
")",
"{",
"if",
"(",
"$",
"node",
"->",
"hasNode",
"(",
"'node'",
")",
")",
"{",
"return",
"$",
"this",
"->",
"_extractMessage",
"(",
"$",
"node",
"->",
"getNode",
"(",
"'no... | Extract a message from a \Twig_Node_Print
Return null if not a constant message
@param \Twig_Node $node | [
"Extract",
"a",
"message",
"from",
"a",
"\\",
"Twig_Node_Print",
"Return",
"null",
"if",
"not",
"a",
"constant",
"message"
] | 14037d6b5c8ba9520ffe33f26057e2e53bea7a75 | https://github.com/sasedev/extra-tools-bundle/blob/14037d6b5c8ba9520ffe33f26057e2e53bea7a75/src/Sasedev/ExtraToolsBundle/Command/UpdateTransCommand.php#L214-L224 |
235,282 | sasedev/extra-tools-bundle | src/Sasedev/ExtraToolsBundle/Command/UpdateTransCommand.php | UpdateTransCommand._extractDomain | private function _extractDomain(\Twig_Node $node)
{
// must be a filter node
if (!$node instanceof \Twig_Node_Expression_Filter) {
return null;
}
// is a trans filter
if ($node->getNode('filter')->getAttribute('value') == 'trans') {
if ($node->getNode('arguments')->hasNode(1)) {
return $node->getNo... | php | private function _extractDomain(\Twig_Node $node)
{
// must be a filter node
if (!$node instanceof \Twig_Node_Expression_Filter) {
return null;
}
// is a trans filter
if ($node->getNode('filter')->getAttribute('value') == 'trans') {
if ($node->getNode('arguments')->hasNode(1)) {
return $node->getNo... | [
"private",
"function",
"_extractDomain",
"(",
"\\",
"Twig_Node",
"$",
"node",
")",
"{",
"// must be a filter node",
"if",
"(",
"!",
"$",
"node",
"instanceof",
"\\",
"Twig_Node_Expression_Filter",
")",
"{",
"return",
"null",
";",
"}",
"// is a trans filter",
"if",
... | Extract a domain from a \Twig_Node_Print
Return null if no trans filter
@param \Twig_Node $node | [
"Extract",
"a",
"domain",
"from",
"a",
"\\",
"Twig_Node_Print",
"Return",
"null",
"if",
"no",
"trans",
"filter"
] | 14037d6b5c8ba9520ffe33f26057e2e53bea7a75 | https://github.com/sasedev/extra-tools-bundle/blob/14037d6b5c8ba9520ffe33f26057e2e53bea7a75/src/Sasedev/ExtraToolsBundle/Command/UpdateTransCommand.php#L232-L250 |
235,283 | makinacorpus/drupal-udate | lib/Udate/CalendarEntityRowPlugin.php | Udate_CalendarEntityRowPlugin.preloadEntities | protected function preloadEntities($values)
{
$ids = array();
foreach ($values as $row) {
$id = $row->{$this->field_alias};
if ($this->view->base_table == 'node_revision') {
$this->entities[$id] = node_load(NULL, $id);
} else {
$i... | php | protected function preloadEntities($values)
{
$ids = array();
foreach ($values as $row) {
$id = $row->{$this->field_alias};
if ($this->view->base_table == 'node_revision') {
$this->entities[$id] = node_load(NULL, $id);
} else {
$i... | [
"protected",
"function",
"preloadEntities",
"(",
"$",
"values",
")",
"{",
"$",
"ids",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"values",
"as",
"$",
"row",
")",
"{",
"$",
"id",
"=",
"$",
"row",
"->",
"{",
"$",
"this",
"->",
"field_alias",
... | This actually was a good idea | [
"This",
"actually",
"was",
"a",
"good",
"idea"
] | 75f296acd7ba230b2d0a28c1fb906f4f1da863cf | https://github.com/makinacorpus/drupal-udate/blob/75f296acd7ba230b2d0a28c1fb906f4f1da863cf/lib/Udate/CalendarEntityRowPlugin.php#L16-L36 |
235,284 | encorephp/view-controller | src/View/Style/StyleCollection.php | StyleCollection.addById | public function addById($id, array $styles)
{
$this->ids[$id] = array_merge_recursive($this->getById($id), $styles);
} | php | public function addById($id, array $styles)
{
$this->ids[$id] = array_merge_recursive($this->getById($id), $styles);
} | [
"public",
"function",
"addById",
"(",
"$",
"id",
",",
"array",
"$",
"styles",
")",
"{",
"$",
"this",
"->",
"ids",
"[",
"$",
"id",
"]",
"=",
"array_merge_recursive",
"(",
"$",
"this",
"->",
"getById",
"(",
"$",
"id",
")",
",",
"$",
"styles",
")",
... | Add a style by ID
@param string $id
@param array $styles [description] | [
"Add",
"a",
"style",
"by",
"ID"
] | 38335ee5c175364ea49bc378c141aabfe9fa3def | https://github.com/encorephp/view-controller/blob/38335ee5c175364ea49bc378c141aabfe9fa3def/src/View/Style/StyleCollection.php#L40-L43 |
235,285 | encorephp/view-controller | src/View/Style/StyleCollection.php | StyleCollection.addByElement | public function addByElement($element, array $styles)
{
$this->elements[$element] = array_merge_recursive($this->getByElement($element), $styles);
} | php | public function addByElement($element, array $styles)
{
$this->elements[$element] = array_merge_recursive($this->getByElement($element), $styles);
} | [
"public",
"function",
"addByElement",
"(",
"$",
"element",
",",
"array",
"$",
"styles",
")",
"{",
"$",
"this",
"->",
"elements",
"[",
"$",
"element",
"]",
"=",
"array_merge_recursive",
"(",
"$",
"this",
"->",
"getByElement",
"(",
"$",
"element",
")",
","... | Add style by element name
@param string $element
@param array $styles | [
"Add",
"style",
"by",
"element",
"name"
] | 38335ee5c175364ea49bc378c141aabfe9fa3def | https://github.com/encorephp/view-controller/blob/38335ee5c175364ea49bc378c141aabfe9fa3def/src/View/Style/StyleCollection.php#L64-L67 |
235,286 | znframework/package-console | Upgrade.php | Upgrade.fe | protected static function fe()
{
if( ! empty(ZN::upgrade()) )
{
$status = self::$lang['upgradeSuccess'];
}
else
{
$status = self::$lang['alreadyVersion'];
if( $upgradeError = ZN::upgradeError() )
{
$status = $up... | php | protected static function fe()
{
if( ! empty(ZN::upgrade()) )
{
$status = self::$lang['upgradeSuccess'];
}
else
{
$status = self::$lang['alreadyVersion'];
if( $upgradeError = ZN::upgradeError() )
{
$status = $up... | [
"protected",
"static",
"function",
"fe",
"(",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"ZN",
"::",
"upgrade",
"(",
")",
")",
")",
"{",
"$",
"status",
"=",
"self",
"::",
"$",
"lang",
"[",
"'upgradeSuccess'",
"]",
";",
"}",
"else",
"{",
"$",
"status... | Protected upgrade FE | [
"Protected",
"upgrade",
"FE"
] | fde428da8b9d926ea4256c235f542e6225c5d788 | https://github.com/znframework/package-console/blob/fde428da8b9d926ea4256c235f542e6225c5d788/Upgrade.php#L59-L76 |
235,287 | znframework/package-console | Upgrade.php | Upgrade.eip | protected static function eip($tag = 'znframework')
{
if( $return = Restful::useragent(true)->get('https://api.github.com/repos/znframework/'.$tag.'/tags') )
{
if( ! isset($return->message) )
{
usort($return, function($data1, $data2){ return strcmp($data1->nam... | php | protected static function eip($tag = 'znframework')
{
if( $return = Restful::useragent(true)->get('https://api.github.com/repos/znframework/'.$tag.'/tags') )
{
if( ! isset($return->message) )
{
usort($return, function($data1, $data2){ return strcmp($data1->nam... | [
"protected",
"static",
"function",
"eip",
"(",
"$",
"tag",
"=",
"'znframework'",
")",
"{",
"if",
"(",
"$",
"return",
"=",
"Restful",
"::",
"useragent",
"(",
"true",
")",
"->",
"get",
"(",
"'https://api.github.com/repos/znframework/'",
".",
"$",
"tag",
".",
... | Proteted upgrade EIP | [
"Proteted",
"upgrade",
"EIP"
] | fde428da8b9d926ea4256c235f542e6225c5d788 | https://github.com/znframework/package-console/blob/fde428da8b9d926ea4256c235f542e6225c5d788/Upgrade.php#L81-L124 |
235,288 | jivoo/http | src/Message/Response.php | Response.cached | public function cached($public = true, $expires = '+1 year')
{
if (!is_int($expires)) {
$expires = strtotime($expires);
}
$maxAge = $expires - time();
$pragma = $public ? 'public' : 'private';
$cache = $pragma . ', max-age=' . $maxAge;
$response = clone $t... | php | public function cached($public = true, $expires = '+1 year')
{
if (!is_int($expires)) {
$expires = strtotime($expires);
}
$maxAge = $expires - time();
$pragma = $public ? 'public' : 'private';
$cache = $pragma . ', max-age=' . $maxAge;
$response = clone $t... | [
"public",
"function",
"cached",
"(",
"$",
"public",
"=",
"true",
",",
"$",
"expires",
"=",
"'+1 year'",
")",
"{",
"if",
"(",
"!",
"is_int",
"(",
"$",
"expires",
")",
")",
"{",
"$",
"expires",
"=",
"strtotime",
"(",
"$",
"expires",
")",
";",
"}",
... | Set cache settings.
@param string $public Public or private.
@param int|string $expires Time on which cache expires. Can be a UNIX
timestamp or a string used with {@see strtotime()}. | [
"Set",
"cache",
"settings",
"."
] | 3c1d8dba66978bc91fc2b324dd941e5da3b253bc | https://github.com/jivoo/http/blob/3c1d8dba66978bc91fc2b324dd941e5da3b253bc/src/Message/Response.php#L77-L90 |
235,289 | jivoo/http | src/Message/Response.php | Response.file | public static function file($path, $type = null)
{
$response = new self(
Status::OK,
new PhpStream($path, 'rb')
);
if (isset($type)) {
$response->setHeader('Content-Type', $type);
}
return $response;
} | php | public static function file($path, $type = null)
{
$response = new self(
Status::OK,
new PhpStream($path, 'rb')
);
if (isset($type)) {
$response->setHeader('Content-Type', $type);
}
return $response;
} | [
"public",
"static",
"function",
"file",
"(",
"$",
"path",
",",
"$",
"type",
"=",
"null",
")",
"{",
"$",
"response",
"=",
"new",
"self",
"(",
"Status",
"::",
"OK",
",",
"new",
"PhpStream",
"(",
"$",
"path",
",",
"'rb'",
")",
")",
";",
"if",
"(",
... | Create a file response.
@param string $path Path to file.
@param string|null $type Optional MIME type.
@return self The response. | [
"Create",
"a",
"file",
"response",
"."
] | 3c1d8dba66978bc91fc2b324dd941e5da3b253bc | https://github.com/jivoo/http/blob/3c1d8dba66978bc91fc2b324dd941e5da3b253bc/src/Message/Response.php#L116-L126 |
235,290 | nonetallt/jinitialize-core | src/JinitializeApplication.php | JinitializeApplication.registerPlugin | public function registerPlugin(array $plugin)
{
/* Dont't process nameless plugins */
if(! isset($plugin['name'])) return;
/* Create a container for the plugin */
$this->getContainer()->addPlugin($plugin['name']);
/* Commands are registered first so they can be found be por... | php | public function registerPlugin(array $plugin)
{
/* Dont't process nameless plugins */
if(! isset($plugin['name'])) return;
/* Create a container for the plugin */
$this->getContainer()->addPlugin($plugin['name']);
/* Commands are registered first so they can be found be por... | [
"public",
"function",
"registerPlugin",
"(",
"array",
"$",
"plugin",
")",
"{",
"/* Dont't process nameless plugins */",
"if",
"(",
"!",
"isset",
"(",
"$",
"plugin",
"[",
"'name'",
"]",
")",
")",
"return",
";",
"/* Create a container for the plugin */",
"$",
"this"... | Register a plugin found in manifest file
@param array $plugin
@return null | [
"Register",
"a",
"plugin",
"found",
"in",
"manifest",
"file"
] | 284fbd72b7c1d6f5f8f265dfe2589c0d99b6a88f | https://github.com/nonetallt/jinitialize-core/blob/284fbd72b7c1d6f5f8f265dfe2589c0d99b6a88f/src/JinitializeApplication.php#L61-L82 |
235,291 | nonetallt/jinitialize-core | src/JinitializeApplication.php | JinitializeApplication.registerProcedures | public function registerProcedures(string $plugin, array $procedures, string $path)
{
/* Append the installation path before the files */
array_walk($procedures, function(&$procedure) use ($path){
$procedure = "$path/$procedure";
});
/* Create a factory from list of path... | php | public function registerProcedures(string $plugin, array $procedures, string $path)
{
/* Append the installation path before the files */
array_walk($procedures, function(&$procedure) use ($path){
$procedure = "$path/$procedure";
});
/* Create a factory from list of path... | [
"public",
"function",
"registerProcedures",
"(",
"string",
"$",
"plugin",
",",
"array",
"$",
"procedures",
",",
"string",
"$",
"path",
")",
"{",
"/* Append the installation path before the files */",
"array_walk",
"(",
"$",
"procedures",
",",
"function",
"(",
"&",
... | Register all procedures for a given plugin | [
"Register",
"all",
"procedures",
"for",
"a",
"given",
"plugin"
] | 284fbd72b7c1d6f5f8f265dfe2589c0d99b6a88f | https://github.com/nonetallt/jinitialize-core/blob/284fbd72b7c1d6f5f8f265dfe2589c0d99b6a88f/src/JinitializeApplication.php#L87-L103 |
235,292 | nonetallt/jinitialize-core | src/JinitializeApplication.php | JinitializeApplication.registerCommands | public function registerCommands(string $plugin, array $commands)
{
$newCommands = [];
foreach($commands as $commandClass) {
$command = new $commandClass($plugin);
$command = CommandFactory::setNamespace($command);
$this->add($command);
$newCommands[]... | php | public function registerCommands(string $plugin, array $commands)
{
$newCommands = [];
foreach($commands as $commandClass) {
$command = new $commandClass($plugin);
$command = CommandFactory::setNamespace($command);
$this->add($command);
$newCommands[]... | [
"public",
"function",
"registerCommands",
"(",
"string",
"$",
"plugin",
",",
"array",
"$",
"commands",
")",
"{",
"$",
"newCommands",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"commands",
"as",
"$",
"commandClass",
")",
"{",
"$",
"command",
"=",
"new",
"... | Register all commands for a given plugin
@param string $plugin The plugin these commands will be registered for
@param array $commands array containing the classnames of the commands
@return array $newCommands array containing JinitializeCommand objects | [
"Register",
"all",
"commands",
"for",
"a",
"given",
"plugin"
] | 284fbd72b7c1d6f5f8f265dfe2589c0d99b6a88f | https://github.com/nonetallt/jinitialize-core/blob/284fbd72b7c1d6f5f8f265dfe2589c0d99b6a88f/src/JinitializeApplication.php#L114-L125 |
235,293 | nonetallt/jinitialize-core | src/JinitializeApplication.php | JinitializeApplication.missingSettings | public function missingSettings()
{
$missing = [];
foreach($this->recommendedSettings() as $plugin => $settings) {
foreach($settings as $setting) {
/* Get value for the setting */
$value = $_ENV[$setting] ?? null;
if(is_null($value)) $miss... | php | public function missingSettings()
{
$missing = [];
foreach($this->recommendedSettings() as $plugin => $settings) {
foreach($settings as $setting) {
/* Get value for the setting */
$value = $_ENV[$setting] ?? null;
if(is_null($value)) $miss... | [
"public",
"function",
"missingSettings",
"(",
")",
"{",
"$",
"missing",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"this",
"->",
"recommendedSettings",
"(",
")",
"as",
"$",
"plugin",
"=>",
"$",
"settings",
")",
"{",
"foreach",
"(",
"$",
"settings",
"as",... | Get an array of plugins and their settings that are not defined in env | [
"Get",
"an",
"array",
"of",
"plugins",
"and",
"their",
"settings",
"that",
"are",
"not",
"defined",
"in",
"env"
] | 284fbd72b7c1d6f5f8f265dfe2589c0d99b6a88f | https://github.com/nonetallt/jinitialize-core/blob/284fbd72b7c1d6f5f8f265dfe2589c0d99b6a88f/src/JinitializeApplication.php#L150-L162 |
235,294 | weew/console | src/Weew/Console/Output.php | Output.flushBuffer | public function flushBuffer() {
$content = $this->format($this->buffer->flush());
if ( ! $this->is(OutputVerbosity::SILENT)) {
fwrite($this->getOutputStream(), $content);
}
} | php | public function flushBuffer() {
$content = $this->format($this->buffer->flush());
if ( ! $this->is(OutputVerbosity::SILENT)) {
fwrite($this->getOutputStream(), $content);
}
} | [
"public",
"function",
"flushBuffer",
"(",
")",
"{",
"$",
"content",
"=",
"$",
"this",
"->",
"format",
"(",
"$",
"this",
"->",
"buffer",
"->",
"flush",
"(",
")",
")",
";",
"if",
"(",
"!",
"$",
"this",
"->",
"is",
"(",
"OutputVerbosity",
"::",
"SILEN... | Manually flush buffered output. | [
"Manually",
"flush",
"buffered",
"output",
"."
] | 083703f21fdeff3cfe6036ebd21ab9cb84ca74c7 | https://github.com/weew/console/blob/083703f21fdeff3cfe6036ebd21ab9cb84ca74c7/src/Weew/Console/Output.php#L219-L225 |
235,295 | ntentan/ajumamoro | src/Queue.php | Queue.add | public function add(Job $job)
{
$jobClass = new \ReflectionClass($job);
$name = $jobClass->getName();
$object = serialize($job);
$jobId = $this->broker->put(['object' => $object, 'class' => $name]);
$this->broker->setStatus($jobId,
['status' => Job::STATUS_QUEUED,... | php | public function add(Job $job)
{
$jobClass = new \ReflectionClass($job);
$name = $jobClass->getName();
$object = serialize($job);
$jobId = $this->broker->put(['object' => $object, 'class' => $name]);
$this->broker->setStatus($jobId,
['status' => Job::STATUS_QUEUED,... | [
"public",
"function",
"add",
"(",
"Job",
"$",
"job",
")",
"{",
"$",
"jobClass",
"=",
"new",
"\\",
"ReflectionClass",
"(",
"$",
"job",
")",
";",
"$",
"name",
"=",
"$",
"jobClass",
"->",
"getName",
"(",
")",
";",
"$",
"object",
"=",
"serialize",
"(",... | Add a job to the job queue.
@param Job $job
@return string | [
"Add",
"a",
"job",
"to",
"the",
"job",
"queue",
"."
] | 160c772c02e40e9656ab03acd1e9387aebce7219 | https://github.com/ntentan/ajumamoro/blob/160c772c02e40e9656ab03acd1e9387aebce7219/src/Queue.php#L27-L37 |
235,296 | robotdance/php-console | src/Console.php | Console.indent | public static function indent($str, $spaces = 4, $level = 1){
return str_repeat(" ", $spaces * $level)
. str_replace("\n", "\n" . str_repeat(" ", $spaces * $level), $str);
} | php | public static function indent($str, $spaces = 4, $level = 1){
return str_repeat(" ", $spaces * $level)
. str_replace("\n", "\n" . str_repeat(" ", $spaces * $level), $str);
} | [
"public",
"static",
"function",
"indent",
"(",
"$",
"str",
",",
"$",
"spaces",
"=",
"4",
",",
"$",
"level",
"=",
"1",
")",
"{",
"return",
"str_repeat",
"(",
"\" \"",
",",
"$",
"spaces",
"*",
"$",
"level",
")",
".",
"str_replace",
"(",
"\"\\n\"",
",... | Inserts N spaces to the left of a string
@param $str String
@param $spaces Number of spaces to insert
@param $level Indentation level (1, 2, 3, ...)
@return String with N spaces inserted | [
"Inserts",
"N",
"spaces",
"to",
"the",
"left",
"of",
"a",
"string"
] | 1bac28ed8868e5247040dec96e8b8df162fdaa07 | https://github.com/robotdance/php-console/blob/1bac28ed8868e5247040dec96e8b8df162fdaa07/src/Console.php#L165-L168 |
235,297 | robotdance/php-console | src/Console.php | Console.moveCursorRel | public function moveCursorRel($x, $y)
{
$yChar = ($y < 0) ? "A" : "B"; // up / down
$xChar = ($x < 0) ? "D" : "C"; // left / right
fwrite(STDOUT, "\e[" . abs($x) . $xChar);
fwrite(STDOUT, "\e[" . abs($y) . $yChar);
} | php | public function moveCursorRel($x, $y)
{
$yChar = ($y < 0) ? "A" : "B"; // up / down
$xChar = ($x < 0) ? "D" : "C"; // left / right
fwrite(STDOUT, "\e[" . abs($x) . $xChar);
fwrite(STDOUT, "\e[" . abs($y) . $yChar);
} | [
"public",
"function",
"moveCursorRel",
"(",
"$",
"x",
",",
"$",
"y",
")",
"{",
"$",
"yChar",
"=",
"(",
"$",
"y",
"<",
"0",
")",
"?",
"\"A\"",
":",
"\"B\"",
";",
"// up / down",
"$",
"xChar",
"=",
"(",
"$",
"x",
"<",
"0",
")",
"?",
"\"D\"",
":... | Moves cursor relatively to its current position
@param $x Positive value move to right, left otherwise
@param $y Positive value move to down, up otherwise | [
"Moves",
"cursor",
"relatively",
"to",
"its",
"current",
"position"
] | 1bac28ed8868e5247040dec96e8b8df162fdaa07 | https://github.com/robotdance/php-console/blob/1bac28ed8868e5247040dec96e8b8df162fdaa07/src/Console.php#L184-L190 |
235,298 | CampaignChain/channel-mailchimp | REST/MailChimpOAuth.php | Hybrid_Providers_MailChimp.getEndpoint | function getEndpoint()
{
$this->api->curl_header = array(
'Authorization: OAuth '.$this->api->access_token,
);
$data = $this->api->get( $this->metadata_url );
if ( ! isset( $data->api_endpoint ) ){
throw new Exception( "Endpoint request failed! {$this... | php | function getEndpoint()
{
$this->api->curl_header = array(
'Authorization: OAuth '.$this->api->access_token,
);
$data = $this->api->get( $this->metadata_url );
if ( ! isset( $data->api_endpoint ) ){
throw new Exception( "Endpoint request failed! {$this... | [
"function",
"getEndpoint",
"(",
")",
"{",
"$",
"this",
"->",
"api",
"->",
"curl_header",
"=",
"array",
"(",
"'Authorization: OAuth '",
".",
"$",
"this",
"->",
"api",
"->",
"access_token",
",",
")",
";",
"$",
"data",
"=",
"$",
"this",
"->",
"api",
"->",... | Load the metadata, which includes the URL of the API endpoint. | [
"Load",
"the",
"metadata",
"which",
"includes",
"the",
"URL",
"of",
"the",
"API",
"endpoint",
"."
] | c68035c8140aa05db5cf8556e68f5d4eaae8e2fa | https://github.com/CampaignChain/channel-mailchimp/blob/c68035c8140aa05db5cf8556e68f5d4eaae8e2fa/REST/MailChimpOAuth.php#L74-L86 |
235,299 | nattreid/app-manager | src/Helpers/Info.php | Info.getPhpInfo | protected function getPhpInfo(): string
{
ob_start();
phpinfo();
$result = ob_get_contents();
ob_end_clean();
$result = preg_replace('%^.*<body>(.*)</body>.*$%ms', '$1', $result);
$result = preg_replace('/,\s*/', ', ', $result);
return $result;
} | php | protected function getPhpInfo(): string
{
ob_start();
phpinfo();
$result = ob_get_contents();
ob_end_clean();
$result = preg_replace('%^.*<body>(.*)</body>.*$%ms', '$1', $result);
$result = preg_replace('/,\s*/', ', ', $result);
return $result;
} | [
"protected",
"function",
"getPhpInfo",
"(",
")",
":",
"string",
"{",
"ob_start",
"(",
")",
";",
"phpinfo",
"(",
")",
";",
"$",
"result",
"=",
"ob_get_contents",
"(",
")",
";",
"ob_end_clean",
"(",
")",
";",
"$",
"result",
"=",
"preg_replace",
"(",
"'%^... | Vrati vypis PHP info
@return string | [
"Vrati",
"vypis",
"PHP",
"info"
] | 7821d09a0b3e58ba9c6eb81d44e35aacce55de75 | https://github.com/nattreid/app-manager/blob/7821d09a0b3e58ba9c6eb81d44e35aacce55de75/src/Helpers/Info.php#L34-L44 |
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.