repository_name stringlengths 5 67 | func_path_in_repository stringlengths 4 234 | func_name stringlengths 0 314 | whole_func_string stringlengths 52 3.87M | language stringclasses 6
values | func_code_string stringlengths 52 3.87M | func_code_tokens listlengths 15 672k | func_documentation_string stringlengths 1 47.2k | func_documentation_tokens listlengths 1 3.92k | split_name stringclasses 1
value | func_code_url stringlengths 85 339 |
|---|---|---|---|---|---|---|---|---|---|---|
nkt/flame | src/QueryBuilder/Expression.php | Expression.orLess | public function orLess($column, $argument)
{
$this->conditions[] = 'OR ' . $this->grammar->buildId($column) . ' < ' . $argument;
return $this;
} | php | public function orLess($column, $argument)
{
$this->conditions[] = 'OR ' . $this->grammar->buildId($column) . ' < ' . $argument;
return $this;
} | [
"public",
"function",
"orLess",
"(",
"$",
"column",
",",
"$",
"argument",
")",
"{",
"$",
"this",
"->",
"conditions",
"[",
"]",
"=",
"'OR '",
".",
"$",
"this",
"->",
"grammar",
"->",
"buildId",
"(",
"$",
"column",
")",
".",
"' < '",
".",
"$",
"argum... | @param string $column
@param string $argument
@return static | [
"@param",
"string",
"$column",
"@param",
"string",
"$argument"
] | train | https://github.com/nkt/flame/blob/16f9f172db5a8a618b628429e0986eacb089d217/src/QueryBuilder/Expression.php#L434-L439 |
nkt/flame | src/QueryBuilder/Expression.php | Expression.orLessOrEqual | public function orLessOrEqual($column, $argument)
{
$this->conditions[] = 'OR ' . $this->grammar->buildId($column) . ' <= ' . $argument;
return $this;
} | php | public function orLessOrEqual($column, $argument)
{
$this->conditions[] = 'OR ' . $this->grammar->buildId($column) . ' <= ' . $argument;
return $this;
} | [
"public",
"function",
"orLessOrEqual",
"(",
"$",
"column",
",",
"$",
"argument",
")",
"{",
"$",
"this",
"->",
"conditions",
"[",
"]",
"=",
"'OR '",
".",
"$",
"this",
"->",
"grammar",
"->",
"buildId",
"(",
"$",
"column",
")",
".",
"' <= '",
".",
"$",
... | @param string $column
@param string $argument
@return static | [
"@param",
"string",
"$column",
"@param",
"string",
"$argument"
] | train | https://github.com/nkt/flame/blob/16f9f172db5a8a618b628429e0986eacb089d217/src/QueryBuilder/Expression.php#L447-L452 |
nkt/flame | src/QueryBuilder/Expression.php | Expression.orMore | public function orMore($column, $argument)
{
$this->conditions[] = 'OR ' . $this->grammar->buildId($column) . ' > ' . $argument;
return $this;
} | php | public function orMore($column, $argument)
{
$this->conditions[] = 'OR ' . $this->grammar->buildId($column) . ' > ' . $argument;
return $this;
} | [
"public",
"function",
"orMore",
"(",
"$",
"column",
",",
"$",
"argument",
")",
"{",
"$",
"this",
"->",
"conditions",
"[",
"]",
"=",
"'OR '",
".",
"$",
"this",
"->",
"grammar",
"->",
"buildId",
"(",
"$",
"column",
")",
".",
"' > '",
".",
"$",
"argum... | @param string $column
@param string $argument
@return static | [
"@param",
"string",
"$column",
"@param",
"string",
"$argument"
] | train | https://github.com/nkt/flame/blob/16f9f172db5a8a618b628429e0986eacb089d217/src/QueryBuilder/Expression.php#L460-L465 |
nkt/flame | src/QueryBuilder/Expression.php | Expression.orMoreOrEqual | public function orMoreOrEqual($column, $argument)
{
$this->conditions[] = 'OR ' . $this->grammar->buildId($column) . ' >= ' . $argument;
return $this;
} | php | public function orMoreOrEqual($column, $argument)
{
$this->conditions[] = 'OR ' . $this->grammar->buildId($column) . ' >= ' . $argument;
return $this;
} | [
"public",
"function",
"orMoreOrEqual",
"(",
"$",
"column",
",",
"$",
"argument",
")",
"{",
"$",
"this",
"->",
"conditions",
"[",
"]",
"=",
"'OR '",
".",
"$",
"this",
"->",
"grammar",
"->",
"buildId",
"(",
"$",
"column",
")",
".",
"' >= '",
".",
"$",
... | @param string $column
@param string $argument
@return static | [
"@param",
"string",
"$column",
"@param",
"string",
"$argument"
] | train | https://github.com/nkt/flame/blob/16f9f172db5a8a618b628429e0986eacb089d217/src/QueryBuilder/Expression.php#L473-L478 |
nkt/flame | src/QueryBuilder/Expression.php | Expression.orIn | public function orIn($column, $argument)
{
$this->conditions[] = 'OR ' . $this->grammar->buildId($column) . ' IN(' . $argument . ')';
return $this;
} | php | public function orIn($column, $argument)
{
$this->conditions[] = 'OR ' . $this->grammar->buildId($column) . ' IN(' . $argument . ')';
return $this;
} | [
"public",
"function",
"orIn",
"(",
"$",
"column",
",",
"$",
"argument",
")",
"{",
"$",
"this",
"->",
"conditions",
"[",
"]",
"=",
"'OR '",
".",
"$",
"this",
"->",
"grammar",
"->",
"buildId",
"(",
"$",
"column",
")",
".",
"' IN('",
".",
"$",
"argume... | @param string $column
@param string $argument
@return static | [
"@param",
"string",
"$column",
"@param",
"string",
"$argument"
] | train | https://github.com/nkt/flame/blob/16f9f172db5a8a618b628429e0986eacb089d217/src/QueryBuilder/Expression.php#L486-L491 |
nkt/flame | src/QueryBuilder/Expression.php | Expression.orNotIn | public function orNotIn($column, $argument)
{
$this->conditions[] = 'OR ' . $this->grammar->buildId($column) . ' NOT IN(' . $argument . ')';
return $this;
} | php | public function orNotIn($column, $argument)
{
$this->conditions[] = 'OR ' . $this->grammar->buildId($column) . ' NOT IN(' . $argument . ')';
return $this;
} | [
"public",
"function",
"orNotIn",
"(",
"$",
"column",
",",
"$",
"argument",
")",
"{",
"$",
"this",
"->",
"conditions",
"[",
"]",
"=",
"'OR '",
".",
"$",
"this",
"->",
"grammar",
"->",
"buildId",
"(",
"$",
"column",
")",
".",
"' NOT IN('",
".",
"$",
... | @param string $column
@param string $argument
@return static | [
"@param",
"string",
"$column",
"@param",
"string",
"$argument"
] | train | https://github.com/nkt/flame/blob/16f9f172db5a8a618b628429e0986eacb089d217/src/QueryBuilder/Expression.php#L499-L504 |
nkt/flame | src/QueryBuilder/Expression.php | Expression.orBetween | public function orBetween($column, $left, $right)
{
$this->conditions[] = 'OR ' . $this->grammar->buildId($column) . ' BETWEEN ' . $left . ' AND ' . $right;
return $this;
} | php | public function orBetween($column, $left, $right)
{
$this->conditions[] = 'OR ' . $this->grammar->buildId($column) . ' BETWEEN ' . $left . ' AND ' . $right;
return $this;
} | [
"public",
"function",
"orBetween",
"(",
"$",
"column",
",",
"$",
"left",
",",
"$",
"right",
")",
"{",
"$",
"this",
"->",
"conditions",
"[",
"]",
"=",
"'OR '",
".",
"$",
"this",
"->",
"grammar",
"->",
"buildId",
"(",
"$",
"column",
")",
".",
"' BETW... | @param string $column
@param string $left
@param string $right
@return static | [
"@param",
"string",
"$column",
"@param",
"string",
"$left",
"@param",
"string",
"$right"
] | train | https://github.com/nkt/flame/blob/16f9f172db5a8a618b628429e0986eacb089d217/src/QueryBuilder/Expression.php#L513-L518 |
nkt/flame | src/QueryBuilder/Expression.php | Expression.orNotBetween | public function orNotBetween($column, $left, $right)
{
$this->conditions[] = 'OR ' . $this->grammar->buildId($column) . ' NOT BETWEEN ' . $left . ' AND ' . $right;
return $this;
} | php | public function orNotBetween($column, $left, $right)
{
$this->conditions[] = 'OR ' . $this->grammar->buildId($column) . ' NOT BETWEEN ' . $left . ' AND ' . $right;
return $this;
} | [
"public",
"function",
"orNotBetween",
"(",
"$",
"column",
",",
"$",
"left",
",",
"$",
"right",
")",
"{",
"$",
"this",
"->",
"conditions",
"[",
"]",
"=",
"'OR '",
".",
"$",
"this",
"->",
"grammar",
"->",
"buildId",
"(",
"$",
"column",
")",
".",
"' N... | @param string $column
@param string $left
@param string $right
@return static | [
"@param",
"string",
"$column",
"@param",
"string",
"$left",
"@param",
"string",
"$right"
] | train | https://github.com/nkt/flame/blob/16f9f172db5a8a618b628429e0986eacb089d217/src/QueryBuilder/Expression.php#L527-L532 |
nkt/flame | src/QueryBuilder/Expression.php | Expression.orLike | public function orLike($column, $pattern)
{
$this->conditions[] = 'OR ' . $this->grammar->buildId($column) . ' LIKE ' . $pattern;
return $this;
} | php | public function orLike($column, $pattern)
{
$this->conditions[] = 'OR ' . $this->grammar->buildId($column) . ' LIKE ' . $pattern;
return $this;
} | [
"public",
"function",
"orLike",
"(",
"$",
"column",
",",
"$",
"pattern",
")",
"{",
"$",
"this",
"->",
"conditions",
"[",
"]",
"=",
"'OR '",
".",
"$",
"this",
"->",
"grammar",
"->",
"buildId",
"(",
"$",
"column",
")",
".",
"' LIKE '",
".",
"$",
"pat... | @param string $column
@param string $pattern
@return static | [
"@param",
"string",
"$column",
"@param",
"string",
"$pattern"
] | train | https://github.com/nkt/flame/blob/16f9f172db5a8a618b628429e0986eacb089d217/src/QueryBuilder/Expression.php#L564-L569 |
nkt/flame | src/QueryBuilder/Expression.php | Expression.orNotLike | public function orNotLike($column, $pattern)
{
$this->conditions[] = 'OR ' . $this->grammar->buildId($column) . ' NOT LIKE ' . $pattern;
return $this;
} | php | public function orNotLike($column, $pattern)
{
$this->conditions[] = 'OR ' . $this->grammar->buildId($column) . ' NOT LIKE ' . $pattern;
return $this;
} | [
"public",
"function",
"orNotLike",
"(",
"$",
"column",
",",
"$",
"pattern",
")",
"{",
"$",
"this",
"->",
"conditions",
"[",
"]",
"=",
"'OR '",
".",
"$",
"this",
"->",
"grammar",
"->",
"buildId",
"(",
"$",
"column",
")",
".",
"' NOT LIKE '",
".",
"$",... | @param string $column
@param string $pattern
@return static | [
"@param",
"string",
"$column",
"@param",
"string",
"$pattern"
] | train | https://github.com/nkt/flame/blob/16f9f172db5a8a618b628429e0986eacb089d217/src/QueryBuilder/Expression.php#L577-L582 |
blast-project/CoreBundle | src/Form/AbstractType.php | AbstractType.getBlockPrefix | public function getBlockPrefix()
{
$rc = new \ReflectionClass($this);
// Non-greedy ("+?") to match "type" suffix, if present
$fqcn = preg_replace(
array('/([^\\\\])(Bundle)?\\\\Form\\\\Type(\\\\[^\\\\]+?)(Type)?$/i', '/\\\\/'),
array('\\1\\3', '_'),
$rc-... | php | public function getBlockPrefix()
{
$rc = new \ReflectionClass($this);
// Non-greedy ("+?") to match "type" suffix, if present
$fqcn = preg_replace(
array('/([^\\\\])(Bundle)?\\\\Form\\\\Type(\\\\[^\\\\]+?)(Type)?$/i', '/\\\\/'),
array('\\1\\3', '_'),
$rc-... | [
"public",
"function",
"getBlockPrefix",
"(",
")",
"{",
"$",
"rc",
"=",
"new",
"\\",
"ReflectionClass",
"(",
"$",
"this",
")",
";",
"// Non-greedy (\"+?\") to match \"type\" suffix, if present",
"$",
"fqcn",
"=",
"preg_replace",
"(",
"array",
"(",
"'/([^\\\\\\\\])(Bu... | getBlockPrefix.
When $this is a AppBundle\Form\Type\MyType, it returns app_my
When $this is a Librinfo\AppBundle\Form\Type\MyType, it returns librinfo_app_my
@return string | [
"getBlockPrefix",
"."
] | train | https://github.com/blast-project/CoreBundle/blob/7a0832758ca14e5bc5d65515532c1220df3930ae/src/Form/AbstractType.php#L37-L49 |
BugBuster1701/banner | classes/BannerHelper.php | BannerHelper.bannerHelperInit | protected function bannerHelperInit()
{
//Fix the planet
$this->statusRandomBlocker = false;
$this->statusFirstViewBlocker = false;
$this->statusBannerFirstView = false;
$this->statusBannerFrontendGroupView = true;
$this->statusAllBannersBasic = true;
... | php | protected function bannerHelperInit()
{
//Fix the planet
$this->statusRandomBlocker = false;
$this->statusFirstViewBlocker = false;
$this->statusBannerFirstView = false;
$this->statusBannerFrontendGroupView = true;
$this->statusAllBannersBasic = true;
... | [
"protected",
"function",
"bannerHelperInit",
"(",
")",
"{",
"//Fix the planet",
"$",
"this",
"->",
"statusRandomBlocker",
"=",
"false",
";",
"$",
"this",
"->",
"statusFirstViewBlocker",
"=",
"false",
";",
"$",
"this",
"->",
"statusBannerFirstView",
"=",
"false",
... | INIT
@return false, if anything is wrong | [
"INIT"
] | train | https://github.com/BugBuster1701/banner/blob/3ffac36837923194ab0ebaf308c0b23a3684b005/classes/BannerHelper.php#L119-L158 |
BugBuster1701/banner | classes/BannerHelper.php | BannerHelper.getSetCategoryValues | protected function getSetCategoryValues()
{
//DEBUG log_message('getSetCategoryValues banner_categories:'.$this->banner_categories,'Banner.log');
//$this->banner_categories is now an ID, but the name is backward compatible
if ( !isset($this->banner_categories) || !is_numeric($this->banner_categories) )
{
... | php | protected function getSetCategoryValues()
{
//DEBUG log_message('getSetCategoryValues banner_categories:'.$this->banner_categories,'Banner.log');
//$this->banner_categories is now an ID, but the name is backward compatible
if ( !isset($this->banner_categories) || !is_numeric($this->banner_categories) )
{
... | [
"protected",
"function",
"getSetCategoryValues",
"(",
")",
"{",
"//DEBUG log_message('getSetCategoryValues banner_categories:'.$this->banner_categories,'Banner.log');",
"//$this->banner_categories is now an ID, but the name is backward compatible ",
"if",
"(",
"!",
"isset",
"(",
"$",
"th... | Set Category Values in $this->arrCategoryValues over tl_banner_category
@return boolean true = OK | false = we have a problem | [
"Set",
"Category",
"Values",
"in",
"$this",
"-",
">",
"arrCategoryValues",
"over",
"tl_banner_category"
] | train | https://github.com/BugBuster1701/banner/blob/3ffac36837923194ab0ebaf308c0b23a3684b005/classes/BannerHelper.php#L165-L206 |
BugBuster1701/banner | classes/BannerHelper.php | BannerHelper.checkSetUserFrontendLogin | protected function checkSetUserFrontendLogin()
{
if (FE_USER_LOGGED_IN)
{
$this->import('FrontendUser', 'User');
if ( $this->arrCategoryValues['banner_protected'] == 1
&& $this->arrCategoryValues['banner_group'] > 0 )
{
if ( $this->User->isMemberOf($this->arrCategoryV... | php | protected function checkSetUserFrontendLogin()
{
if (FE_USER_LOGGED_IN)
{
$this->import('FrontendUser', 'User');
if ( $this->arrCategoryValues['banner_protected'] == 1
&& $this->arrCategoryValues['banner_group'] > 0 )
{
if ( $this->User->isMemberOf($this->arrCategoryV... | [
"protected",
"function",
"checkSetUserFrontendLogin",
"(",
")",
"{",
"if",
"(",
"FE_USER_LOGGED_IN",
")",
"{",
"$",
"this",
"->",
"import",
"(",
"'FrontendUser'",
",",
"'User'",
")",
";",
"if",
"(",
"$",
"this",
"->",
"arrCategoryValues",
"[",
"'banner_protect... | Check if FE User loggen in and banner category is protected
@return boolean true = View allowed | false = View not allowed | [
"Check",
"if",
"FE",
"User",
"loggen",
"in",
"and",
"banner",
"category",
"is",
"protected"
] | train | https://github.com/BugBuster1701/banner/blob/3ffac36837923194ab0ebaf308c0b23a3684b005/classes/BannerHelper.php#L213-L230 |
BugBuster1701/banner | classes/BannerHelper.php | BannerHelper.getSetAllBannerForCategory | protected function getSetAllBannerForCategory()
{
$this->arrAllBannersBasic = array();
//wenn mit der definierte Kategorie ID keine Daten gefunden wurden
//macht Suche nach Banner kein Sinn
if ($this->arrCategoryValues === false)
{
return false;
}
//Domain Name ermitteln
$http_host = \Environme... | php | protected function getSetAllBannerForCategory()
{
$this->arrAllBannersBasic = array();
//wenn mit der definierte Kategorie ID keine Daten gefunden wurden
//macht Suche nach Banner kein Sinn
if ($this->arrCategoryValues === false)
{
return false;
}
//Domain Name ermitteln
$http_host = \Environme... | [
"protected",
"function",
"getSetAllBannerForCategory",
"(",
")",
"{",
"$",
"this",
"->",
"arrAllBannersBasic",
"=",
"array",
"(",
")",
";",
"//wenn mit der definierte Kategorie ID keine Daten gefunden wurden",
"//macht Suche nach Banner kein Sinn",
"if",
"(",
"$",
"this",
"... | Get all Banner basics (id,weighting) for category, in $arrAllBannersBasic
@return boolean true = $arrAllBannersBasic is filled | false = empty $arrAllBannersBasic | [
"Get",
"all",
"Banner",
"basics",
"(",
"id",
"weighting",
")",
"for",
"category",
"in",
"$arrAllBannersBasic"
] | train | https://github.com/BugBuster1701/banner/blob/3ffac36837923194ab0ebaf308c0b23a3684b005/classes/BannerHelper.php#L237-L301 |
BugBuster1701/banner | classes/BannerHelper.php | BannerHelper.getDefaultBanner | protected function getDefaultBanner()
{
$arrImageSize = array();
//CSS-ID/Klasse(n) je Banner, für den wrapper
$banner_cssID = '';
$banner_class = ' banner_default';
//BannerDefault gewünscht und vorhanden?
if ( $this->arrCategoryValues['banner_default'] == '1'
&& strlen($this->arrCat... | php | protected function getDefaultBanner()
{
$arrImageSize = array();
//CSS-ID/Klasse(n) je Banner, für den wrapper
$banner_cssID = '';
$banner_class = ' banner_default';
//BannerDefault gewünscht und vorhanden?
if ( $this->arrCategoryValues['banner_default'] == '1'
&& strlen($this->arrCat... | [
"protected",
"function",
"getDefaultBanner",
"(",
")",
"{",
"$",
"arrImageSize",
"=",
"array",
"(",
")",
";",
"//CSS-ID/Klasse(n) je Banner, für den wrapper",
"$",
"banner_cssID",
"=",
"''",
";",
"$",
"banner_class",
"=",
"' banner_default'",
";",
"//BannerDefault gew... | Get default banner or empty banner in $this->Template->banners
@return boolean true | [
"Get",
"default",
"banner",
"or",
"empty",
"banner",
"in",
"$this",
"-",
">",
"Template",
"-",
">",
"banners"
] | train | https://github.com/BugBuster1701/banner/blob/3ffac36837923194ab0ebaf308c0b23a3684b005/classes/BannerHelper.php#L308-L445 |
BugBuster1701/banner | classes/BannerHelper.php | BannerHelper.getSingleWeighting | protected function getSingleWeighting()
{
$arrPrio = array();
$arrPrioW = array();
$arrWeights = array_flip($this->arrAllBannersBasic);
//welche Wichtungen gibt es?
if (array_key_exists(1, $arrWeights)) { $arrPrioW[1] = 1; };
if (array_key_exists(2, $arrWeights)) { $arrPrioW[2] = 2; };
... | php | protected function getSingleWeighting()
{
$arrPrio = array();
$arrPrioW = array();
$arrWeights = array_flip($this->arrAllBannersBasic);
//welche Wichtungen gibt es?
if (array_key_exists(1, $arrWeights)) { $arrPrioW[1] = 1; };
if (array_key_exists(2, $arrWeights)) { $arrPrioW[2] = 2; };
... | [
"protected",
"function",
"getSingleWeighting",
"(",
")",
"{",
"$",
"arrPrio",
"=",
"array",
"(",
")",
";",
"$",
"arrPrioW",
"=",
"array",
"(",
")",
";",
"$",
"arrWeights",
"=",
"array_flip",
"(",
"$",
"this",
"->",
"arrAllBannersBasic",
")",
";",
"//welc... | Get weighting for single banner
parameter over $this->arrAllBannersBasic [id,weighting]
@return integer 0|1|2|3 0 on error | [
"Get",
"weighting",
"for",
"single",
"banner",
"parameter",
"over",
"$this",
"-",
">",
"arrAllBannersBasic",
"[",
"id",
"weighting",
"]"
] | train | https://github.com/BugBuster1701/banner/blob/3ffac36837923194ab0ebaf308c0b23a3684b005/classes/BannerHelper.php#L453-L501 |
BugBuster1701/banner | classes/BannerHelper.php | BannerHelper.setRandomBlockerId | protected function setRandomBlockerId($BannerID=0)
{
if ($BannerID==0) { return; }// kein Banner, nichts zu tun
$this->statusRandomBlocker = true;
$this->setSession('RandomBlocker'.$this->module_id , array( $BannerID => time() ));
return ;
} | php | protected function setRandomBlockerId($BannerID=0)
{
if ($BannerID==0) { return; }// kein Banner, nichts zu tun
$this->statusRandomBlocker = true;
$this->setSession('RandomBlocker'.$this->module_id , array( $BannerID => time() ));
return ;
} | [
"protected",
"function",
"setRandomBlockerId",
"(",
"$",
"BannerID",
"=",
"0",
")",
"{",
"if",
"(",
"$",
"BannerID",
"==",
"0",
")",
"{",
"return",
";",
"}",
"// kein Banner, nichts zu tun",
"$",
"this",
"->",
"statusRandomBlocker",
"=",
"true",
";",
"$",
... | Random Blocker, Set Banner-ID
@param integer $BannerID | [
"Random",
"Blocker",
"Set",
"Banner",
"-",
"ID"
] | train | https://github.com/BugBuster1701/banner/blob/3ffac36837923194ab0ebaf308c0b23a3684b005/classes/BannerHelper.php#L508-L515 |
BugBuster1701/banner | classes/BannerHelper.php | BannerHelper.getRandomBlockerId | protected function getRandomBlockerId()
{
$this->getSession('RandomBlocker'.$this->module_id);
if ( count($this->_session) )
{
$key = key($this->_session);
$value = current($this->_session);
unset($value);
reset($this->_session);
//DEBUG log_messag... | php | protected function getRandomBlockerId()
{
$this->getSession('RandomBlocker'.$this->module_id);
if ( count($this->_session) )
{
$key = key($this->_session);
$value = current($this->_session);
unset($value);
reset($this->_session);
//DEBUG log_messag... | [
"protected",
"function",
"getRandomBlockerId",
"(",
")",
"{",
"$",
"this",
"->",
"getSession",
"(",
"'RandomBlocker'",
".",
"$",
"this",
"->",
"module_id",
")",
";",
"if",
"(",
"count",
"(",
"$",
"this",
"->",
"_session",
")",
")",
"{",
"$",
"key",
"="... | Random Blocker, Get Banner-ID
@return integer Banner-ID | [
"Random",
"Blocker",
"Get",
"Banner",
"-",
"ID"
] | train | https://github.com/BugBuster1701/banner/blob/3ffac36837923194ab0ebaf308c0b23a3684b005/classes/BannerHelper.php#L522-L535 |
BugBuster1701/banner | classes/BannerHelper.php | BannerHelper.setFirstViewBlockerId | protected function setFirstViewBlockerId($banner_categorie=0)
{
if ($banner_categorie==0) { return; }// keine Banner Kategorie, nichts zu tun
$this->statusFirstViewBlocker = true;
$this->setSession('FirstViewBlocker'.$this->module_id, array( $banner_categorie => time() ));
return ;
} | php | protected function setFirstViewBlockerId($banner_categorie=0)
{
if ($banner_categorie==0) { return; }// keine Banner Kategorie, nichts zu tun
$this->statusFirstViewBlocker = true;
$this->setSession('FirstViewBlocker'.$this->module_id, array( $banner_categorie => time() ));
return ;
} | [
"protected",
"function",
"setFirstViewBlockerId",
"(",
"$",
"banner_categorie",
"=",
"0",
")",
"{",
"if",
"(",
"$",
"banner_categorie",
"==",
"0",
")",
"{",
"return",
";",
"}",
"// keine Banner Kategorie, nichts zu tun",
"$",
"this",
"->",
"statusFirstViewBlocker",
... | First View Blocker, Set Banner Categorie-ID and timestamp
@param integer $banner_categorie | [
"First",
"View",
"Blocker",
"Set",
"Banner",
"Categorie",
"-",
"ID",
"and",
"timestamp"
] | train | https://github.com/BugBuster1701/banner/blob/3ffac36837923194ab0ebaf308c0b23a3684b005/classes/BannerHelper.php#L542-L549 |
BugBuster1701/banner | classes/BannerHelper.php | BannerHelper.getFirstViewBlockerId | protected function getFirstViewBlockerId()
{
$this->getSession('FirstViewBlocker'.$this->module_id);
if ( count($this->_session) )
{
$key = key($this->_session);
$tstmap = current($this->_session);
reset($this->_session);
if ( $this->removeOldFirstViewBlockerId($ke... | php | protected function getFirstViewBlockerId()
{
$this->getSession('FirstViewBlocker'.$this->module_id);
if ( count($this->_session) )
{
$key = key($this->_session);
$tstmap = current($this->_session);
reset($this->_session);
if ( $this->removeOldFirstViewBlockerId($ke... | [
"protected",
"function",
"getFirstViewBlockerId",
"(",
")",
"{",
"$",
"this",
"->",
"getSession",
"(",
"'FirstViewBlocker'",
".",
"$",
"this",
"->",
"module_id",
")",
";",
"if",
"(",
"count",
"(",
"$",
"this",
"->",
"_session",
")",
")",
"{",
"$",
"key",... | First View Blocker, Get Banner Categorie-ID if the timestamp ....
@param mixed $banner_categorie | false | [
"First",
"View",
"Blocker",
"Get",
"Banner",
"Categorie",
"-",
"ID",
"if",
"the",
"timestamp",
"...."
] | train | https://github.com/BugBuster1701/banner/blob/3ffac36837923194ab0ebaf308c0b23a3684b005/classes/BannerHelper.php#L556-L572 |
BugBuster1701/banner | classes/BannerHelper.php | BannerHelper.removeOldFirstViewBlockerId | protected function removeOldFirstViewBlockerId($key, $tstmap)
{
// 5 Minuten Blockierung, älter >= 5 Minuten wird gelöscht
$FirstViewBlockTime = time() - 60*5;
if ( $tstmap > $FirstViewBlockTime )
{
return true;
}
else
{
\Session::getInstance()->remove($key... | php | protected function removeOldFirstViewBlockerId($key, $tstmap)
{
// 5 Minuten Blockierung, älter >= 5 Minuten wird gelöscht
$FirstViewBlockTime = time() - 60*5;
if ( $tstmap > $FirstViewBlockTime )
{
return true;
}
else
{
\Session::getInstance()->remove($key... | [
"protected",
"function",
"removeOldFirstViewBlockerId",
"(",
"$",
"key",
",",
"$",
"tstmap",
")",
"{",
"// 5 Minuten Blockierung, älter >= 5 Minuten wird gelöscht",
"$",
"FirstViewBlockTime",
"=",
"time",
"(",
")",
"-",
"60",
"*",
"5",
";",
"if",
"(",
"$",
"tstmap... | First View Blocker, Remove old Banner Categorie-ID
@param integer $banner_categorie
@return boolean true = Key is valid, it must be blocked | false = key is invalid | [
"First",
"View",
"Blocker",
"Remove",
"old",
"Banner",
"Categorie",
"-",
"ID"
] | train | https://github.com/BugBuster1701/banner/blob/3ffac36837923194ab0ebaf308c0b23a3684b005/classes/BannerHelper.php#L580-L594 |
BugBuster1701/banner | classes/BannerHelper.php | BannerHelper.getSetFirstView | protected function getSetFirstView()
{
//return true; // for Test only
//FirstViewBanner gewünscht?
if ($this->banner_firstview !=1) { return false; }
$this->BannerReferrer = new \Banner\BannerReferrer();
$this->BannerReferrer->checkReferrer();
$ReferrerDNS = $this->BannerReferrer->getRe... | php | protected function getSetFirstView()
{
//return true; // for Test only
//FirstViewBanner gewünscht?
if ($this->banner_firstview !=1) { return false; }
$this->BannerReferrer = new \Banner\BannerReferrer();
$this->BannerReferrer->checkReferrer();
$ReferrerDNS = $this->BannerReferrer->getRe... | [
"protected",
"function",
"getSetFirstView",
"(",
")",
"{",
"//return true; // for Test only",
"//FirstViewBanner gewünscht?",
"if",
"(",
"$",
"this",
"->",
"banner_firstview",
"!=",
"1",
")",
"{",
"return",
"false",
";",
"}",
"$",
"this",
"->",
"BannerReferrer",
"... | Get FirstViewBanner status and set cat id as blocker
@return boolean true = if requested and not blocked | false = if requested but blocked | [
"Get",
"FirstViewBanner",
"status",
"and",
"set",
"cat",
"id",
"as",
"blocker"
] | train | https://github.com/BugBuster1701/banner/blob/3ffac36837923194ab0ebaf308c0b23a3684b005/classes/BannerHelper.php#L602-L634 |
BugBuster1701/banner | classes/BannerHelper.php | BannerHelper.getSingleBannerFirst | protected function getSingleBannerFirst()
{
$arrBanners = array();
$arrResults = array();
$FileSrc = '';
//first aktiv banner in category
//$this->arrAllBannersBasic den ersten Datensatz über die ID nutzen
//seltsamerweise kommt reference Fehler bei Kombination in einer Anweisung, d... | php | protected function getSingleBannerFirst()
{
$arrBanners = array();
$arrResults = array();
$FileSrc = '';
//first aktiv banner in category
//$this->arrAllBannersBasic den ersten Datensatz über die ID nutzen
//seltsamerweise kommt reference Fehler bei Kombination in einer Anweisung, d... | [
"protected",
"function",
"getSingleBannerFirst",
"(",
")",
"{",
"$",
"arrBanners",
"=",
"array",
"(",
")",
";",
"$",
"arrResults",
"=",
"array",
"(",
")",
";",
"$",
"FileSrc",
"=",
"''",
";",
"//first aktiv banner in category",
"//$this->arrAllBannersBasic den ers... | Get First View Banner
@return internal Value in $this->strTemplate | [
"Get",
"First",
"View",
"Banner"
] | train | https://github.com/BugBuster1701/banner/blob/3ffac36837923194ab0ebaf308c0b23a3684b005/classes/BannerHelper.php#L641-L1011 |
BugBuster1701/banner | classes/BannerHelper.php | BannerHelper.shuffleAssoc | protected function shuffleAssoc(&$array)
{
$keys = array_keys($array);
shuffle($keys);
shuffle($keys);
foreach($keys as $key)
{
$new[$key] = $array[$key];
unset($array[$key]); /* save memory */
}
$array = $new;
r... | php | protected function shuffleAssoc(&$array)
{
$keys = array_keys($array);
shuffle($keys);
shuffle($keys);
foreach($keys as $key)
{
$new[$key] = $array[$key];
unset($array[$key]); /* save memory */
}
$array = $new;
r... | [
"protected",
"function",
"shuffleAssoc",
"(",
"&",
"$",
"array",
")",
"{",
"$",
"keys",
"=",
"array_keys",
"(",
"$",
"array",
")",
";",
"shuffle",
"(",
"$",
"keys",
")",
";",
"shuffle",
"(",
"$",
"keys",
")",
";",
"foreach",
"(",
"$",
"keys",
"as",... | shuffle for associative arrays, preserves key=>value pairs.
http://www.php.net/manual/de/function.shuffle.php | [
"shuffle",
"for",
"associative",
"arrays",
"preserves",
"key",
"=",
">",
"value",
"pairs",
".",
"http",
":",
"//",
"www",
".",
"php",
".",
"net",
"/",
"manual",
"/",
"de",
"/",
"function",
".",
"shuffle",
".",
"php"
] | train | https://github.com/BugBuster1701/banner/blob/3ffac36837923194ab0ebaf308c0b23a3684b005/classes/BannerHelper.php#L1823-L1837 |
BugBuster1701/banner | classes/BannerHelper.php | BannerHelper.setStatViewUpdate | protected function setStatViewUpdate()
{
if ($this->bannerCheckBot() === true)
{
return; //Bot gefunden, wird nicht gezaehlt
}
if ($this->checkUserAgent() === true)
{
return ; //User Agent Filterung
}
// Blocker
$lastBanner = array_pop($this->arrBannerDat... | php | protected function setStatViewUpdate()
{
if ($this->bannerCheckBot() === true)
{
return; //Bot gefunden, wird nicht gezaehlt
}
if ($this->checkUserAgent() === true)
{
return ; //User Agent Filterung
}
// Blocker
$lastBanner = array_pop($this->arrBannerDat... | [
"protected",
"function",
"setStatViewUpdate",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"bannerCheckBot",
"(",
")",
"===",
"true",
")",
"{",
"return",
";",
"//Bot gefunden, wird nicht gezaehlt",
"}",
"if",
"(",
"$",
"this",
"->",
"checkUserAgent",
"(",
")... | Insert/Update Banner View Stat | [
"Insert",
"/",
"Update",
"Banner",
"View",
"Stat"
] | train | https://github.com/BugBuster1701/banner/blob/3ffac36837923194ab0ebaf308c0b23a3684b005/classes/BannerHelper.php#L1854-L1907 |
BugBuster1701/banner | classes/BannerHelper.php | BannerHelper.setStatViewUpdateBlockerId | protected function setStatViewUpdateBlockerId($banner_id=0)
{
if ($banner_id==0) { return; }// keine Banner ID, nichts zu tun
//das können mehrere sein!, mergen!
$this->setSession('StatViewUpdateBlocker'.$this->module_id, array( $banner_id => time() ), true );
return ;
} | php | protected function setStatViewUpdateBlockerId($banner_id=0)
{
if ($banner_id==0) { return; }// keine Banner ID, nichts zu tun
//das können mehrere sein!, mergen!
$this->setSession('StatViewUpdateBlocker'.$this->module_id, array( $banner_id => time() ), true );
return ;
} | [
"protected",
"function",
"setStatViewUpdateBlockerId",
"(",
"$",
"banner_id",
"=",
"0",
")",
"{",
"if",
"(",
"$",
"banner_id",
"==",
"0",
")",
"{",
"return",
";",
"}",
"// keine Banner ID, nichts zu tun",
"//das können mehrere sein!, mergen!",
"$",
"this",
"->",
"... | StatViewUpdate Blocker, Set Banner ID and timestamp
@param integer $banner_id | [
"StatViewUpdate",
"Blocker",
"Set",
"Banner",
"ID",
"and",
"timestamp"
] | train | https://github.com/BugBuster1701/banner/blob/3ffac36837923194ab0ebaf308c0b23a3684b005/classes/BannerHelper.php#L1914-L1920 |
BugBuster1701/banner | classes/BannerHelper.php | BannerHelper.getStatViewUpdateBlockerId | protected function getStatViewUpdateBlockerId($banner_id=0)
{
$this->getSession('StatViewUpdateBlocker'.$this->module_id);
if ( count($this->_session) )
{
reset($this->_session);
foreach ($this->_session as $key => $val)
{
if ( $key == $banner_id &&
... | php | protected function getStatViewUpdateBlockerId($banner_id=0)
{
$this->getSession('StatViewUpdateBlocker'.$this->module_id);
if ( count($this->_session) )
{
reset($this->_session);
foreach ($this->_session as $key => $val)
{
if ( $key == $banner_id &&
... | [
"protected",
"function",
"getStatViewUpdateBlockerId",
"(",
"$",
"banner_id",
"=",
"0",
")",
"{",
"$",
"this",
"->",
"getSession",
"(",
"'StatViewUpdateBlocker'",
".",
"$",
"this",
"->",
"module_id",
")",
";",
"if",
"(",
"count",
"(",
"$",
"this",
"->",
"_... | StatViewUpdate Blocker, Get Banner ID if the timestamp ....
@param boolean true if blocked | false | [
"StatViewUpdate",
"Blocker",
"Get",
"Banner",
"ID",
"if",
"the",
"timestamp",
"...."
] | train | https://github.com/BugBuster1701/banner/blob/3ffac36837923194ab0ebaf308c0b23a3684b005/classes/BannerHelper.php#L1927-L1945 |
BugBuster1701/banner | classes/BannerHelper.php | BannerHelper.removeStatViewUpdateBlockerId | protected function removeStatViewUpdateBlockerId($banner_id, $tstmap)
{
$BannerBlockTime = time() - 60*5; // 5 Minuten, 0-5 min wird geblockt
if ( isset($GLOBALS['TL_CONFIG']['mod_banner_block_time'] )
&& intval($GLOBALS['TL_CONFIG']['mod_banner_block_time'])>0
)
{
$BannerBlockTime... | php | protected function removeStatViewUpdateBlockerId($banner_id, $tstmap)
{
$BannerBlockTime = time() - 60*5; // 5 Minuten, 0-5 min wird geblockt
if ( isset($GLOBALS['TL_CONFIG']['mod_banner_block_time'] )
&& intval($GLOBALS['TL_CONFIG']['mod_banner_block_time'])>0
)
{
$BannerBlockTime... | [
"protected",
"function",
"removeStatViewUpdateBlockerId",
"(",
"$",
"banner_id",
",",
"$",
"tstmap",
")",
"{",
"$",
"BannerBlockTime",
"=",
"time",
"(",
")",
"-",
"60",
"*",
"5",
";",
"// 5 Minuten, 0-5 min wird geblockt",
"if",
"(",
"isset",
"(",
"$",
"GLOBAL... | StatViewUpdate Blocker, Remove old Banner ID
@param integer $banner_id
@return boolean true = Key is valid, it must be blocked | false = key is invalid | [
"StatViewUpdate",
"Blocker",
"Remove",
"old",
"Banner",
"ID"
] | train | https://github.com/BugBuster1701/banner/blob/3ffac36837923194ab0ebaf308c0b23a3684b005/classes/BannerHelper.php#L1953-L1984 |
BugBuster1701/banner | classes/BannerHelper.php | BannerHelper.bannerCheckBot | protected function bannerCheckBot()
{
if (isset($GLOBALS['TL_CONFIG']['mod_banner_bot_check'])
&& (int)$GLOBALS['TL_CONFIG']['mod_banner_bot_check'] == 0
)
{
//DEBUG log_message('bannerCheckBot abgeschaltet','Banner.log');
return false; //Bot Suche abgeschaltet ueber localco... | php | protected function bannerCheckBot()
{
if (isset($GLOBALS['TL_CONFIG']['mod_banner_bot_check'])
&& (int)$GLOBALS['TL_CONFIG']['mod_banner_bot_check'] == 0
)
{
//DEBUG log_message('bannerCheckBot abgeschaltet','Banner.log');
return false; //Bot Suche abgeschaltet ueber localco... | [
"protected",
"function",
"bannerCheckBot",
"(",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"GLOBALS",
"[",
"'TL_CONFIG'",
"]",
"[",
"'mod_banner_bot_check'",
"]",
")",
"&&",
"(",
"int",
")",
"$",
"GLOBALS",
"[",
"'TL_CONFIG'",
"]",
"[",
"'mod_banner_bot_check'"... | Spider Bot Check | [
"Spider",
"Bot",
"Check"
] | train | https://github.com/BugBuster1701/banner/blob/3ffac36837923194ab0ebaf308c0b23a3684b005/classes/BannerHelper.php#L1990-L2014 |
BugBuster1701/banner | classes/BannerHelper.php | BannerHelper.checkUserAgent | protected function checkUserAgent()
{
if ( \Environment::get('httpUserAgent') )
{
$UserAgent = trim(\Environment::get('httpUserAgent'));
}
else
{
return false; // Ohne Absender keine Suche
}
$arrUserAgents = explode(",", $this->banner_useragent);
if (strlen... | php | protected function checkUserAgent()
{
if ( \Environment::get('httpUserAgent') )
{
$UserAgent = trim(\Environment::get('httpUserAgent'));
}
else
{
return false; // Ohne Absender keine Suche
}
$arrUserAgents = explode(",", $this->banner_useragent);
if (strlen... | [
"protected",
"function",
"checkUserAgent",
"(",
")",
"{",
"if",
"(",
"\\",
"Environment",
"::",
"get",
"(",
"'httpUserAgent'",
")",
")",
"{",
"$",
"UserAgent",
"=",
"trim",
"(",
"\\",
"Environment",
"::",
"get",
"(",
"'httpUserAgent'",
")",
")",
";",
"}"... | HTTP_USER_AGENT Special Check | [
"HTTP_USER_AGENT",
"Special",
"Check"
] | train | https://github.com/BugBuster1701/banner/blob/3ffac36837923194ab0ebaf308c0b23a3684b005/classes/BannerHelper.php#L2019-L2043 |
BugBuster1701/banner | classes/BannerHelper.php | BannerHelper.setSession | protected function setSession( $session_name, $arrData, $merge = false )
{
if ($merge)
{
$this->_session = \Session::getInstance()->get( $session_name );
// numerische Schlüssel werden neu numeriert, daher
// geht nicht: array_merge($this->_session, $arrData)
$m... | php | protected function setSession( $session_name, $arrData, $merge = false )
{
if ($merge)
{
$this->_session = \Session::getInstance()->get( $session_name );
// numerische Schlüssel werden neu numeriert, daher
// geht nicht: array_merge($this->_session, $arrData)
$m... | [
"protected",
"function",
"setSession",
"(",
"$",
"session_name",
",",
"$",
"arrData",
",",
"$",
"merge",
"=",
"false",
")",
"{",
"if",
"(",
"$",
"merge",
")",
"{",
"$",
"this",
"->",
"_session",
"=",
"\\",
"Session",
"::",
"getInstance",
"(",
")",
"-... | Set session
@param string $session_name e.g.: 'RandomBlocker'
@param array $arrData array('key' => array(Value1,Value2,...))
@return void
@access protected | [
"Set",
"session"
] | train | https://github.com/BugBuster1701/banner/blob/3ffac36837923194ab0ebaf308c0b23a3684b005/classes/BannerHelper.php#L2070-L2086 |
prooph/link-app-core | src/Service/SystemConfigChangesHandlerProvider.php | SystemConfigChangesHandlerProvider.initialize | public function initialize($instance, ServiceLocatorInterface $serviceLocator)
{
if ($instance instanceof HandlesSystemConfigChanges) {
$instance->setEventBus($serviceLocator->get('proophessor.event_bus'));
$instance->setConfigWriter($serviceLocator->get('prooph.link.system_config.co... | php | public function initialize($instance, ServiceLocatorInterface $serviceLocator)
{
if ($instance instanceof HandlesSystemConfigChanges) {
$instance->setEventBus($serviceLocator->get('proophessor.event_bus'));
$instance->setConfigWriter($serviceLocator->get('prooph.link.system_config.co... | [
"public",
"function",
"initialize",
"(",
"$",
"instance",
",",
"ServiceLocatorInterface",
"$",
"serviceLocator",
")",
"{",
"if",
"(",
"$",
"instance",
"instanceof",
"HandlesSystemConfigChanges",
")",
"{",
"$",
"instance",
"->",
"setEventBus",
"(",
"$",
"serviceLoc... | Initialize
@param $instance
@param ServiceLocatorInterface $serviceLocator
@return mixed | [
"Initialize"
] | train | https://github.com/prooph/link-app-core/blob/835a5945dfa7be7b2cebfa6e84e757ecfd783357/src/Service/SystemConfigChangesHandlerProvider.php#L32-L38 |
sfnt/wechat-php-sdk | src/qy/Wechat.php | Wechat.valid | public function valid($return=false)
{
$encryptStr="";
if ($_SERVER['REQUEST_METHOD'] == "POST") {
$postStr = file_get_contents("php://input");
$array = (array)simplexml_load_string($postStr, 'SimpleXMLElement', LIBXML_NOCDATA);
$this->log($postStr);
i... | php | public function valid($return=false)
{
$encryptStr="";
if ($_SERVER['REQUEST_METHOD'] == "POST") {
$postStr = file_get_contents("php://input");
$array = (array)simplexml_load_string($postStr, 'SimpleXMLElement', LIBXML_NOCDATA);
$this->log($postStr);
i... | [
"public",
"function",
"valid",
"(",
"$",
"return",
"=",
"false",
")",
"{",
"$",
"encryptStr",
"=",
"\"\"",
";",
"if",
"(",
"$",
"_SERVER",
"[",
"'REQUEST_METHOD'",
"]",
"==",
"\"POST\"",
")",
"{",
"$",
"postStr",
"=",
"file_get_contents",
"(",
"\"php://i... | 微信验证,包括post来的xml解密
@param bool $return 是否返回 | [
"微信验证,包括post来的xml解密"
] | train | https://github.com/sfnt/wechat-php-sdk/blob/d14b8511f96cfcf0da5f413b446e69943cc3ea90/src/qy/Wechat.php#L314-L361 |
sfnt/wechat-php-sdk | src/qy/Wechat.php | Wechat.getRev | public function getRev()
{
if ($this->_receive) return $this;
$postStr = $this->postxml;
$this->log($postStr);
if (!empty($postStr)) {
$this->_receive = (array)simplexml_load_string($postStr, 'SimpleXMLElement', LIBXML_NOCDATA);
if (!isset($this->_receive['AgentID'])) {
$this->_receive['AgentID']... | php | public function getRev()
{
if ($this->_receive) return $this;
$postStr = $this->postxml;
$this->log($postStr);
if (!empty($postStr)) {
$this->_receive = (array)simplexml_load_string($postStr, 'SimpleXMLElement', LIBXML_NOCDATA);
if (!isset($this->_receive['AgentID'])) {
$this->_receive['AgentID']... | [
"public",
"function",
"getRev",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"_receive",
")",
"return",
"$",
"this",
";",
"$",
"postStr",
"=",
"$",
"this",
"->",
"postxml",
";",
"$",
"this",
"->",
"log",
"(",
"$",
"postStr",
")",
";",
"if",
"(",
... | 获取微信服务器发来的信息 | [
"获取微信服务器发来的信息"
] | train | https://github.com/sfnt/wechat-php-sdk/blob/d14b8511f96cfcf0da5f413b446e69943cc3ea90/src/qy/Wechat.php#L366-L378 |
sfnt/wechat-php-sdk | src/qy/Wechat.php | Wechat.getRevGeo | public function getRevGeo(){
if (isset($this->_receive['Location_X'])){
return array(
'x'=>$this->_receive['Location_X'],
'y'=>$this->_receive['Location_Y'],
'scale'=>(string)$this->_receive['Scale'],
'label'=>(string)$this->_receive['Label']
);
} else
return false;
} | php | public function getRevGeo(){
if (isset($this->_receive['Location_X'])){
return array(
'x'=>$this->_receive['Location_X'],
'y'=>$this->_receive['Location_Y'],
'scale'=>(string)$this->_receive['Scale'],
'label'=>(string)$this->_receive['Label']
);
} else
return false;
} | [
"public",
"function",
"getRevGeo",
"(",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"_receive",
"[",
"'Location_X'",
"]",
")",
")",
"{",
"return",
"array",
"(",
"'x'",
"=>",
"$",
"this",
"->",
"_receive",
"[",
"'Location_X'",
"]",
",",
"'y'... | 获取接收地理位置 | [
"获取接收地理位置"
] | train | https://github.com/sfnt/wechat-php-sdk/blob/d14b8511f96cfcf0da5f413b446e69943cc3ea90/src/qy/Wechat.php#L482-L492 |
sfnt/wechat-php-sdk | src/qy/Wechat.php | Wechat.video | public function video($mediaid='',$title='',$description='')
{
$msg = array(
'ToUserName' => $this->getRevFrom(),
'FromUserName'=>$this->getRevTo(),
'MsgType'=>self::MSGTYPE_IMAGE,
'Video'=>array(
'MediaId'=>$mediaid,
'Title'=>$title,
'Description'=>$description
),
... | php | public function video($mediaid='',$title='',$description='')
{
$msg = array(
'ToUserName' => $this->getRevFrom(),
'FromUserName'=>$this->getRevTo(),
'MsgType'=>self::MSGTYPE_IMAGE,
'Video'=>array(
'MediaId'=>$mediaid,
'Title'=>$title,
'Description'=>$description
),
... | [
"public",
"function",
"video",
"(",
"$",
"mediaid",
"=",
"''",
",",
"$",
"title",
"=",
"''",
",",
"$",
"description",
"=",
"''",
")",
"{",
"$",
"msg",
"=",
"array",
"(",
"'ToUserName'",
"=>",
"$",
"this",
"->",
"getRevFrom",
"(",
")",
",",
"'FromUs... | 设置回复消息
Example: $obj->video('media_id','title','description')->reply();
@param string $mediaid | [
"设置回复消息",
"Example",
":",
"$obj",
"-",
">",
"video",
"(",
"media_id",
"title",
"description",
")",
"-",
">",
"reply",
"()",
";"
] | train | https://github.com/sfnt/wechat-php-sdk/blob/d14b8511f96cfcf0da5f413b446e69943cc3ea90/src/qy/Wechat.php#L721-L736 |
sfnt/wechat-php-sdk | src/qy/Wechat.php | Wechat.news | public function news($newsData=array())
{
$count = count($newsData);
$msg = array(
'ToUserName' => $this->getRevFrom(),
'FromUserName'=>$this->getRevTo(),
'MsgType'=>self::MSGTYPE_NEWS,
'CreateTime'=>time(),
'ArticleCount'=>$count,
'Articles'=>$newsData,
);
$this->Message($msg);
return $... | php | public function news($newsData=array())
{
$count = count($newsData);
$msg = array(
'ToUserName' => $this->getRevFrom(),
'FromUserName'=>$this->getRevTo(),
'MsgType'=>self::MSGTYPE_NEWS,
'CreateTime'=>time(),
'ArticleCount'=>$count,
'Articles'=>$newsData,
);
$this->Message($msg);
return $... | [
"public",
"function",
"news",
"(",
"$",
"newsData",
"=",
"array",
"(",
")",
")",
"{",
"$",
"count",
"=",
"count",
"(",
"$",
"newsData",
")",
";",
"$",
"msg",
"=",
"array",
"(",
"'ToUserName'",
"=>",
"$",
"this",
"->",
"getRevFrom",
"(",
")",
",",
... | 设置回复图文
@param array $newsData
数组结构:
array(
"0"=>array(
'Title'=>'msg title',
'Description'=>'summary text',
'PicUrl'=>'http://www.domain.com/1.jpg',
'Url'=>'http://www.domain.com/1.html'
),
"1"=>....
) | [
"设置回复图文"
] | train | https://github.com/sfnt/wechat-php-sdk/blob/d14b8511f96cfcf0da5f413b446e69943cc3ea90/src/qy/Wechat.php#L752-L768 |
sfnt/wechat-php-sdk | src/qy/Wechat.php | Wechat.resetJsTicket | public function resetJsTicket($appid=''){
if (!$appid) $appid = $this->appid;
$this->jsapi_ticket = '';
$authname = 'qywechat_jsapi_ticket'.$appid;
$this->removeCache($authname);
return true;
} | php | public function resetJsTicket($appid=''){
if (!$appid) $appid = $this->appid;
$this->jsapi_ticket = '';
$authname = 'qywechat_jsapi_ticket'.$appid;
$this->removeCache($authname);
return true;
} | [
"public",
"function",
"resetJsTicket",
"(",
"$",
"appid",
"=",
"''",
")",
"{",
"if",
"(",
"!",
"$",
"appid",
")",
"$",
"appid",
"=",
"$",
"this",
"->",
"appid",
";",
"$",
"this",
"->",
"jsapi_ticket",
"=",
"''",
";",
"$",
"authname",
"=",
"'qywecha... | 删除JSAPI授权TICKET
@param string $appid 用于多个appid时使用 | [
"删除JSAPI授权TICKET"
] | train | https://github.com/sfnt/wechat-php-sdk/blob/d14b8511f96cfcf0da5f413b446e69943cc3ea90/src/qy/Wechat.php#L927-L933 |
sfnt/wechat-php-sdk | src/qy/Wechat.php | Wechat.getJsTicket | public function getJsTicket($appid='',$jsapi_ticket=''){
if (!$this->access_token && !$this->checkAuth()) return false;
if (!$appid) $appid = $this->appid;
if ($jsapi_ticket) { //手动指定token,优先使用
$this->jsapi_ticket = $jsapi_ticket;
return $this->jsapi_ticket;
}
$authname = 'qywechat_jsapi_ticket'.$... | php | public function getJsTicket($appid='',$jsapi_ticket=''){
if (!$this->access_token && !$this->checkAuth()) return false;
if (!$appid) $appid = $this->appid;
if ($jsapi_ticket) { //手动指定token,优先使用
$this->jsapi_ticket = $jsapi_ticket;
return $this->jsapi_ticket;
}
$authname = 'qywechat_jsapi_ticket'.$... | [
"public",
"function",
"getJsTicket",
"(",
"$",
"appid",
"=",
"''",
",",
"$",
"jsapi_ticket",
"=",
"''",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"access_token",
"&&",
"!",
"$",
"this",
"->",
"checkAuth",
"(",
")",
")",
"return",
"false",
";",
"... | 获取JSAPI授权TICKET
@param string $appid 用于多个appid时使用,可空
@param string $jsapi_ticket 手动指定jsapi_ticket,非必要情况不建议用 | [
"获取JSAPI授权TICKET"
] | train | https://github.com/sfnt/wechat-php-sdk/blob/d14b8511f96cfcf0da5f413b446e69943cc3ea90/src/qy/Wechat.php#L940-L967 |
sfnt/wechat-php-sdk | src/qy/Wechat.php | Wechat.getMenu | public function getMenu($agentid=''){
if ($agentid=='') {
$agentid=$this->agentid;
}
if (!$this->access_token && !$this->checkAuth()) return false;
$result = $this->http_get(self::API_URL_PREFIX.self::MENU_GET_URL.'access_token='.$this->access_token.'&agentid='.$agentid);
if ($result)
{
$json... | php | public function getMenu($agentid=''){
if ($agentid=='') {
$agentid=$this->agentid;
}
if (!$this->access_token && !$this->checkAuth()) return false;
$result = $this->http_get(self::API_URL_PREFIX.self::MENU_GET_URL.'access_token='.$this->access_token.'&agentid='.$agentid);
if ($result)
{
$json... | [
"public",
"function",
"getMenu",
"(",
"$",
"agentid",
"=",
"''",
")",
"{",
"if",
"(",
"$",
"agentid",
"==",
"''",
")",
"{",
"$",
"agentid",
"=",
"$",
"this",
"->",
"agentid",
";",
"}",
"if",
"(",
"!",
"$",
"this",
"->",
"access_token",
"&&",
"!",... | 获取菜单
@return array('menu'=>array(....s)) | [
"获取菜单"
] | train | https://github.com/sfnt/wechat-php-sdk/blob/d14b8511f96cfcf0da5f413b446e69943cc3ea90/src/qy/Wechat.php#L1119-L1136 |
sfnt/wechat-php-sdk | src/qy/Wechat.php | Wechat.deleteMenu | public function deleteMenu($agentid=''){
if ($agentid=='') {
$agentid=$this->agentid;
}
if (!$this->access_token && !$this->checkAuth()) return false;
$result = $this->http_get(self::API_URL_PREFIX.self::MENU_DELETE_URL.'access_token='.$this->access_token.'&agentid='.$agentid);
if ($result)
{
... | php | public function deleteMenu($agentid=''){
if ($agentid=='') {
$agentid=$this->agentid;
}
if (!$this->access_token && !$this->checkAuth()) return false;
$result = $this->http_get(self::API_URL_PREFIX.self::MENU_DELETE_URL.'access_token='.$this->access_token.'&agentid='.$agentid);
if ($result)
{
... | [
"public",
"function",
"deleteMenu",
"(",
"$",
"agentid",
"=",
"''",
")",
"{",
"if",
"(",
"$",
"agentid",
"==",
"''",
")",
"{",
"$",
"agentid",
"=",
"$",
"this",
"->",
"agentid",
";",
"}",
"if",
"(",
"!",
"$",
"this",
"->",
"access_token",
"&&",
"... | 删除菜单
@return boolean | [
"删除菜单"
] | train | https://github.com/sfnt/wechat-php-sdk/blob/d14b8511f96cfcf0da5f413b446e69943cc3ea90/src/qy/Wechat.php#L1142-L1159 |
sfnt/wechat-php-sdk | src/qy/Wechat.php | Wechat.uploadMedia | public function uploadMedia($data, $type){
if (!$this->access_token && !$this->checkAuth()) return false;
$result = $this->http_post(self::API_URL_PREFIX.self::MEDIA_UPLOAD_URL.'access_token='.$this->access_token.'&type='.$type,$data,true);
if ($result)
{
$json = json_decode($result,true);
if (!$json || !... | php | public function uploadMedia($data, $type){
if (!$this->access_token && !$this->checkAuth()) return false;
$result = $this->http_post(self::API_URL_PREFIX.self::MEDIA_UPLOAD_URL.'access_token='.$this->access_token.'&type='.$type,$data,true);
if ($result)
{
$json = json_decode($result,true);
if (!$json || !... | [
"public",
"function",
"uploadMedia",
"(",
"$",
"data",
",",
"$",
"type",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"access_token",
"&&",
"!",
"$",
"this",
"->",
"checkAuth",
"(",
")",
")",
"return",
"false",
";",
"$",
"result",
"=",
"$",
"this",... | 上传多媒体文件 (只有三天的有效期,过期自动被删除)
注意:上传大文件时可能需要先调用 set_time_limit(0) 避免超时
注意:数组的键值任意,但文件名前必须加@,使用单引号以避免本地路径斜杠被转义
@param array $data {"media":'@Path\filename.jpg'}
@param type 媒体文件类型:图片(image)、语音(voice)、视频(video),普通文件(file)
@return boolean|array
{
"type": "image",
"media_id": "0000001",
"created_at": "1380000000"
} | [
"上传多媒体文件",
"(",
"只有三天的有效期,过期自动被删除",
")",
"注意:上传大文件时可能需要先调用",
"set_time_limit",
"(",
"0",
")",
"避免超时",
"注意:数组的键值任意,但文件名前必须加"
] | train | https://github.com/sfnt/wechat-php-sdk/blob/d14b8511f96cfcf0da5f413b446e69943cc3ea90/src/qy/Wechat.php#L1174-L1188 |
sfnt/wechat-php-sdk | src/qy/Wechat.php | Wechat.getMedia | public function getMedia($media_id){
if (!$this->access_token && !$this->checkAuth()) return false;
$result = $this->http_get(self::API_URL_PREFIX.self::MEDIA_GET_URL.'access_token='.$this->access_token.'&media_id='.$media_id);
if ($result)
{
$json = json_decode($result,true);
if (isset($json['errcode']))... | php | public function getMedia($media_id){
if (!$this->access_token && !$this->checkAuth()) return false;
$result = $this->http_get(self::API_URL_PREFIX.self::MEDIA_GET_URL.'access_token='.$this->access_token.'&media_id='.$media_id);
if ($result)
{
$json = json_decode($result,true);
if (isset($json['errcode']))... | [
"public",
"function",
"getMedia",
"(",
"$",
"media_id",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"access_token",
"&&",
"!",
"$",
"this",
"->",
"checkAuth",
"(",
")",
")",
"return",
"false",
";",
"$",
"result",
"=",
"$",
"this",
"->",
"http_get",
... | 根据媒体文件ID获取媒体文件
@param string $media_id 媒体文件id
@return raw data | [
"根据媒体文件ID获取媒体文件"
] | train | https://github.com/sfnt/wechat-php-sdk/blob/d14b8511f96cfcf0da5f413b446e69943cc3ea90/src/qy/Wechat.php#L1195-L1209 |
sfnt/wechat-php-sdk | src/qy/Wechat.php | Wechat.deleteDepartment | public function deleteDepartment($id){
if (!$this->access_token && !$this->checkAuth()) return false;
$result = $this->http_get(self::API_URL_PREFIX.self::DEPARTMENT_DELETE_URL.'access_token='.$this->access_token.'&id='.$id);
if ($result)
{
$json = json_decode($result,true);
if (!$... | php | public function deleteDepartment($id){
if (!$this->access_token && !$this->checkAuth()) return false;
$result = $this->http_get(self::API_URL_PREFIX.self::DEPARTMENT_DELETE_URL.'access_token='.$this->access_token.'&id='.$id);
if ($result)
{
$json = json_decode($result,true);
if (!$... | [
"public",
"function",
"deleteDepartment",
"(",
"$",
"id",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"access_token",
"&&",
"!",
"$",
"this",
"->",
"checkAuth",
"(",
")",
")",
"return",
"false",
";",
"$",
"result",
"=",
"$",
"this",
"->",
"http_get"... | 删除部门
@param $id
@return boolean|array 成功返回结果
{
"errcode": 0, //返回码
"errmsg": "deleted" //对返回码的文本描述内容
} | [
"删除部门"
] | train | https://github.com/sfnt/wechat-php-sdk/blob/d14b8511f96cfcf0da5f413b446e69943cc3ea90/src/qy/Wechat.php#L1304-L1318 |
sfnt/wechat-php-sdk | src/qy/Wechat.php | Wechat.getDepartment | public function getDepartment(){
if (!$this->access_token && !$this->checkAuth()) return false;
$result = $this->http_get(self::API_URL_PREFIX.self::DEPARTMENT_LIST_URL.'access_token='.$this->access_token);
if ($result)
{
$json = json_decode($result,true);
if (!$json || !empty($jso... | php | public function getDepartment(){
if (!$this->access_token && !$this->checkAuth()) return false;
$result = $this->http_get(self::API_URL_PREFIX.self::DEPARTMENT_LIST_URL.'access_token='.$this->access_token);
if ($result)
{
$json = json_decode($result,true);
if (!$json || !empty($jso... | [
"public",
"function",
"getDepartment",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"access_token",
"&&",
"!",
"$",
"this",
"->",
"checkAuth",
"(",
")",
")",
"return",
"false",
";",
"$",
"result",
"=",
"$",
"this",
"->",
"http_get",
"(",
"self",... | 获取部门列表
@return boolean|array 成功返回结果
{
"errcode": 0,
"errmsg": "ok",
"department": [ //部门列表数据。以部门的order字段从小到大排列
{
"id": 1,
"name": "广州研发中心",
"parentid": 0,
"order": 40
},
{
"id": 2
"name": "邮箱产品部",
"parentid": 1,
"order": 40
}
]
} | [
"获取部门列表"
] | train | https://github.com/sfnt/wechat-php-sdk/blob/d14b8511f96cfcf0da5f413b446e69943cc3ea90/src/qy/Wechat.php#L1372-L1386 |
sfnt/wechat-php-sdk | src/qy/Wechat.php | Wechat.deleteUser | public function deleteUser($userid){
if (!$this->access_token && !$this->checkAuth()) return false;
$result = $this->http_get(self::API_URL_PREFIX.self::USER_DELETE_URL.'access_token='.$this->access_token.'&userid='.$userid);
if ($result)
{
$json = json_decode($result,true);
if (!$... | php | public function deleteUser($userid){
if (!$this->access_token && !$this->checkAuth()) return false;
$result = $this->http_get(self::API_URL_PREFIX.self::USER_DELETE_URL.'access_token='.$this->access_token.'&userid='.$userid);
if ($result)
{
$json = json_decode($result,true);
if (!$... | [
"public",
"function",
"deleteUser",
"(",
"$",
"userid",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"access_token",
"&&",
"!",
"$",
"this",
"->",
"checkAuth",
"(",
")",
")",
"return",
"false",
";",
"$",
"result",
"=",
"$",
"this",
"->",
"http_get",
... | 删除成员
@param $userid 员工UserID。对应管理端的帐号
@return boolean|array 成功返回结果
{
"errcode": 0, //返回码
"errmsg": "deleted" //对返回码的文本描述内容
} | [
"删除成员"
] | train | https://github.com/sfnt/wechat-php-sdk/blob/d14b8511f96cfcf0da5f413b446e69943cc3ea90/src/qy/Wechat.php#L1471-L1485 |
sfnt/wechat-php-sdk | src/qy/Wechat.php | Wechat.deleteUsers | public function deleteUsers($userids){
if (!$userids) return false;
$data = array('useridlist'=>$userids);
if (!$this->access_token && !$this->checkAuth()) return false;
$result = $this->http_post(self::API_URL_PREFIX.self::USER_BATCHDELETE_URL.'access_token='.$this->access_token,self::json_encode($... | php | public function deleteUsers($userids){
if (!$userids) return false;
$data = array('useridlist'=>$userids);
if (!$this->access_token && !$this->checkAuth()) return false;
$result = $this->http_post(self::API_URL_PREFIX.self::USER_BATCHDELETE_URL.'access_token='.$this->access_token,self::json_encode($... | [
"public",
"function",
"deleteUsers",
"(",
"$",
"userids",
")",
"{",
"if",
"(",
"!",
"$",
"userids",
")",
"return",
"false",
";",
"$",
"data",
"=",
"array",
"(",
"'useridlist'",
"=>",
"$",
"userids",
")",
";",
"if",
"(",
"!",
"$",
"this",
"->",
"acc... | 批量删除成员
@param array $userid 员工UserID数组。对应管理端的帐号
{
'userid1',
'userid2',
'userid3',
}
@return boolean|array 成功返回结果
{
"errcode": 0, //返回码
"errmsg": "deleted" //对返回码的文本描述内容
} | [
"批量删除成员"
] | train | https://github.com/sfnt/wechat-php-sdk/blob/d14b8511f96cfcf0da5f413b446e69943cc3ea90/src/qy/Wechat.php#L1501-L1517 |
sfnt/wechat-php-sdk | src/qy/Wechat.php | Wechat.getUserInfo | public function getUserInfo($userid){
if (!$this->access_token && !$this->checkAuth()) return false;
$result = $this->http_get(self::API_URL_PREFIX.self::USER_GET_URL.'access_token='.$this->access_token.'&userid='.$userid);
if ($result)
{
$json = json_decode($result,true);
if (!$js... | php | public function getUserInfo($userid){
if (!$this->access_token && !$this->checkAuth()) return false;
$result = $this->http_get(self::API_URL_PREFIX.self::USER_GET_URL.'access_token='.$this->access_token.'&userid='.$userid);
if ($result)
{
$json = json_decode($result,true);
if (!$js... | [
"public",
"function",
"getUserInfo",
"(",
"$",
"userid",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"access_token",
"&&",
"!",
"$",
"this",
"->",
"checkAuth",
"(",
")",
")",
"return",
"false",
";",
"$",
"result",
"=",
"$",
"this",
"->",
"http_get",... | 获取成员信息
@param $userid 员工UserID。对应管理端的帐号
@return boolean|array 成功返回结果
{
"errcode": 0,
"errmsg": "ok",
"userid": "zhangsan",
"name": "李四",
"department": [1, 2],
"position": "后台工程师",
"mobile": "15913215421",
"gender": 1, //性别。gender=0表示男,=1表示女
"tel": "62394",
"email": "zhangsan@gzdev.com",
"weixinid": "lisifordev", ... | [
"获取成员信息"
] | train | https://github.com/sfnt/wechat-php-sdk/blob/d14b8511f96cfcf0da5f413b446e69943cc3ea90/src/qy/Wechat.php#L1540-L1554 |
sfnt/wechat-php-sdk | src/qy/Wechat.php | Wechat.getUserList | public function getUserList($department_id,$fetch_child=0,$status=0){
if (!$this->access_token && !$this->checkAuth()) return false;
$result = $this->http_get(self::API_URL_PREFIX.self::USER_LIST_URL.'access_token='.$this->access_token
.'&department_id='.$department_id.'&fetch_child='.$fetch_chil... | php | public function getUserList($department_id,$fetch_child=0,$status=0){
if (!$this->access_token && !$this->checkAuth()) return false;
$result = $this->http_get(self::API_URL_PREFIX.self::USER_LIST_URL.'access_token='.$this->access_token
.'&department_id='.$department_id.'&fetch_child='.$fetch_chil... | [
"public",
"function",
"getUserList",
"(",
"$",
"department_id",
",",
"$",
"fetch_child",
"=",
"0",
",",
"$",
"status",
"=",
"0",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"access_token",
"&&",
"!",
"$",
"this",
"->",
"checkAuth",
"(",
")",
")",
... | 获取部门成员
@param $department_id 部门id
@param $fetch_child 1/0:是否递归获取子部门下面的成员
@param $status 0获取全部员工,1获取已关注成员列表,2获取禁用成员列表,4获取未关注成员列表。status可叠加
@return boolean|array 成功返回结果
{
"errcode": 0,
"errmsg": "ok",
"userlist": [
{
"userid": "zhangsan",
"name": "李四"
}
]
} | [
"获取部门成员"
] | train | https://github.com/sfnt/wechat-php-sdk/blob/d14b8511f96cfcf0da5f413b446e69943cc3ea90/src/qy/Wechat.php#L1573-L1588 |
sfnt/wechat-php-sdk | src/qy/Wechat.php | Wechat.getUserId | public function getUserId($code,$agentid=0){
if (!$agentid) $agentid=$this->agentid;
if (!$this->access_token && !$this->checkAuth()) return false;
$result = $this->http_get(self::API_URL_PREFIX.self::USER_GETINFO_URL.'access_token='.$this->access_token.'&code='.$code.'&agentid='.$agentid);
if ($res... | php | public function getUserId($code,$agentid=0){
if (!$agentid) $agentid=$this->agentid;
if (!$this->access_token && !$this->checkAuth()) return false;
$result = $this->http_get(self::API_URL_PREFIX.self::USER_GETINFO_URL.'access_token='.$this->access_token.'&code='.$code.'&agentid='.$agentid);
if ($res... | [
"public",
"function",
"getUserId",
"(",
"$",
"code",
",",
"$",
"agentid",
"=",
"0",
")",
"{",
"if",
"(",
"!",
"$",
"agentid",
")",
"$",
"agentid",
"=",
"$",
"this",
"->",
"agentid",
";",
"if",
"(",
"!",
"$",
"this",
"->",
"access_token",
"&&",
"!... | 根据code获取成员信息
通过Oauth2.0或者设置了二次验证时获取的code,用于换取成员的UserId和DeviceId
@param $code Oauth2.0或者二次验证时返回的code值
@param $agentid 跳转链接时所在的企业应用ID,未填则默认为当前配置的应用id
@return boolean|array 成功返回数组
array(
'UserId' => 'USERID', //员工UserID
'DeviceId' => 'DEVICEID' //手机设备号(由微信在安装时随机生成)
) | [
"根据code获取成员信息",
"通过Oauth2",
".",
"0或者设置了二次验证时获取的code,用于换取成员的UserId和DeviceId"
] | train | https://github.com/sfnt/wechat-php-sdk/blob/d14b8511f96cfcf0da5f413b446e69943cc3ea90/src/qy/Wechat.php#L1646-L1661 |
sfnt/wechat-php-sdk | src/qy/Wechat.php | Wechat.sendInvite | public function sendInvite($userid,$invite_tips=''){
$data = array( 'userid' => $userid );
if (!$invite_tips) {
$data['invite_tips'] = $invite_tips;
}
if (!$this->access_token && !$this->checkAuth()) return false;
$result = $this->http_post(self::API_URL_PREFIX.self::USER_INVITE_URL.'acce... | php | public function sendInvite($userid,$invite_tips=''){
$data = array( 'userid' => $userid );
if (!$invite_tips) {
$data['invite_tips'] = $invite_tips;
}
if (!$this->access_token && !$this->checkAuth()) return false;
$result = $this->http_post(self::API_URL_PREFIX.self::USER_INVITE_URL.'acce... | [
"public",
"function",
"sendInvite",
"(",
"$",
"userid",
",",
"$",
"invite_tips",
"=",
"''",
")",
"{",
"$",
"data",
"=",
"array",
"(",
"'userid'",
"=>",
"$",
"userid",
")",
";",
"if",
"(",
"!",
"$",
"invite_tips",
")",
"{",
"$",
"data",
"[",
"'invit... | 邀请成员关注
向未关注企业号的成员发送关注邀请。认证号优先判断顺序weixinid>手机号>邮箱绑定>邮件;非认证号只能邮件邀请
@param $userid 用户的userid
@param $invite_tips 推送到微信上的提示语(只有认证号可以使用)。当使用微信推送时,该字段默认为“请关注XXX企业号”,邮件邀请时,该字段无效。
@return boolean|array 成功返回数组
array(
'errcode' => 0,
'errmsg' => 'ok',
'type' => 1 //邀请方式 1.微信邀请 2.邮件邀请
) | [
"邀请成员关注",
"向未关注企业号的成员发送关注邀请。认证号优先判断顺序weixinid",
">",
"手机号",
">",
"邮箱绑定",
">",
"邮件;非认证号只能邮件邀请"
] | train | https://github.com/sfnt/wechat-php-sdk/blob/d14b8511f96cfcf0da5f413b446e69943cc3ea90/src/qy/Wechat.php#L1676-L1694 |
sfnt/wechat-php-sdk | src/qy/Wechat.php | Wechat.deleteTag | public function deleteTag($tagid){
if (!$this->access_token && !$this->checkAuth()) return false;
$result = $this->http_get(self::API_URL_PREFIX.self::TAG_DELETE_URL.'access_token='.$this->access_token.'&tagid='.$tagid);
if ($result)
{
$json = json_decode($result,true);
if (!$json ... | php | public function deleteTag($tagid){
if (!$this->access_token && !$this->checkAuth()) return false;
$result = $this->http_get(self::API_URL_PREFIX.self::TAG_DELETE_URL.'access_token='.$this->access_token.'&tagid='.$tagid);
if ($result)
{
$json = json_decode($result,true);
if (!$json ... | [
"public",
"function",
"deleteTag",
"(",
"$",
"tagid",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"access_token",
"&&",
"!",
"$",
"this",
"->",
"checkAuth",
"(",
")",
")",
"return",
"false",
";",
"$",
"result",
"=",
"$",
"this",
"->",
"http_get",
... | 删除标签
@param $tagid 标签TagID
@return boolean|array 成功返回结果
{
"errcode": 0, //返回码
"errmsg": "deleted" //对返回码的文本描述内容
} | [
"删除标签"
] | train | https://github.com/sfnt/wechat-php-sdk/blob/d14b8511f96cfcf0da5f413b446e69943cc3ea90/src/qy/Wechat.php#L1764-L1778 |
sfnt/wechat-php-sdk | src/qy/Wechat.php | Wechat.getTag | public function getTag($tagid){
if (!$this->access_token && !$this->checkAuth()) return false;
$result = $this->http_get(self::API_URL_PREFIX.self::TAG_GET_URL.'access_token='.$this->access_token.'&tagid='.$tagid);
if ($result)
{
$json = json_decode($result,true);
if (!$json || !em... | php | public function getTag($tagid){
if (!$this->access_token && !$this->checkAuth()) return false;
$result = $this->http_get(self::API_URL_PREFIX.self::TAG_GET_URL.'access_token='.$this->access_token.'&tagid='.$tagid);
if ($result)
{
$json = json_decode($result,true);
if (!$json || !em... | [
"public",
"function",
"getTag",
"(",
"$",
"tagid",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"access_token",
"&&",
"!",
"$",
"this",
"->",
"checkAuth",
"(",
")",
")",
"return",
"false",
";",
"$",
"result",
"=",
"$",
"this",
"->",
"http_get",
"("... | 获取标签成员
@param $tagid 标签TagID
@return boolean|array 成功返回结果
{
"errcode": 0,
"errmsg": "ok",
"userlist": [
{
"userid": "zhangsan",
"name": "李四"
}
]
} | [
"获取标签成员"
] | train | https://github.com/sfnt/wechat-php-sdk/blob/d14b8511f96cfcf0da5f413b446e69943cc3ea90/src/qy/Wechat.php#L1795-L1809 |
sfnt/wechat-php-sdk | src/qy/Wechat.php | Wechat.getTagList | public function getTagList(){
if (!$this->access_token && !$this->checkAuth()) return false;
$result = $this->http_get(self::API_URL_PREFIX.self::TAG_LIST_URL.'access_token='.$this->access_token);
if ($result)
{
$json = json_decode($result,true);
if (!$json || !empty($json['errcode... | php | public function getTagList(){
if (!$this->access_token && !$this->checkAuth()) return false;
$result = $this->http_get(self::API_URL_PREFIX.self::TAG_LIST_URL.'access_token='.$this->access_token);
if ($result)
{
$json = json_decode($result,true);
if (!$json || !empty($json['errcode... | [
"public",
"function",
"getTagList",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"access_token",
"&&",
"!",
"$",
"this",
"->",
"checkAuth",
"(",
")",
")",
"return",
"false",
";",
"$",
"result",
"=",
"$",
"this",
"->",
"http_get",
"(",
"self",
... | 获取标签列表
@return boolean|array 成功返回数组结果,这里附上json样例
{
"errcode": 0,
"errmsg": "ok",
"taglist":[
{"tagid":1,"tagname":"a"},
{"tagid":2,"tagname":"b"}
]
} | [
"获取标签列表"
] | train | https://github.com/sfnt/wechat-php-sdk/blob/d14b8511f96cfcf0da5f413b446e69943cc3ea90/src/qy/Wechat.php#L1891-L1905 |
sfnt/wechat-php-sdk | src/qy/Wechat.php | Wechat.authSucc | public function authSucc($userid){
if (!$this->access_token && !$this->checkAuth()) return false;
$result = $this->http_get(self::API_URL_PREFIX.self::AUTHSUCC_URL.'access_token='.$this->access_token.'&userid='.$userid);
if ($result)
{
$json = json_decode($result,true);
if (!$json ... | php | public function authSucc($userid){
if (!$this->access_token && !$this->checkAuth()) return false;
$result = $this->http_get(self::API_URL_PREFIX.self::AUTHSUCC_URL.'access_token='.$this->access_token.'&userid='.$userid);
if ($result)
{
$json = json_decode($result,true);
if (!$json ... | [
"public",
"function",
"authSucc",
"(",
"$",
"userid",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"access_token",
"&&",
"!",
"$",
"this",
"->",
"checkAuth",
"(",
")",
")",
"return",
"false",
";",
"$",
"result",
"=",
"$",
"this",
"->",
"http_get",
... | 二次验证
企业在开启二次验证时,必须填写企业二次验证页面的url。
当员工绑定通讯录中的帐号后,会收到一条图文消息,
引导员工到企业的验证页面验证身份,企业在员工验证成功后,
调用如下接口即可让员工关注成功。
@param $userid
@return boolean|array 成功返回结果
{
"errcode": 0, //返回码
"errmsg": "ok" //对返回码的文本描述内容
} | [
"二次验证",
"企业在开启二次验证时,必须填写企业二次验证页面的url。",
"当员工绑定通讯录中的帐号后,会收到一条图文消息,",
"引导员工到企业的验证页面验证身份,企业在员工验证成功后,",
"调用如下接口即可让员工关注成功。"
] | train | https://github.com/sfnt/wechat-php-sdk/blob/d14b8511f96cfcf0da5f413b446e69943cc3ea90/src/qy/Wechat.php#L2009-L2023 |
vardius/list-bundle | Column/Types/Type/CallableType.php | CallableType.getData | public function getData($entity = null, array $options = []):array
{
$callback = null;
$callable = $options['callback'];
if (is_callable($callable)) {
$callback = call_user_func_array($callable, [$entity]);
}
$action = $options['row_action'];
if (is_arra... | php | public function getData($entity = null, array $options = []):array
{
$callback = null;
$callable = $options['callback'];
if (is_callable($callable)) {
$callback = call_user_func_array($callable, [$entity]);
}
$action = $options['row_action'];
if (is_arra... | [
"public",
"function",
"getData",
"(",
"$",
"entity",
"=",
"null",
",",
"array",
"$",
"options",
"=",
"[",
"]",
")",
":",
"array",
"{",
"$",
"callback",
"=",
"null",
";",
"$",
"callable",
"=",
"$",
"options",
"[",
"'callback'",
"]",
";",
"if",
"(",
... | {@inheritdoc} | [
"{"
] | train | https://github.com/vardius/list-bundle/blob/70d3079ce22eed7dad7c467fee532aa2f18c68c9/Column/Types/Type/CallableType.php#L26-L44 |
heyday/heystack | src/DependencyInjection/SilverStripe/HeystackSilverStripeContainer.php | HeystackSilverStripeContainer.get | public function get($id, $invalidBehavior = self::EXCEPTION_ON_INVALID_REFERENCE)
{
if ($this->isSilverStripeServiceRequest($id)) {
return $this->getSilverStripeService($id);
} else {
return parent::get($id, $invalidBehavior);
}
} | php | public function get($id, $invalidBehavior = self::EXCEPTION_ON_INVALID_REFERENCE)
{
if ($this->isSilverStripeServiceRequest($id)) {
return $this->getSilverStripeService($id);
} else {
return parent::get($id, $invalidBehavior);
}
} | [
"public",
"function",
"get",
"(",
"$",
"id",
",",
"$",
"invalidBehavior",
"=",
"self",
"::",
"EXCEPTION_ON_INVALID_REFERENCE",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"isSilverStripeServiceRequest",
"(",
"$",
"id",
")",
")",
"{",
"return",
"$",
"this",
"->... | Use SilverStripe's Dependency Injection system if the service is namespaced silverstripe
@param string $id
@param int|void $invalidBehavior
@return object | [
"Use",
"SilverStripe",
"s",
"Dependency",
"Injection",
"system",
"if",
"the",
"service",
"is",
"namespaced",
"silverstripe"
] | train | https://github.com/heyday/heystack/blob/2c051933f8c532d0a9a23be6ee1ff5c619e47dfe/src/DependencyInjection/SilverStripe/HeystackSilverStripeContainer.php#L45-L52 |
larakit/lk-staticfiles | src/StaticFiles/Css.php | Css.add | function add($css_file, $media = null, $condition = null, $no_build = false) {
if(!$css_file) {
return $this;
}
$host = config('larakit.lk-staticfiles.host');
if(mb_strpos($css_file, '/') === 0 && mb_strpos($css_file, '/', 1) !== 1) {
$css_file = $host . $cs... | php | function add($css_file, $media = null, $condition = null, $no_build = false) {
if(!$css_file) {
return $this;
}
$host = config('larakit.lk-staticfiles.host');
if(mb_strpos($css_file, '/') === 0 && mb_strpos($css_file, '/', 1) !== 1) {
$css_file = $host . $cs... | [
"function",
"add",
"(",
"$",
"css_file",
",",
"$",
"media",
"=",
"null",
",",
"$",
"condition",
"=",
"null",
",",
"$",
"no_build",
"=",
"false",
")",
"{",
"if",
"(",
"!",
"$",
"css_file",
")",
"{",
"return",
"$",
"this",
";",
"}",
"$",
"host",
... | Add external css file
@param $css_file
@param null $media - condition of use
@param null $condition - condition including script, example [if IE 6]
@param bool $no_build - flag exclude on build
@return $this
<!--[if IE 6]><link rel="stylesheet" href="http://habrahabr.ru/css/1302697277/ie6.css" media="all" /... | [
"Add",
"external",
"css",
"file"
] | train | https://github.com/larakit/lk-staticfiles/blob/1ee718b1f3a00c29c46b06c2f501413599b0335a/src/StaticFiles/Css.php#L42-L57 |
larakit/lk-staticfiles | src/StaticFiles/Css.php | Css.getInline | function getInline($as_html = true) {
if(!$as_html) {
return $this->css_inline;
}
if(!count($this->css_inline)) {
return '';
}
$css_inline = (implode(PHP_EOL, $this->css_inline));
$css_inline = $this->prepare($css_inline, config('larakit.lk... | php | function getInline($as_html = true) {
if(!$as_html) {
return $this->css_inline;
}
if(!count($this->css_inline)) {
return '';
}
$css_inline = (implode(PHP_EOL, $this->css_inline));
$css_inline = $this->prepare($css_inline, config('larakit.lk... | [
"function",
"getInline",
"(",
"$",
"as_html",
"=",
"true",
")",
"{",
"if",
"(",
"!",
"$",
"as_html",
")",
"{",
"return",
"$",
"this",
"->",
"css_inline",
";",
"}",
"if",
"(",
"!",
"count",
"(",
"$",
"this",
"->",
"css_inline",
")",
")",
"{",
"ret... | Формирование инлайновых стилей
@return <type> | [
"Формирование",
"инлайновых",
"стилей"
] | train | https://github.com/larakit/lk-staticfiles/blob/1ee718b1f3a00c29c46b06c2f501413599b0335a/src/StaticFiles/Css.php#L110-L133 |
larakit/lk-staticfiles | src/StaticFiles/Css.php | Css.getExternal | function getExternal($as_html = true) {
if(!$as_html) {
return $this->css_external;
}
if(!count($this->css_external)) {
return '';
}
$css_code = '';
/* если не надо собирать файлы в один */
if(!config('larakit.lk-staticfiles.css.ex... | php | function getExternal($as_html = true) {
if(!$as_html) {
return $this->css_external;
}
if(!count($this->css_external)) {
return '';
}
$css_code = '';
/* если не надо собирать файлы в один */
if(!config('larakit.lk-staticfiles.css.ex... | [
"function",
"getExternal",
"(",
"$",
"as_html",
"=",
"true",
")",
"{",
"if",
"(",
"!",
"$",
"as_html",
")",
"{",
"return",
"$",
"this",
"->",
"css_external",
";",
"}",
"if",
"(",
"!",
"count",
"(",
"$",
"this",
"->",
"css_external",
")",
")",
"{",
... | Внешние стили
@return string | [
"Внешние",
"стили"
] | train | https://github.com/larakit/lk-staticfiles/blob/1ee718b1f3a00c29c46b06c2f501413599b0335a/src/StaticFiles/Css.php#L170-L238 |
mremi/Dolist | src/Mremi/Dolist/Contact/Contact.php | Contact.removeField | public function removeField(Field $field)
{
if ($this->hasField($field)) {
unset($this->fields[$field->getName()]);
return true;
}
return false;
} | php | public function removeField(Field $field)
{
if ($this->hasField($field)) {
unset($this->fields[$field->getName()]);
return true;
}
return false;
} | [
"public",
"function",
"removeField",
"(",
"Field",
"$",
"field",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"hasField",
"(",
"$",
"field",
")",
")",
"{",
"unset",
"(",
"$",
"this",
"->",
"fields",
"[",
"$",
"field",
"->",
"getName",
"(",
")",
"]",
"... | Removes the given field from the fields collection
@param Field $field
@return boolean | [
"Removes",
"the",
"given",
"field",
"from",
"the",
"fields",
"collection"
] | train | https://github.com/mremi/Dolist/blob/452c863aba12ef2965bafdb619c0278f8fc732d0/src/Mremi/Dolist/Contact/Contact.php#L88-L97 |
mremi/Dolist | src/Mremi/Dolist/Contact/Contact.php | Contact.toArray | public function toArray()
{
return array(
'Email' => $this->email,
'Fields' => array_map(function($field) { return $field->toArray(); }, array_values($this->fields)),
'InterestsToAdd' => $this->interestsToAdd,
'InterestsToDelete' => $... | php | public function toArray()
{
return array(
'Email' => $this->email,
'Fields' => array_map(function($field) { return $field->toArray(); }, array_values($this->fields)),
'InterestsToAdd' => $this->interestsToAdd,
'InterestsToDelete' => $... | [
"public",
"function",
"toArray",
"(",
")",
"{",
"return",
"array",
"(",
"'Email'",
"=>",
"$",
"this",
"->",
"email",
",",
"'Fields'",
"=>",
"array_map",
"(",
"function",
"(",
"$",
"field",
")",
"{",
"return",
"$",
"field",
"->",
"toArray",
"(",
")",
... | Gets an array representation
@return array | [
"Gets",
"an",
"array",
"representation"
] | train | https://github.com/mremi/Dolist/blob/452c863aba12ef2965bafdb619c0278f8fc732d0/src/Mremi/Dolist/Contact/Contact.php#L206-L216 |
jasny/router | src/Router/Routes/Glob.php | Glob.createRoute | protected function createRoute($value)
{
if ($value instanceof Route) {
return $value;
}
if (is_array($value)) {
$value = (object)$value;
}
if (is_object($value) && is_callable($value)) {
$value = (object)['fn' => $value];... | php | protected function createRoute($value)
{
if ($value instanceof Route) {
return $value;
}
if (is_array($value)) {
$value = (object)$value;
}
if (is_object($value) && is_callable($value)) {
$value = (object)['fn' => $value];... | [
"protected",
"function",
"createRoute",
"(",
"$",
"value",
")",
"{",
"if",
"(",
"$",
"value",
"instanceof",
"Route",
")",
"{",
"return",
"$",
"value",
";",
"}",
"if",
"(",
"is_array",
"(",
"$",
"value",
")",
")",
"{",
"$",
"value",
"=",
"(",
"objec... | Create a route from an assisiative array or stdClass object
@param Route|\stdClass|array $value
@return Route | [
"Create",
"a",
"route",
"from",
"an",
"assisiative",
"array",
"or",
"stdClass",
"object"
] | train | https://github.com/jasny/router/blob/4c776665ba343150b442c21893946e3d54190896/src/Router/Routes/Glob.php#L39-L58 |
jasny/router | src/Router/Routes/Glob.php | Glob.createRoutes | protected function createRoutes($input)
{
if ($input instanceof \Traversable) {
$input = iterator_to_array($input, true);
} elseif ($input instanceof \stdClass) {
$input = get_object_vars($input);
}
return array_map([$this, 'createRoute'], $input);
} | php | protected function createRoutes($input)
{
if ($input instanceof \Traversable) {
$input = iterator_to_array($input, true);
} elseif ($input instanceof \stdClass) {
$input = get_object_vars($input);
}
return array_map([$this, 'createRoute'], $input);
} | [
"protected",
"function",
"createRoutes",
"(",
"$",
"input",
")",
"{",
"if",
"(",
"$",
"input",
"instanceof",
"\\",
"Traversable",
")",
"{",
"$",
"input",
"=",
"iterator_to_array",
"(",
"$",
"input",
",",
"true",
")",
";",
"}",
"elseif",
"(",
"$",
"inpu... | Create routes from input
@param Route[]|array|stdClass|\Traversable $input
@return type | [
"Create",
"routes",
"from",
"input"
] | train | https://github.com/jasny/router/blob/4c776665ba343150b442c21893946e3d54190896/src/Router/Routes/Glob.php#L66-L75 |
jasny/router | src/Router/Routes/Glob.php | Glob.offsetSet | public function offsetSet($pattern, $value)
{
if (empty($pattern)) {
throw new \BadMethodCallException("Unable to append a Route without a pattern");
}
$route = $this->createRoute($value);
parent::offsetSet($pattern, $route);
} | php | public function offsetSet($pattern, $value)
{
if (empty($pattern)) {
throw new \BadMethodCallException("Unable to append a Route without a pattern");
}
$route = $this->createRoute($value);
parent::offsetSet($pattern, $route);
} | [
"public",
"function",
"offsetSet",
"(",
"$",
"pattern",
",",
"$",
"value",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"pattern",
")",
")",
"{",
"throw",
"new",
"\\",
"BadMethodCallException",
"(",
"\"Unable to append a Route without a pattern\"",
")",
";",
"}",
... | Add a route
@param string $pattern
@param Route|\stdClass|array $value | [
"Add",
"a",
"route"
] | train | https://github.com/jasny/router/blob/4c776665ba343150b442c21893946e3d54190896/src/Router/Routes/Glob.php#L103-L111 |
jasny/router | src/Router/Routes/Glob.php | Glob.fnmatch | public function fnmatch($pattern, $url)
{
$quoted = preg_quote($pattern, '~');
$step1 = strtr($quoted, ['\?' => '[^/]', '\*' => '[^/]*', '/\*\*' => '(?:/.*)?', '#' => '\d+', '\[' => '[',
'\]' => ']', '\-' => '-', '\{' => '{', '\}' => '}']);
$step2 = preg_replace_callback('~{[^}... | php | public function fnmatch($pattern, $url)
{
$quoted = preg_quote($pattern, '~');
$step1 = strtr($quoted, ['\?' => '[^/]', '\*' => '[^/]*', '/\*\*' => '(?:/.*)?', '#' => '\d+', '\[' => '[',
'\]' => ']', '\-' => '-', '\{' => '{', '\}' => '}']);
$step2 = preg_replace_callback('~{[^}... | [
"public",
"function",
"fnmatch",
"(",
"$",
"pattern",
",",
"$",
"url",
")",
"{",
"$",
"quoted",
"=",
"preg_quote",
"(",
"$",
"pattern",
",",
"'~'",
")",
";",
"$",
"step1",
"=",
"strtr",
"(",
"$",
"quoted",
",",
"[",
"'\\?'",
"=>",
"'[^/]'",
",",
... | Match url against wildcard pattern.
@param string $pattern
@param string $url
@return boolean | [
"Match",
"url",
"against",
"wildcard",
"pattern",
"."
] | train | https://github.com/jasny/router/blob/4c776665ba343150b442c21893946e3d54190896/src/Router/Routes/Glob.php#L121-L134 |
jasny/router | src/Router/Routes/Glob.php | Glob.splitRoutePattern | protected function splitRoutePattern($pattern)
{
if (strpos($pattern, ' ') !== false && preg_match_all('/\s+\+(\w+)\b|\s+\-(\w+)\b/', $pattern, $matches)) {
list($path) = preg_split('/\s+/', $pattern, 2);
$inc = isset($matches[1]) ? array_filter($matches[1]) : [];
$excl =... | php | protected function splitRoutePattern($pattern)
{
if (strpos($pattern, ' ') !== false && preg_match_all('/\s+\+(\w+)\b|\s+\-(\w+)\b/', $pattern, $matches)) {
list($path) = preg_split('/\s+/', $pattern, 2);
$inc = isset($matches[1]) ? array_filter($matches[1]) : [];
$excl =... | [
"protected",
"function",
"splitRoutePattern",
"(",
"$",
"pattern",
")",
"{",
"if",
"(",
"strpos",
"(",
"$",
"pattern",
",",
"' '",
")",
"!==",
"false",
"&&",
"preg_match_all",
"(",
"'/\\s+\\+(\\w+)\\b|\\s+\\-(\\w+)\\b/'",
",",
"$",
"pattern",
",",
"$",
"matche... | Split the route pattern in a path + inclusive and exclusive methods
@param string $pattern
@return array [path, inc, excl] | [
"Split",
"the",
"route",
"pattern",
"in",
"a",
"path",
"+",
"inclusive",
"and",
"exclusive",
"methods"
] | train | https://github.com/jasny/router/blob/4c776665ba343150b442c21893946e3d54190896/src/Router/Routes/Glob.php#L142-L155 |
jasny/router | src/Router/Routes/Glob.php | Glob.findRoute | protected function findRoute(UriInterface $url, $method = null)
{
$urlPath = $this->cleanUrl($url->getPath());
$ret = null;
foreach ($this as $pattern => $route) {
list($path, $inc, $excl) = $this->splitRoutePattern($pattern);
if ($path !== '/') $path = rtrim... | php | protected function findRoute(UriInterface $url, $method = null)
{
$urlPath = $this->cleanUrl($url->getPath());
$ret = null;
foreach ($this as $pattern => $route) {
list($path, $inc, $excl) = $this->splitRoutePattern($pattern);
if ($path !== '/') $path = rtrim... | [
"protected",
"function",
"findRoute",
"(",
"UriInterface",
"$",
"url",
",",
"$",
"method",
"=",
"null",
")",
"{",
"$",
"urlPath",
"=",
"$",
"this",
"->",
"cleanUrl",
"(",
"$",
"url",
"->",
"getPath",
"(",
")",
")",
";",
"$",
"ret",
"=",
"null",
";"... | Find a matching route
@param UriInterface $url
@param string $method
@return string | [
"Find",
"a",
"matching",
"route"
] | train | https://github.com/jasny/router/blob/4c776665ba343150b442c21893946e3d54190896/src/Router/Routes/Glob.php#L164-L182 |
jasny/router | src/Router/Routes/Glob.php | Glob.hasRoute | public function hasRoute(ServerRequestInterface $request, $withMethod = true)
{
$route = $this->findRoute($request->getUri(), $withMethod ? $request->getMethod() : null);
return isset($route);
} | php | public function hasRoute(ServerRequestInterface $request, $withMethod = true)
{
$route = $this->findRoute($request->getUri(), $withMethod ? $request->getMethod() : null);
return isset($route);
} | [
"public",
"function",
"hasRoute",
"(",
"ServerRequestInterface",
"$",
"request",
",",
"$",
"withMethod",
"=",
"true",
")",
"{",
"$",
"route",
"=",
"$",
"this",
"->",
"findRoute",
"(",
"$",
"request",
"->",
"getUri",
"(",
")",
",",
"$",
"withMethod",
"?",... | Check if a route for the URL exists
@param ServerRequestInterface $request
@return boolean | [
"Check",
"if",
"a",
"route",
"for",
"the",
"URL",
"exists"
] | train | https://github.com/jasny/router/blob/4c776665ba343150b442c21893946e3d54190896/src/Router/Routes/Glob.php#L191-L195 |
jasny/router | src/Router/Routes/Glob.php | Glob.getRoute | public function getRoute(ServerRequestInterface $request)
{
$url = $request->getUri();
$route = $this->findRoute($url, $request->getMethod());
if ($route) {
$route = $this->bind($route, $request, $this->splitUrl($url->getPath()));
}
return $route... | php | public function getRoute(ServerRequestInterface $request)
{
$url = $request->getUri();
$route = $this->findRoute($url, $request->getMethod());
if ($route) {
$route = $this->bind($route, $request, $this->splitUrl($url->getPath()));
}
return $route... | [
"public",
"function",
"getRoute",
"(",
"ServerRequestInterface",
"$",
"request",
")",
"{",
"$",
"url",
"=",
"$",
"request",
"->",
"getUri",
"(",
")",
";",
"$",
"route",
"=",
"$",
"this",
"->",
"findRoute",
"(",
"$",
"url",
",",
"$",
"request",
"->",
... | Get route for the request
@param ServerRequestInterface $request
@return Route | [
"Get",
"route",
"for",
"the",
"request"
] | train | https://github.com/jasny/router/blob/4c776665ba343150b442c21893946e3d54190896/src/Router/Routes/Glob.php#L203-L213 |
dragosprotung/stc-core | src/Workout/Loader/File.php | File.load | public function load(string $filePath): Workout
{
Assertion::file($filePath);
Assertion::readable($filePath);
$extension = strtolower(pathinfo($filePath, PATHINFO_EXTENSION));
switch ($extension) {
case 'gpx':
$loader = new GPX();
break;
... | php | public function load(string $filePath): Workout
{
Assertion::file($filePath);
Assertion::readable($filePath);
$extension = strtolower(pathinfo($filePath, PATHINFO_EXTENSION));
switch ($extension) {
case 'gpx':
$loader = new GPX();
break;
... | [
"public",
"function",
"load",
"(",
"string",
"$",
"filePath",
")",
":",
"Workout",
"{",
"Assertion",
"::",
"file",
"(",
"$",
"filePath",
")",
";",
"Assertion",
"::",
"readable",
"(",
"$",
"filePath",
")",
";",
"$",
"extension",
"=",
"strtolower",
"(",
... | {@inheritdoc} | [
"{"
] | train | https://github.com/dragosprotung/stc-core/blob/9783e3414294f4ee555a1d538d2807269deeb9e7/src/Workout/Loader/File.php#L18-L36 |
FrenchFrogs/framework | src/Container/Container.php | Container.getInstance | static function getInstance($namespace = null) {
$namespace = is_null($namespace) ? static::NAMESPACE_DEFAULT : $namespace;
if (!array_key_exists($namespace, static::$instances)) {
self::$instances[$namespace] = new static();
}
return self::$instances[$namespace];
} | php | static function getInstance($namespace = null) {
$namespace = is_null($namespace) ? static::NAMESPACE_DEFAULT : $namespace;
if (!array_key_exists($namespace, static::$instances)) {
self::$instances[$namespace] = new static();
}
return self::$instances[$namespace];
} | [
"static",
"function",
"getInstance",
"(",
"$",
"namespace",
"=",
"null",
")",
"{",
"$",
"namespace",
"=",
"is_null",
"(",
"$",
"namespace",
")",
"?",
"static",
"::",
"NAMESPACE_DEFAULT",
":",
"$",
"namespace",
";",
"if",
"(",
"!",
"array_key_exists",
"(",
... | constructor du singleton
@return Container | [
"constructor",
"du",
"singleton"
] | train | https://github.com/FrenchFrogs/framework/blob/a4838c698a5600437e87dac6d35ba8ebe32c4395/src/Container/Container.php#L44-L53 |
movoin/one-swoole | example/app/Events/AcmeListener.php | AcmeListener.listener | public function listener(Event $event)
{
error_log(
$event->context->get(0)->getRequestTarget() . PHP_EOL,
3,
RUNTIME_PATH . '/logs/example.log'
);
} | php | public function listener(Event $event)
{
error_log(
$event->context->get(0)->getRequestTarget() . PHP_EOL,
3,
RUNTIME_PATH . '/logs/example.log'
);
} | [
"public",
"function",
"listener",
"(",
"Event",
"$",
"event",
")",
"{",
"error_log",
"(",
"$",
"event",
"->",
"context",
"->",
"get",
"(",
"0",
")",
"->",
"getRequestTarget",
"(",
")",
".",
"PHP_EOL",
",",
"3",
",",
"RUNTIME_PATH",
".",
"'/logs/example.l... | 监听器
@param \One\Event\Event $event | [
"监听器"
] | train | https://github.com/movoin/one-swoole/blob/b9b175963ead91416cc50902a04e05ff3ef571de/example/app/Events/AcmeListener.php#L33-L40 |
aindong/pluggables | src/Aindong/Pluggables/Handlers/PluggableMakeHandler.php | PluggableMakeHandler.fire | public function fire(Command $console, $slug)
{
$this->console = $console;
$this->slug = strtolower($slug);
$this->name = Str::studly($slug);
if ($this->pluggable->exists($this->slug)) {
$console->comment('Pluggable [{$this->name}] already exists.');
return ... | php | public function fire(Command $console, $slug)
{
$this->console = $console;
$this->slug = strtolower($slug);
$this->name = Str::studly($slug);
if ($this->pluggable->exists($this->slug)) {
$console->comment('Pluggable [{$this->name}] already exists.');
return ... | [
"public",
"function",
"fire",
"(",
"Command",
"$",
"console",
",",
"$",
"slug",
")",
"{",
"$",
"this",
"->",
"console",
"=",
"$",
"console",
";",
"$",
"this",
"->",
"slug",
"=",
"strtolower",
"(",
"$",
"slug",
")",
";",
"$",
"this",
"->",
"name",
... | Fire off the handler.
@param \Aindong\Pluggables\Console\PluggableMakeCommand $console
@param string $slug
@return bool | [
"Fire",
"off",
"the",
"handler",
"."
] | train | https://github.com/aindong/pluggables/blob/bf8bab46fb65268043fb4b98db21f8e0338b5e96/src/Aindong/Pluggables/Handlers/PluggableMakeHandler.php#L100-L113 |
aindong/pluggables | src/Aindong/Pluggables/Handlers/PluggableMakeHandler.php | PluggableMakeHandler.generate | public function generate(Command $console)
{
$this->generateFolders();
$this->generateGitkeep();
$this->generateFiles();
$console->info("Pluggable [{$this->name}] has been created successfully.");
return true;
} | php | public function generate(Command $console)
{
$this->generateFolders();
$this->generateGitkeep();
$this->generateFiles();
$console->info("Pluggable [{$this->name}] has been created successfully.");
return true;
} | [
"public",
"function",
"generate",
"(",
"Command",
"$",
"console",
")",
"{",
"$",
"this",
"->",
"generateFolders",
"(",
")",
";",
"$",
"this",
"->",
"generateGitkeep",
"(",
")",
";",
"$",
"this",
"->",
"generateFiles",
"(",
")",
";",
"$",
"console",
"->... | Generate pluggable folders and files.
@param \Aindong\Pluggables\Console\PluggableMakeCommand $console
@return bool | [
"Generate",
"pluggable",
"folders",
"and",
"files",
"."
] | train | https://github.com/aindong/pluggables/blob/bf8bab46fb65268043fb4b98db21f8e0338b5e96/src/Aindong/Pluggables/Handlers/PluggableMakeHandler.php#L122-L133 |
aindong/pluggables | src/Aindong/Pluggables/Handlers/PluggableMakeHandler.php | PluggableMakeHandler.generateFolders | protected function generateFolders()
{
if (!$this->finder->isDirectory($this->pluggable->getPath())) {
$this->finder->makeDirectory($this->pluggable->getPath());
}
$this->finder->makeDirectory($this->getPluggablePath($this->slug, true));
foreach ($this->folders as $fold... | php | protected function generateFolders()
{
if (!$this->finder->isDirectory($this->pluggable->getPath())) {
$this->finder->makeDirectory($this->pluggable->getPath());
}
$this->finder->makeDirectory($this->getPluggablePath($this->slug, true));
foreach ($this->folders as $fold... | [
"protected",
"function",
"generateFolders",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"finder",
"->",
"isDirectory",
"(",
"$",
"this",
"->",
"pluggable",
"->",
"getPath",
"(",
")",
")",
")",
"{",
"$",
"this",
"->",
"finder",
"->",
"makeDirector... | Generate defined pluggable folders.
@return void | [
"Generate",
"defined",
"pluggable",
"folders",
"."
] | train | https://github.com/aindong/pluggables/blob/bf8bab46fb65268043fb4b98db21f8e0338b5e96/src/Aindong/Pluggables/Handlers/PluggableMakeHandler.php#L140-L151 |
aindong/pluggables | src/Aindong/Pluggables/Handlers/PluggableMakeHandler.php | PluggableMakeHandler.generateFiles | protected function generateFiles()
{
foreach ($this->files as $key => $file) {
$file = $this->formatContent($file);
$this->makeFile($key, $file);
}
} | php | protected function generateFiles()
{
foreach ($this->files as $key => $file) {
$file = $this->formatContent($file);
$this->makeFile($key, $file);
}
} | [
"protected",
"function",
"generateFiles",
"(",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"files",
"as",
"$",
"key",
"=>",
"$",
"file",
")",
"{",
"$",
"file",
"=",
"$",
"this",
"->",
"formatContent",
"(",
"$",
"file",
")",
";",
"$",
"this",
"->",... | Generate defined pluggable files.
@return void | [
"Generate",
"defined",
"pluggable",
"files",
"."
] | train | https://github.com/aindong/pluggables/blob/bf8bab46fb65268043fb4b98db21f8e0338b5e96/src/Aindong/Pluggables/Handlers/PluggableMakeHandler.php#L158-L165 |
aindong/pluggables | src/Aindong/Pluggables/Handlers/PluggableMakeHandler.php | PluggableMakeHandler.generateGitkeep | protected function generateGitkeep()
{
$pluggablePath = $this->getPluggablePath($this->slug);
foreach ($this->folders as $folder) {
$gitkeep = $pluggablePath.$folder.'/.gitkeep';
$this->finder->put($gitkeep, '');
}
} | php | protected function generateGitkeep()
{
$pluggablePath = $this->getPluggablePath($this->slug);
foreach ($this->folders as $folder) {
$gitkeep = $pluggablePath.$folder.'/.gitkeep';
$this->finder->put($gitkeep, '');
}
} | [
"protected",
"function",
"generateGitkeep",
"(",
")",
"{",
"$",
"pluggablePath",
"=",
"$",
"this",
"->",
"getPluggablePath",
"(",
"$",
"this",
"->",
"slug",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"folders",
"as",
"$",
"folder",
")",
"{",
"$",
"gi... | Generate .gitkeep files within generated folders.
@return null | [
"Generate",
".",
"gitkeep",
"files",
"within",
"generated",
"folders",
"."
] | train | https://github.com/aindong/pluggables/blob/bf8bab46fb65268043fb4b98db21f8e0338b5e96/src/Aindong/Pluggables/Handlers/PluggableMakeHandler.php#L172-L181 |
aindong/pluggables | src/Aindong/Pluggables/Handlers/PluggableMakeHandler.php | PluggableMakeHandler.makeFile | protected function makeFile($key, $file)
{
return $this->finder->put($this->getDestinationFile($file), $this->getStubContent($key));
} | php | protected function makeFile($key, $file)
{
return $this->finder->put($this->getDestinationFile($file), $this->getStubContent($key));
} | [
"protected",
"function",
"makeFile",
"(",
"$",
"key",
",",
"$",
"file",
")",
"{",
"return",
"$",
"this",
"->",
"finder",
"->",
"put",
"(",
"$",
"this",
"->",
"getDestinationFile",
"(",
"$",
"file",
")",
",",
"$",
"this",
"->",
"getStubContent",
"(",
... | Create pluggable file.
@param int $key
@param string $file
@return int | [
"Create",
"pluggable",
"file",
"."
] | train | https://github.com/aindong/pluggables/blob/bf8bab46fb65268043fb4b98db21f8e0338b5e96/src/Aindong/Pluggables/Handlers/PluggableMakeHandler.php#L191-L194 |
aindong/pluggables | src/Aindong/Pluggables/Handlers/PluggableMakeHandler.php | PluggableMakeHandler.getPluggablePath | protected function getPluggablePath($slug = null, $allowNotExists = false)
{
if ($slug) {
return $this->pluggable->getPluggablePath($slug, $allowNotExists);
}
return $this->pluggable->getPath();
} | php | protected function getPluggablePath($slug = null, $allowNotExists = false)
{
if ($slug) {
return $this->pluggable->getPluggablePath($slug, $allowNotExists);
}
return $this->pluggable->getPath();
} | [
"protected",
"function",
"getPluggablePath",
"(",
"$",
"slug",
"=",
"null",
",",
"$",
"allowNotExists",
"=",
"false",
")",
"{",
"if",
"(",
"$",
"slug",
")",
"{",
"return",
"$",
"this",
"->",
"pluggable",
"->",
"getPluggablePath",
"(",
"$",
"slug",
",",
... | Get the path to the pluggable.
@param string $slug
@return string | [
"Get",
"the",
"path",
"to",
"the",
"pluggable",
"."
] | train | https://github.com/aindong/pluggables/blob/bf8bab46fb65268043fb4b98db21f8e0338b5e96/src/Aindong/Pluggables/Handlers/PluggableMakeHandler.php#L203-L210 |
aindong/pluggables | src/Aindong/Pluggables/Handlers/PluggableMakeHandler.php | PluggableMakeHandler.getStubContent | protected function getStubContent($key)
{
return $this->formatContent($this->finder->get(__DIR__.'/../Console/stubs/'.$this->stubs[$key]));
} | php | protected function getStubContent($key)
{
return $this->formatContent($this->finder->get(__DIR__.'/../Console/stubs/'.$this->stubs[$key]));
} | [
"protected",
"function",
"getStubContent",
"(",
"$",
"key",
")",
"{",
"return",
"$",
"this",
"->",
"formatContent",
"(",
"$",
"this",
"->",
"finder",
"->",
"get",
"(",
"__DIR__",
".",
"'/../Console/stubs/'",
".",
"$",
"this",
"->",
"stubs",
"[",
"$",
"ke... | Get stub content by key.
@param int $key
@return string | [
"Get",
"stub",
"content",
"by",
"key",
"."
] | train | https://github.com/aindong/pluggables/blob/bf8bab46fb65268043fb4b98db21f8e0338b5e96/src/Aindong/Pluggables/Handlers/PluggableMakeHandler.php#L231-L234 |
aindong/pluggables | src/Aindong/Pluggables/Handlers/PluggableMakeHandler.php | PluggableMakeHandler.formatContent | protected function formatContent($content)
{
return str_replace(
['{{slug}}', '{{name}}', '{{namespace}}'],
[$this->slug, $this->name, $this->pluggable->getNamespace()],
$content
);
} | php | protected function formatContent($content)
{
return str_replace(
['{{slug}}', '{{name}}', '{{namespace}}'],
[$this->slug, $this->name, $this->pluggable->getNamespace()],
$content
);
} | [
"protected",
"function",
"formatContent",
"(",
"$",
"content",
")",
"{",
"return",
"str_replace",
"(",
"[",
"'{{slug}}'",
",",
"'{{name}}'",
",",
"'{{namespace}}'",
"]",
",",
"[",
"$",
"this",
"->",
"slug",
",",
"$",
"this",
"->",
"name",
",",
"$",
"this... | Replace placeholder text with correct values.
@return string | [
"Replace",
"placeholder",
"text",
"with",
"correct",
"values",
"."
] | train | https://github.com/aindong/pluggables/blob/bf8bab46fb65268043fb4b98db21f8e0338b5e96/src/Aindong/Pluggables/Handlers/PluggableMakeHandler.php#L241-L248 |
acasademont/wurfl | WURFL/Handlers/OperaMobiOrTabletOnAndroidHandler.php | WURFL_Handlers_OperaMobiOrTabletOnAndroidHandler.getOperaOnAndroidVersion | public static function getOperaOnAndroidVersion($ua, $use_default=true)
{
if (preg_match('/Version\/(\d\d)/', $ua, $matches)) {
$version = $matches[1];
if (in_array($version, self::$validOperaVersions)) {
return $version;
}
}
return $use_de... | php | public static function getOperaOnAndroidVersion($ua, $use_default=true)
{
if (preg_match('/Version\/(\d\d)/', $ua, $matches)) {
$version = $matches[1];
if (in_array($version, self::$validOperaVersions)) {
return $version;
}
}
return $use_de... | [
"public",
"static",
"function",
"getOperaOnAndroidVersion",
"(",
"$",
"ua",
",",
"$",
"use_default",
"=",
"true",
")",
"{",
"if",
"(",
"preg_match",
"(",
"'/Version\\/(\\d\\d)/'",
",",
"$",
"ua",
",",
"$",
"matches",
")",
")",
"{",
"$",
"version",
"=",
"... | Get the Opera browser version from an Opera Android user agent
@param string $ua User Agent
@param boolean $use_default Return the default version on fail, else return null
@return string Opera version
@see self::$defaultOperaVersion | [
"Get",
"the",
"Opera",
"browser",
"version",
"from",
"an",
"Opera",
"Android",
"user",
"agent"
] | train | https://github.com/acasademont/wurfl/blob/0f4fb6e06b452ba95ad1d15e7d8226d0974b60c2/WURFL/Handlers/OperaMobiOrTabletOnAndroidHandler.php#L103-L112 |
prooph/link-app-core | src/SharedKernel/Factory/LocationTranslatorFactory.php | LocationTranslatorFactory.createService | public function createService(ServiceLocatorInterface $serviceLocator)
{
$config = $serviceLocator->get('config');
$locations = isset($config['locations'])? $config['locations'] : [];
return new LocationTranslator($locations);
} | php | public function createService(ServiceLocatorInterface $serviceLocator)
{
$config = $serviceLocator->get('config');
$locations = isset($config['locations'])? $config['locations'] : [];
return new LocationTranslator($locations);
} | [
"public",
"function",
"createService",
"(",
"ServiceLocatorInterface",
"$",
"serviceLocator",
")",
"{",
"$",
"config",
"=",
"$",
"serviceLocator",
"->",
"get",
"(",
"'config'",
")",
";",
"$",
"locations",
"=",
"isset",
"(",
"$",
"config",
"[",
"'locations'",
... | Create service
@param ServiceLocatorInterface $serviceLocator
@return mixed | [
"Create",
"service"
] | train | https://github.com/prooph/link-app-core/blob/835a5945dfa7be7b2cebfa6e84e757ecfd783357/src/SharedKernel/Factory/LocationTranslatorFactory.php#L33-L40 |
o2system/filesystem | src/Files/CsvFile.php | CsvFile.readFile | public function readFile($filePath = null, array $options = [])
{
$filePath = empty($filePath)
? $this->filePath
: $filePath;
$defaultOptions = [
'length' => 1000,
'delimiter' => ',',
];
$options = array_merge($defaultOp... | php | public function readFile($filePath = null, array $options = [])
{
$filePath = empty($filePath)
? $this->filePath
: $filePath;
$defaultOptions = [
'length' => 1000,
'delimiter' => ',',
];
$options = array_merge($defaultOp... | [
"public",
"function",
"readFile",
"(",
"$",
"filePath",
"=",
"null",
",",
"array",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"$",
"filePath",
"=",
"empty",
"(",
"$",
"filePath",
")",
"?",
"$",
"this",
"->",
"filePath",
":",
"$",
"filePath",
";",
"$"... | CsvFile::readFile
@param string $filePath Path to the file.
@param array $options Read file options.
@return mixed | [
"CsvFile",
"::",
"readFile"
] | train | https://github.com/o2system/filesystem/blob/58f6515f56bcc92408dc155add570c99a0abb6e8/src/Files/CsvFile.php#L45-L67 |
o2system/filesystem | src/Files/CsvFile.php | CsvFile.writeFile | public function writeFile($filePath = null, array $options = [])
{
$filePath = empty($filePath)
? $this->filePath
: $filePath;
$handle = (new File())->create($filePath);
foreach ($this->getArrayCopy() as $key => $value) {
if ( ! is_array($value)... | php | public function writeFile($filePath = null, array $options = [])
{
$filePath = empty($filePath)
? $this->filePath
: $filePath;
$handle = (new File())->create($filePath);
foreach ($this->getArrayCopy() as $key => $value) {
if ( ! is_array($value)... | [
"public",
"function",
"writeFile",
"(",
"$",
"filePath",
"=",
"null",
",",
"array",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"$",
"filePath",
"=",
"empty",
"(",
"$",
"filePath",
")",
"?",
"$",
"this",
"->",
"filePath",
":",
"$",
"filePath",
";",
"$... | CsvFile::writeFile
@param string $filePath Path to the file.
@param array $options Write file options.
@return bool Returns TRUE on success or FALSE on failure. | [
"CsvFile",
"::",
"writeFile"
] | train | https://github.com/o2system/filesystem/blob/58f6515f56bcc92408dc155add570c99a0abb6e8/src/Files/CsvFile.php#L79-L97 |
avoo/SerializerTranslation | Configuration/Metadata/ClassMetadata.php | ClassMetadata.merge | public function merge(MergeableInterface $object)
{
if (!$object instanceof self) {
throw new \InvalidArgumentException(sprintf('Object must be an instance of %s.', __CLASS__));
}
parent::merge($object);
} | php | public function merge(MergeableInterface $object)
{
if (!$object instanceof self) {
throw new \InvalidArgumentException(sprintf('Object must be an instance of %s.', __CLASS__));
}
parent::merge($object);
} | [
"public",
"function",
"merge",
"(",
"MergeableInterface",
"$",
"object",
")",
"{",
"if",
"(",
"!",
"$",
"object",
"instanceof",
"self",
")",
"{",
"throw",
"new",
"\\",
"InvalidArgumentException",
"(",
"sprintf",
"(",
"'Object must be an instance of %s.'",
",",
"... | {@inheritDoc} | [
"{"
] | train | https://github.com/avoo/SerializerTranslation/blob/e66de5482adb944197a36874465ef144b293a157/Configuration/Metadata/ClassMetadata.php#L78-L85 |
avoo/SerializerTranslation | Configuration/Metadata/ClassMetadata.php | ClassMetadata.unserialize | public function unserialize($str)
{
list(
$parentStr,
$this->propertiesToTranslate
) = unserialize($str);
parent::unserialize($parentStr);
} | php | public function unserialize($str)
{
list(
$parentStr,
$this->propertiesToTranslate
) = unserialize($str);
parent::unserialize($parentStr);
} | [
"public",
"function",
"unserialize",
"(",
"$",
"str",
")",
"{",
"list",
"(",
"$",
"parentStr",
",",
"$",
"this",
"->",
"propertiesToTranslate",
")",
"=",
"unserialize",
"(",
"$",
"str",
")",
";",
"parent",
"::",
"unserialize",
"(",
"$",
"parentStr",
")",... | {@inheritDoc} | [
"{"
] | train | https://github.com/avoo/SerializerTranslation/blob/e66de5482adb944197a36874465ef144b293a157/Configuration/Metadata/ClassMetadata.php#L101-L110 |
fuzz-productions/laravel-api-data | src/Traits/HasS3File.php | HasS3File.pushToS3 | public function pushToS3($file, $path = null, $visibility = 'private', $random_name_length = false)
{
if (App::runningInConsole()) {
// If we're in console, don't check (for seeders)
return $file;
}
if (! $file->getSize() || ! ($file instanceof File)) {
throw new BadRequestException(
'The file coul... | php | public function pushToS3($file, $path = null, $visibility = 'private', $random_name_length = false)
{
if (App::runningInConsole()) {
// If we're in console, don't check (for seeders)
return $file;
}
if (! $file->getSize() || ! ($file instanceof File)) {
throw new BadRequestException(
'The file coul... | [
"public",
"function",
"pushToS3",
"(",
"$",
"file",
",",
"$",
"path",
"=",
"null",
",",
"$",
"visibility",
"=",
"'private'",
",",
"$",
"random_name_length",
"=",
"false",
")",
"{",
"if",
"(",
"App",
"::",
"runningInConsole",
"(",
")",
")",
"{",
"// If ... | Upload a file
Is this not working? Check your max file upload size in php.ini
@param \Symfony\Component\HttpFoundation\File\File|string $file
@param null $path
@param string $visibility
@param bool ... | [
"Upload",
"a",
"file"
] | train | https://github.com/fuzz-productions/laravel-api-data/blob/25e181860d2f269b3b212195944c2bca95b411bb/src/Traits/HasS3File.php#L32-L63 |
fuzz-productions/laravel-api-data | src/Traits/HasS3File.php | HasS3File.getFileUrl | public function getFileUrl($key, $path = null)
{
if (is_null($key)) {
return null;
}
$bucket = config('filesystems.disks.s3.bucket');
$client = Storage::disk('s3')->getAdapter()->getClient();
return $this->getRealUrl($client->getObjectUrl($bucket, $path . $key));
} | php | public function getFileUrl($key, $path = null)
{
if (is_null($key)) {
return null;
}
$bucket = config('filesystems.disks.s3.bucket');
$client = Storage::disk('s3')->getAdapter()->getClient();
return $this->getRealUrl($client->getObjectUrl($bucket, $path . $key));
} | [
"public",
"function",
"getFileUrl",
"(",
"$",
"key",
",",
"$",
"path",
"=",
"null",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"key",
")",
")",
"{",
"return",
"null",
";",
"}",
"$",
"bucket",
"=",
"config",
"(",
"'filesystems.disks.s3.bucket'",
")",
"... | Retrieve a file URL
@param string $key
@param null|string $path
@return null|string | [
"Retrieve",
"a",
"file",
"URL"
] | train | https://github.com/fuzz-productions/laravel-api-data/blob/25e181860d2f269b3b212195944c2bca95b411bb/src/Traits/HasS3File.php#L72-L82 |
fuzz-productions/laravel-api-data | src/Traits/HasS3File.php | HasS3File.getRealUrl | public function getRealUrl($url)
{
if (config('services.cdn.base_url')) {
$s3_url = self::$s3_base_url . config('filesystems.disks.s3.bucket') . '/';
return str_replace($s3_url, config('services.cdn.base_url'), $url);
} else {
return $url;
}
} | php | public function getRealUrl($url)
{
if (config('services.cdn.base_url')) {
$s3_url = self::$s3_base_url . config('filesystems.disks.s3.bucket') . '/';
return str_replace($s3_url, config('services.cdn.base_url'), $url);
} else {
return $url;
}
} | [
"public",
"function",
"getRealUrl",
"(",
"$",
"url",
")",
"{",
"if",
"(",
"config",
"(",
"'services.cdn.base_url'",
")",
")",
"{",
"$",
"s3_url",
"=",
"self",
"::",
"$",
"s3_base_url",
".",
"config",
"(",
"'filesystems.disks.s3.bucket'",
")",
".",
"'/'",
"... | Determine if the base S3 url needs to be switched out with a CDN url
@param string $url
@return mixed | [
"Determine",
"if",
"the",
"base",
"S3",
"url",
"needs",
"to",
"be",
"switched",
"out",
"with",
"a",
"CDN",
"url"
] | train | https://github.com/fuzz-productions/laravel-api-data/blob/25e181860d2f269b3b212195944c2bca95b411bb/src/Traits/HasS3File.php#L90-L99 |
phramework/validate | src/Validate.php | Validate.registerCustomType | public static function registerCustomType($type, $callback)
{
if (!is_callable($callback)) {
throw new \Exception(__('callback_is_not_function_exception'));
}
self::$custom_types[$type]= ['callback' => $callback];
} | php | public static function registerCustomType($type, $callback)
{
if (!is_callable($callback)) {
throw new \Exception(__('callback_is_not_function_exception'));
}
self::$custom_types[$type]= ['callback' => $callback];
} | [
"public",
"static",
"function",
"registerCustomType",
"(",
"$",
"type",
",",
"$",
"callback",
")",
"{",
"if",
"(",
"!",
"is_callable",
"(",
"$",
"callback",
")",
")",
"{",
"throw",
"new",
"\\",
"Exception",
"(",
"__",
"(",
"'callback_is_not_function_exceptio... | Register a custom data type
It can be used to validate models
@param string $type
@param function $callback
@throws \Exception | [
"Register",
"a",
"custom",
"data",
"type"
] | train | https://github.com/phramework/validate/blob/22dd3c4e5f7a77a1a75d92f98444f3e4b7ce5cfc/src/Validate.php#L151-L158 |
phramework/validate | src/Validate.php | Validate.validateCustomType | public static function validateCustomType($type, $value, $field_name, $model = [])
{
if (!isset(self::$custom_types[$type])) {
throw new \Exception('type_not_found');
}
$callback = self::$custom_types[$type]['callback'];
$output = false;
if ($callback($value, $m... | php | public static function validateCustomType($type, $value, $field_name, $model = [])
{
if (!isset(self::$custom_types[$type])) {
throw new \Exception('type_not_found');
}
$callback = self::$custom_types[$type]['callback'];
$output = false;
if ($callback($value, $m... | [
"public",
"static",
"function",
"validateCustomType",
"(",
"$",
"type",
",",
"$",
"value",
",",
"$",
"field_name",
",",
"$",
"model",
"=",
"[",
"]",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"self",
"::",
"$",
"custom_types",
"[",
"$",
"type",
"]",
"... | Validate a custom data type.
This method uses previous custom-defined datatype to validate it's data.
@param string $type Custom type's name
@param mixed $value Value to test
@param string $field_name [optional] field's name
@param array $model [optional]
@throws \Exception type_not_found
@throws IncorrectParameters i... | [
"Validate",
"a",
"custom",
"data",
"type",
"."
] | train | https://github.com/phramework/validate/blob/22dd3c4e5f7a77a1a75d92f98444f3e4b7ce5cfc/src/Validate.php#L171-L187 |
phramework/validate | src/Validate.php | Validate.model | public static function model(&$parameters, $model)
{
//holds incorrect fields
$incorrect = [];
//holds missing fields
$missing = [];
foreach ($model as $key => $value) {
if (!isset($parameters[$key])) {
if (is_array($value) && (
... | php | public static function model(&$parameters, $model)
{
//holds incorrect fields
$incorrect = [];
//holds missing fields
$missing = [];
foreach ($model as $key => $value) {
if (!isset($parameters[$key])) {
if (is_array($value) && (
... | [
"public",
"static",
"function",
"model",
"(",
"&",
"$",
"parameters",
",",
"$",
"model",
")",
"{",
"//holds incorrect fields",
"$",
"incorrect",
"=",
"[",
"]",
";",
"//holds missing fields",
"$",
"missing",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"model",... | Validate a model
This method accepts a request model, and validates.
The values of $parameters array might be changed due to type casting.
@param array $parameters Request parameters
@param array $model Model used for the validation
@return boolean
@throws \Exception
@throws IncorrectParameters If any field is incorre... | [
"Validate",
"a",
"model"
] | train | https://github.com/phramework/validate/blob/22dd3c4e5f7a77a1a75d92f98444f3e4b7ce5cfc/src/Validate.php#L210-L564 |
phramework/validate | src/Validate.php | Validate.isValidJsonpCallback | public function isValidJsonpCallback($subject)
{
$identifier_syntax
= '/^[$_\p{L}][$_\p{L}\p{Mn}\p{Mc}\p{Nd}\p{Pc}\x{200C}\x{200D}]*+$/u';
$reserved_words = array('break', 'do', 'instanceof', 'typeof', 'case',
'else', 'new', 'var', 'catch', 'finally', 'return', 'void', 'continue... | php | public function isValidJsonpCallback($subject)
{
$identifier_syntax
= '/^[$_\p{L}][$_\p{L}\p{Mn}\p{Mc}\p{Nd}\p{Pc}\x{200C}\x{200D}]*+$/u';
$reserved_words = array('break', 'do', 'instanceof', 'typeof', 'case',
'else', 'new', 'var', 'catch', 'finally', 'return', 'void', 'continue... | [
"public",
"function",
"isValidJsonpCallback",
"(",
"$",
"subject",
")",
"{",
"$",
"identifier_syntax",
"=",
"'/^[$_\\p{L}][$_\\p{L}\\p{Mn}\\p{Mc}\\p{Nd}\\p{Pc}\\x{200C}\\x{200D}]*+$/u'",
";",
"$",
"reserved_words",
"=",
"array",
"(",
"'break'",
",",
"'do'",
",",
"'instanc... | Check if callback is valid
@link http://www.geekality.net/2010/06/27/php-how-to-easily-provide-json-and-jsonp/ source
@param string $subject
@return boolean | [
"Check",
"if",
"callback",
"is",
"valid"
] | train | https://github.com/phramework/validate/blob/22dd3c4e5f7a77a1a75d92f98444f3e4b7ce5cfc/src/Validate.php#L572-L587 |
phramework/validate | src/Validate.php | Validate.int | public static function int($input, $min = null, $max = null, $field_name = 'int')
{
//Define trivial model
$model = [
$field_name => ['type' => Validate::TYPE_INT, Validate::REQUIRED]
];
if ($min !== null) {
$model[$field_name]['min'] = $min;
}
... | php | public static function int($input, $min = null, $max = null, $field_name = 'int')
{
//Define trivial model
$model = [
$field_name => ['type' => Validate::TYPE_INT, Validate::REQUIRED]
];
if ($min !== null) {
$model[$field_name]['min'] = $min;
}
... | [
"public",
"static",
"function",
"int",
"(",
"$",
"input",
",",
"$",
"min",
"=",
"null",
",",
"$",
"max",
"=",
"null",
",",
"$",
"field_name",
"=",
"'int'",
")",
"{",
"//Define trivial model",
"$",
"model",
"=",
"[",
"$",
"field_name",
"=>",
"[",
"'ty... | Validate a signed integer
@param string|integer $input Input value
@param integer|null $min Minimum value. [optional] Default is NULL, if NULL then the minum value is skipped
@param integer|null $max Maximum value. [optional] Default is NULL, if NULL then the maximum value is skipped
@param string $field_name [optiona... | [
"Validate",
"a",
"signed",
"integer"
] | train | https://github.com/phramework/validate/blob/22dd3c4e5f7a77a1a75d92f98444f3e4b7ce5cfc/src/Validate.php#L599-L618 |
phramework/validate | src/Validate.php | Validate.uint | public static function uint($input, $min = 0, $max = null, $field_name = 'uint')
{
//Define trivial model
$model = [
$field_name => ['type' => Validate::TYPE_UINT, Validate::REQUIRED]
];
$model[$field_name]['min'] = $min;
if ($max !== null) {
$model[... | php | public static function uint($input, $min = 0, $max = null, $field_name = 'uint')
{
//Define trivial model
$model = [
$field_name => ['type' => Validate::TYPE_UINT, Validate::REQUIRED]
];
$model[$field_name]['min'] = $min;
if ($max !== null) {
$model[... | [
"public",
"static",
"function",
"uint",
"(",
"$",
"input",
",",
"$",
"min",
"=",
"0",
",",
"$",
"max",
"=",
"null",
",",
"$",
"field_name",
"=",
"'uint'",
")",
"{",
"//Define trivial model",
"$",
"model",
"=",
"[",
"$",
"field_name",
"=>",
"[",
"'typ... | Validate an unsigned integer
@param string|integer $input Input value
@param integer $min Minimum value. Optional default is 0.
@param integer|null $max Maximum value. Optional default is NULL, if NULL then the maximum value is skipped
@param String $field_name Field's name, used in IncorrectParametersException. Option... | [
"Validate",
"an",
"unsigned",
"integer"
] | train | https://github.com/phramework/validate/blob/22dd3c4e5f7a77a1a75d92f98444f3e4b7ce5cfc/src/Validate.php#L629-L646 |
phramework/validate | src/Validate.php | Validate.float | public static function float($input, $min = null, $max = null, $field_name = 'float')
{
//Define trivial model
$model = [
$field_name => ['type' => Validate::TYPE_FLOAT, Validate::REQUIRED]
];
if ($min !== null) {
$model[$field_name]['min'] = $min;
}
... | php | public static function float($input, $min = null, $max = null, $field_name = 'float')
{
//Define trivial model
$model = [
$field_name => ['type' => Validate::TYPE_FLOAT, Validate::REQUIRED]
];
if ($min !== null) {
$model[$field_name]['min'] = $min;
}
... | [
"public",
"static",
"function",
"float",
"(",
"$",
"input",
",",
"$",
"min",
"=",
"null",
",",
"$",
"max",
"=",
"null",
",",
"$",
"field_name",
"=",
"'float'",
")",
"{",
"//Define trivial model",
"$",
"model",
"=",
"[",
"$",
"field_name",
"=>",
"[",
... | Validate a floating point number
@param string|float|int $input
@param float|null $min Minimum value. Optional default is NULL, if NULL then the minum value is skipped
@param float|null Maximum value. Optional default is NULL, if NULL then the maximum value is skipped
@param string $field_name [optional] Field's name, ... | [
"Validate",
"a",
"floating",
"point",
"number"
] | train | https://github.com/phramework/validate/blob/22dd3c4e5f7a77a1a75d92f98444f3e4b7ce5cfc/src/Validate.php#L658-L677 |
phramework/validate | src/Validate.php | Validate.double | public static function double($input, $min = null, $max = null, $field_name = 'double')
{
//Define trivial model
$model = [
$field_name => ['type' => Validate::TYPE_DOUBLE, Validate::REQUIRED]
];
if ($min !== null) {
$model[$field_name]['min'] = $min;
... | php | public static function double($input, $min = null, $max = null, $field_name = 'double')
{
//Define trivial model
$model = [
$field_name => ['type' => Validate::TYPE_DOUBLE, Validate::REQUIRED]
];
if ($min !== null) {
$model[$field_name]['min'] = $min;
... | [
"public",
"static",
"function",
"double",
"(",
"$",
"input",
",",
"$",
"min",
"=",
"null",
",",
"$",
"max",
"=",
"null",
",",
"$",
"field_name",
"=",
"'double'",
")",
"{",
"//Define trivial model",
"$",
"model",
"=",
"[",
"$",
"field_name",
"=>",
"[",
... | Validate a double presision floating point number
@param string|double|float|int $input
@param double|null $min Minimum value. Optional default is NULL, if NULL then the minum value is skipped
@param double|null Maximum value. Optional default is NULL, if NULL then the maximum value is skipped
@param string $field_name... | [
"Validate",
"a",
"double",
"presision",
"floating",
"point",
"number"
] | train | https://github.com/phramework/validate/blob/22dd3c4e5f7a77a1a75d92f98444f3e4b7ce5cfc/src/Validate.php#L689-L708 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.