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 |
|---|---|---|---|---|---|---|---|---|---|---|
movoin/one-swoole | src/FileSystem/Manager.php | Manager.copy | public function copy(string $from, string $to, array $config = []): bool
{
list($prefixFrom, $from) = $this->getPrefixAndPath($from);
if (($buffer = $this->getFileSystem($prefixFrom)->readStream($from)) === false) {
return false;
}
unset($prefixFrom, $from);
li... | php | public function copy(string $from, string $to, array $config = []): bool
{
list($prefixFrom, $from) = $this->getPrefixAndPath($from);
if (($buffer = $this->getFileSystem($prefixFrom)->readStream($from)) === false) {
return false;
}
unset($prefixFrom, $from);
li... | [
"public",
"function",
"copy",
"(",
"string",
"$",
"from",
",",
"string",
"$",
"to",
",",
"array",
"$",
"config",
"=",
"[",
"]",
")",
":",
"bool",
"{",
"list",
"(",
"$",
"prefixFrom",
",",
"$",
"from",
")",
"=",
"$",
"this",
"->",
"getPrefixAndPath"... | 复制文件
@param string $from
@param string $to
@param array $config
@return bool | [
"复制文件"
] | train | https://github.com/movoin/one-swoole/blob/b9b175963ead91416cc50902a04e05ff3ef571de/src/FileSystem/Manager.php#L130-L148 |
movoin/one-swoole | src/FileSystem/Manager.php | Manager.move | public function move(string $from, string $to, array $config = []): bool
{
list($prefixFrom, $pathFrom) = $this->getPrefixAndPath($from);
list($prefixTo, $pathTo) = $this->getPrefixAndPath($to);
if ($prefixFrom === $prefixTo) {
$fs = $this->getFileSystem($prefixFrom);
... | php | public function move(string $from, string $to, array $config = []): bool
{
list($prefixFrom, $pathFrom) = $this->getPrefixAndPath($from);
list($prefixTo, $pathTo) = $this->getPrefixAndPath($to);
if ($prefixFrom === $prefixTo) {
$fs = $this->getFileSystem($prefixFrom);
... | [
"public",
"function",
"move",
"(",
"string",
"$",
"from",
",",
"string",
"$",
"to",
",",
"array",
"$",
"config",
"=",
"[",
"]",
")",
":",
"bool",
"{",
"list",
"(",
"$",
"prefixFrom",
",",
"$",
"pathFrom",
")",
"=",
"$",
"this",
"->",
"getPrefixAndP... | 移动文件
@param string $from
@param string $to
@param array $config
@return bool | [
"移动文件"
] | train | https://github.com/movoin/one-swoole/blob/b9b175963ead91416cc50902a04e05ff3ef571de/src/FileSystem/Manager.php#L159-L184 |
movoin/one-swoole | src/FileSystem/Manager.php | Manager.filterPrefix | protected function filterPrefix(array $arguments)
{
if (empty($arguments)) {
throw new InvalidArgumentException('The arguments cannot be empty');
}
$path = array_shift($arguments);
if (! Assert::stringNotEmpty($path)) {
throw new InvalidArgumentException(
... | php | protected function filterPrefix(array $arguments)
{
if (empty($arguments)) {
throw new InvalidArgumentException('The arguments cannot be empty');
}
$path = array_shift($arguments);
if (! Assert::stringNotEmpty($path)) {
throw new InvalidArgumentException(
... | [
"protected",
"function",
"filterPrefix",
"(",
"array",
"$",
"arguments",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"arguments",
")",
")",
"{",
"throw",
"new",
"InvalidArgumentException",
"(",
"'The arguments cannot be empty'",
")",
";",
"}",
"$",
"path",
"=",
... | 从参数中获得文件系统前缀
@param array $arguments
@return array
@throws \InvalidArgumentException | [
"从参数中获得文件系统前缀"
] | train | https://github.com/movoin/one-swoole/blob/b9b175963ead91416cc50902a04e05ff3ef571de/src/FileSystem/Manager.php#L225-L244 |
werx/forms | src/Checkbox.php | Checkbox.conditionalChecked | public function conditionalChecked($value_1 = null, $value_2 = null)
{
if (isset($value_1) && isset($value_2) && ($value_1 === $value_2)) {
return $this->checked();
} else {
return $this;
}
} | php | public function conditionalChecked($value_1 = null, $value_2 = null)
{
if (isset($value_1) && isset($value_2) && ($value_1 === $value_2)) {
return $this->checked();
} else {
return $this;
}
} | [
"public",
"function",
"conditionalChecked",
"(",
"$",
"value_1",
"=",
"null",
",",
"$",
"value_2",
"=",
"null",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"value_1",
")",
"&&",
"isset",
"(",
"$",
"value_2",
")",
"&&",
"(",
"$",
"value_1",
"===",
"$",
... | @param null $value_1
@param null $value_2
@return $this
@deprecated Deprecated the day after it was created. Use checkedWhen() instead. | [
"@param",
"null",
"$value_1",
"@param",
"null",
"$value_2",
"@return",
"$this"
] | train | https://github.com/werx/forms/blob/e057e4890bd13541da72b3cb2d22c2c84435c16a/src/Checkbox.php#L62-L69 |
o2system/html | src/Dom/Lists/Meta.php | Meta.import | public function import(Meta $metaNodes)
{
if (is_array($metaNodes = $metaNodes->getArrayCopy())) {
foreach ($metaNodes as $name => $value) {
$this->offsetSet($name, $value);
}
}
return $this;
} | php | public function import(Meta $metaNodes)
{
if (is_array($metaNodes = $metaNodes->getArrayCopy())) {
foreach ($metaNodes as $name => $value) {
$this->offsetSet($name, $value);
}
}
return $this;
} | [
"public",
"function",
"import",
"(",
"Meta",
"$",
"metaNodes",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"metaNodes",
"=",
"$",
"metaNodes",
"->",
"getArrayCopy",
"(",
")",
")",
")",
"{",
"foreach",
"(",
"$",
"metaNodes",
"as",
"$",
"name",
"=>",
"$... | Meta::import
@param \O2System\Html\Dom\Lists\Meta $metaNodes
@return $this | [
"Meta",
"::",
"import"
] | train | https://github.com/o2system/html/blob/b7336fb45d42603ce1064b25572a05d495887670/src/Dom/Lists/Meta.php#L56-L65 |
o2system/html | src/Dom/Lists/Meta.php | Meta.createElement | public function createElement(array $attributes)
{
$meta = $this->ownerDocument->createElement('meta');
$name = null;
foreach ($attributes as $key => $value) {
$meta->setAttribute($key, $value);
}
$this[] = $meta;
return $meta;
} | php | public function createElement(array $attributes)
{
$meta = $this->ownerDocument->createElement('meta');
$name = null;
foreach ($attributes as $key => $value) {
$meta->setAttribute($key, $value);
}
$this[] = $meta;
return $meta;
} | [
"public",
"function",
"createElement",
"(",
"array",
"$",
"attributes",
")",
"{",
"$",
"meta",
"=",
"$",
"this",
"->",
"ownerDocument",
"->",
"createElement",
"(",
"'meta'",
")",
";",
"$",
"name",
"=",
"null",
";",
"foreach",
"(",
"$",
"attributes",
"as"... | Meta::createElement
@param array $attributes
@return \DOMElement | [
"Meta",
"::",
"createElement"
] | train | https://github.com/o2system/html/blob/b7336fb45d42603ce1064b25572a05d495887670/src/Dom/Lists/Meta.php#L96-L108 |
WellCommerce/OrderBundle | Form/Admin/OrderFormBuilder.php | OrderFormBuilder.addShippingOptions | private function addShippingOptions(ElementInterface $radioGroup)
{
$order = $this->getOrderProvider()->getCurrentOrder();
$collection = $this->getShippingMethodProvider()->getCosts(new OrderContext($order));
$collection->map(function (ShippingMethodCost $shippingMethodCost) us... | php | private function addShippingOptions(ElementInterface $radioGroup)
{
$order = $this->getOrderProvider()->getCurrentOrder();
$collection = $this->getShippingMethodProvider()->getCosts(new OrderContext($order));
$collection->map(function (ShippingMethodCost $shippingMethodCost) us... | [
"private",
"function",
"addShippingOptions",
"(",
"ElementInterface",
"$",
"radioGroup",
")",
"{",
"$",
"order",
"=",
"$",
"this",
"->",
"getOrderProvider",
"(",
")",
"->",
"getCurrentOrder",
"(",
")",
";",
"$",
"collection",
"=",
"$",
"this",
"->",
"getShip... | Adds shipping method options to select
@param ElementInterface|Select $radioGroup | [
"Adds",
"shipping",
"method",
"options",
"to",
"select"
] | train | https://github.com/WellCommerce/OrderBundle/blob/d72cfb51eab7a1f66f186900d1e2d533a822c424/Form/Admin/OrderFormBuilder.php#L303-L321 |
WellCommerce/OrderBundle | Form/Admin/OrderFormBuilder.php | OrderFormBuilder.addPaymentOptions | private function addPaymentOptions(ElementInterface $radioGroup)
{
$order = $this->getOrderProvider()->getCurrentOrder();
$shippingMethod = $order->getShippingMethod();
if ($shippingMethod instanceof ShippingMethod) {
$collection = $shippingMethod->getPaymentMethods();
... | php | private function addPaymentOptions(ElementInterface $radioGroup)
{
$order = $this->getOrderProvider()->getCurrentOrder();
$shippingMethod = $order->getShippingMethod();
if ($shippingMethod instanceof ShippingMethod) {
$collection = $shippingMethod->getPaymentMethods();
... | [
"private",
"function",
"addPaymentOptions",
"(",
"ElementInterface",
"$",
"radioGroup",
")",
"{",
"$",
"order",
"=",
"$",
"this",
"->",
"getOrderProvider",
"(",
")",
"->",
"getCurrentOrder",
"(",
")",
";",
"$",
"shippingMethod",
"=",
"$",
"order",
"->",
"get... | Adds payment method options to select
@param ElementInterface|Select $radioGroup | [
"Adds",
"payment",
"method",
"options",
"to",
"select"
] | train | https://github.com/WellCommerce/OrderBundle/blob/d72cfb51eab7a1f66f186900d1e2d533a822c424/Form/Admin/OrderFormBuilder.php#L328-L339 |
FrenchFrogs/framework | src/Panel/Panel/Panel.php | Panel.addAction | public function addAction(Action\Action $element)
{
if (!$element->hasRenderer()) {
$element->setRenderer($this->getRenderer());
}
$this->actions[$element->getName()] = $element;
return $this;
} | php | public function addAction(Action\Action $element)
{
if (!$element->hasRenderer()) {
$element->setRenderer($this->getRenderer());
}
$this->actions[$element->getName()] = $element;
return $this;
} | [
"public",
"function",
"addAction",
"(",
"Action",
"\\",
"Action",
"$",
"element",
")",
"{",
"if",
"(",
"!",
"$",
"element",
"->",
"hasRenderer",
"(",
")",
")",
"{",
"$",
"element",
"->",
"setRenderer",
"(",
"$",
"this",
"->",
"getRenderer",
"(",
")",
... | Add an action to the action container
@param Action\Action $element
@return $this | [
"Add",
"an",
"action",
"to",
"the",
"action",
"container"
] | train | https://github.com/FrenchFrogs/framework/blob/a4838c698a5600437e87dac6d35ba8ebe32c4395/src/Panel/Panel/Panel.php#L187-L195 |
FrenchFrogs/framework | src/Panel/Panel/Panel.php | Panel.addSelectRemote | public function addSelectRemote($name, $placeholder, $data_url, $action_url, $length = 3 )
{
$e = new Action\SelectRemote($name, $placeholder, $data_url, $action_url, $length);
$this->addAction($e);
return $e;
} | php | public function addSelectRemote($name, $placeholder, $data_url, $action_url, $length = 3 )
{
$e = new Action\SelectRemote($name, $placeholder, $data_url, $action_url, $length);
$this->addAction($e);
return $e;
} | [
"public",
"function",
"addSelectRemote",
"(",
"$",
"name",
",",
"$",
"placeholder",
",",
"$",
"data_url",
",",
"$",
"action_url",
",",
"$",
"length",
"=",
"3",
")",
"{",
"$",
"e",
"=",
"new",
"Action",
"\\",
"SelectRemote",
"(",
"$",
"name",
",",
"$"... | Add select remote
@param $name
@param $placeholder
@param $data_url
@param $action_url
@param int $length
@return \FrenchFrogs\Panel\Action\SelectRemote | [
"Add",
"select",
"remote"
] | train | https://github.com/FrenchFrogs/framework/blob/a4838c698a5600437e87dac6d35ba8ebe32c4395/src/Panel/Panel/Panel.php#L207-L212 |
opis/utils | lib/Dir.php | Dir.remove | public static function remove($dirname)
{
if (!is_dir($dirname)) {
return false;
}
$dir = dir($dirname);
while (false !== $entry = $dir->read()) {
if ($entry == '.' || $entry == '..') {
continue;
}
$item = $dirname . '... | php | public static function remove($dirname)
{
if (!is_dir($dirname)) {
return false;
}
$dir = dir($dirname);
while (false !== $entry = $dir->read()) {
if ($entry == '.' || $entry == '..') {
continue;
}
$item = $dirname . '... | [
"public",
"static",
"function",
"remove",
"(",
"$",
"dirname",
")",
"{",
"if",
"(",
"!",
"is_dir",
"(",
"$",
"dirname",
")",
")",
"{",
"return",
"false",
";",
"}",
"$",
"dir",
"=",
"dir",
"(",
"$",
"dirname",
")",
";",
"while",
"(",
"false",
"!==... | Remove directory
@param string $dirname
@return boolean | [
"Remove",
"directory"
] | train | https://github.com/opis/utils/blob/239cd3dc3760eb746838011e712592700fe5d58c/lib/Dir.php#L76-L98 |
phpalchemy/cerberus | src/Alchemy/Component/Cerberus/Model/Map/RoleTableMap.php | RoleTableMap.addSelectColumns | public static function addSelectColumns(Criteria $criteria, $alias = null)
{
if (null === $alias) {
$criteria->addSelectColumn(RoleTableMap::COL_ID);
$criteria->addSelectColumn(RoleTableMap::COL_NAME);
$criteria->addSelectColumn(RoleTableMap::COL_DESCRIPTION);
... | php | public static function addSelectColumns(Criteria $criteria, $alias = null)
{
if (null === $alias) {
$criteria->addSelectColumn(RoleTableMap::COL_ID);
$criteria->addSelectColumn(RoleTableMap::COL_NAME);
$criteria->addSelectColumn(RoleTableMap::COL_DESCRIPTION);
... | [
"public",
"static",
"function",
"addSelectColumns",
"(",
"Criteria",
"$",
"criteria",
",",
"$",
"alias",
"=",
"null",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"alias",
")",
"{",
"$",
"criteria",
"->",
"addSelectColumn",
"(",
"RoleTableMap",
"::",
"COL_ID",... | Add all the columns needed to create a new object.
Note: any columns that were marked with lazyLoad="true" in the
XML schema will not be added to the select list and only loaded
on demand.
@param Criteria $criteria object containing the columns to add.
@param string $alias optional table alias
@throws PropelExce... | [
"Add",
"all",
"the",
"columns",
"needed",
"to",
"create",
"a",
"new",
"object",
"."
] | train | https://github.com/phpalchemy/cerberus/blob/3424a360c9bded71eb5b570bc114a7759cb23ec6/src/Alchemy/Component/Cerberus/Model/Map/RoleTableMap.php#L322-L339 |
phpalchemy/cerberus | src/Alchemy/Component/Cerberus/Model/Map/RoleTableMap.php | RoleTableMap.buildTableMap | public static function buildTableMap()
{
$dbMap = Propel::getServiceContainer()->getDatabaseMap(RoleTableMap::DATABASE_NAME);
if (!$dbMap->hasTable(RoleTableMap::TABLE_NAME)) {
$dbMap->addTableObject(new RoleTableMap());
}
} | php | public static function buildTableMap()
{
$dbMap = Propel::getServiceContainer()->getDatabaseMap(RoleTableMap::DATABASE_NAME);
if (!$dbMap->hasTable(RoleTableMap::TABLE_NAME)) {
$dbMap->addTableObject(new RoleTableMap());
}
} | [
"public",
"static",
"function",
"buildTableMap",
"(",
")",
"{",
"$",
"dbMap",
"=",
"Propel",
"::",
"getServiceContainer",
"(",
")",
"->",
"getDatabaseMap",
"(",
"RoleTableMap",
"::",
"DATABASE_NAME",
")",
";",
"if",
"(",
"!",
"$",
"dbMap",
"->",
"hasTable",
... | Add a TableMap instance to the database for this tableMap class. | [
"Add",
"a",
"TableMap",
"instance",
"to",
"the",
"database",
"for",
"this",
"tableMap",
"class",
"."
] | train | https://github.com/phpalchemy/cerberus/blob/3424a360c9bded71eb5b570bc114a7759cb23ec6/src/Alchemy/Component/Cerberus/Model/Map/RoleTableMap.php#L356-L362 |
matthiasbayer/datadog-client | src/Bayer/DataDogClient/Series.php | Series.getMetric | public function getMetric($name) {
if (isset($this->metrics[$name])) {
return $this->metrics[$name];
}
throw new MetricNotFoundException("Metric $name not found");
} | php | public function getMetric($name) {
if (isset($this->metrics[$name])) {
return $this->metrics[$name];
}
throw new MetricNotFoundException("Metric $name not found");
} | [
"public",
"function",
"getMetric",
"(",
"$",
"name",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"metrics",
"[",
"$",
"name",
"]",
")",
")",
"{",
"return",
"$",
"this",
"->",
"metrics",
"[",
"$",
"name",
"]",
";",
"}",
"throw",
"new",
... | @param $name
@throws Series\MetricNotFoundException
@return Metric | [
"@param",
"$name",
"@throws",
"Series",
"\\",
"MetricNotFoundException"
] | train | https://github.com/matthiasbayer/datadog-client/blob/e625132c34bf36f783077c9ee4ed3214633cd272/src/Bayer/DataDogClient/Series.php#L48-L54 |
matthiasbayer/datadog-client | src/Bayer/DataDogClient/Series.php | Series.removeMetric | public function removeMetric($name) {
if (isset($this->metrics[$name])) {
unset($this->metrics[$name]);
return $this;
}
throw new MetricNotFoundException("Metric $name not found");
} | php | public function removeMetric($name) {
if (isset($this->metrics[$name])) {
unset($this->metrics[$name]);
return $this;
}
throw new MetricNotFoundException("Metric $name not found");
} | [
"public",
"function",
"removeMetric",
"(",
"$",
"name",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"metrics",
"[",
"$",
"name",
"]",
")",
")",
"{",
"unset",
"(",
"$",
"this",
"->",
"metrics",
"[",
"$",
"name",
"]",
")",
";",
"return",
... | @param $name
@throws MetricNotFoundException
@return Series | [
"@param",
"$name",
"@throws",
"MetricNotFoundException"
] | train | https://github.com/matthiasbayer/datadog-client/blob/e625132c34bf36f783077c9ee4ed3214633cd272/src/Bayer/DataDogClient/Series.php#L93-L101 |
huasituo/hstcms | src/Libraries/Fields/Group.php | Group.option | public function option($option, $field = NULL)
{
$group = [];
$option['value'] = isset($option['value']) && $option['value'] ? $option['value'] : '';
if ($field) {
foreach ($field as $t) {
if ($t['fieldtype'] == 'Group') {
$t['setting'] = hst_str2array($t['setting']);
if (preg_match_all('/\{(.+... | php | public function option($option, $field = NULL)
{
$group = [];
$option['value'] = isset($option['value']) && $option['value'] ? $option['value'] : '';
if ($field) {
foreach ($field as $t) {
if ($t['fieldtype'] == 'Group') {
$t['setting'] = hst_str2array($t['setting']);
if (preg_match_all('/\{(.+... | [
"public",
"function",
"option",
"(",
"$",
"option",
",",
"$",
"field",
"=",
"NULL",
")",
"{",
"$",
"group",
"=",
"[",
"]",
";",
"$",
"option",
"[",
"'value'",
"]",
"=",
"isset",
"(",
"$",
"option",
"[",
"'value'",
"]",
")",
"&&",
"$",
"option",
... | 字段相关属性参数
@param array $value 值
@param array $field 字段集合
@return string | [
"字段相关属性参数"
] | train | https://github.com/huasituo/hstcms/blob/12819979289e58ce38e3e92540aeeb16e205e525/src/Libraries/Fields/Group.php#L30-L80 |
huasituo/hstcms | src/Libraries/Fields/Group.php | Group.input | public function input($cname, $name, $cfg, $value = NULL, $id = 0)
{
// 字段显示名称
$text = (isset($cfg['validate']['required']) && $cfg['validate']['required'] == 1 ? '<font color="red">*</font>' : '').' '.$cname.':';
// 字段提示信息
$tips = isset($cfg['validate']['tips']) && $cfg['validate']['tips'] ? $cfg['valid... | php | public function input($cname, $name, $cfg, $value = NULL, $id = 0)
{
// 字段显示名称
$text = (isset($cfg['validate']['required']) && $cfg['validate']['required'] == 1 ? '<font color="red">*</font>' : '').' '.$cname.':';
// 字段提示信息
$tips = isset($cfg['validate']['tips']) && $cfg['validate']['tips'] ? $cfg['valid... | [
"public",
"function",
"input",
"(",
"$",
"cname",
",",
"$",
"name",
",",
"$",
"cfg",
",",
"$",
"value",
"=",
"NULL",
",",
"$",
"id",
"=",
"0",
")",
"{",
"// 字段显示名称",
"$",
"text",
"=",
"(",
"isset",
"(",
"$",
"cfg",
"[",
"'validate'",
"]",
"[",
... | 字段表单输入
@param string $cname 字段别名
@param string $name 字段名称
@param array $cfg 字段配置
@param array $data 值
@return string | [
"字段表单输入"
] | train | https://github.com/huasituo/hstcms/blob/12819979289e58ce38e3e92540aeeb16e205e525/src/Libraries/Fields/Group.php#L91-L104 |
yosmanyga/resource | src/Yosmanyga/Resource/Compiler/DelegatorCompiler.php | DelegatorCompiler.pickCompiler | protected function pickCompiler($definition)
{
foreach ($this->compilers as $i => $compiler) {
if ($compiler->supports($definition)) {
if (0 != $i) {
// Move compiler to top to improve next pick
unset($this->compilers[$i]);
... | php | protected function pickCompiler($definition)
{
foreach ($this->compilers as $i => $compiler) {
if ($compiler->supports($definition)) {
if (0 != $i) {
// Move compiler to top to improve next pick
unset($this->compilers[$i]);
... | [
"protected",
"function",
"pickCompiler",
"(",
"$",
"definition",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"compilers",
"as",
"$",
"i",
"=>",
"$",
"compiler",
")",
"{",
"if",
"(",
"$",
"compiler",
"->",
"supports",
"(",
"$",
"definition",
")",
")",
... | @param mixed $definition
@throws \RuntimeException If no compiler is able to support the
resource
@return \Yosmanyga\Resource\Compiler\CompilerInterface | [
"@param",
"mixed",
"$definition"
] | train | https://github.com/yosmanyga/resource/blob/a8b505c355920a908917a0484f764ddfa63205fa/src/Yosmanyga/Resource/Compiler/DelegatorCompiler.php#L48-L63 |
crossjoin/Css | src/Crossjoin/Css/Format/Rule/AtFontFace/FontFaceDeclaration.php | FontFaceDeclaration.checkProperty | public function checkProperty(&$property)
{
if (parent::checkProperty($property)) {
if (preg_match(
'/^(?:src|unicode-range|font-(?:family|variant|feature-settings|stretch|weight|style))$/D',
$property)) {
return true;
} else {
... | php | public function checkProperty(&$property)
{
if (parent::checkProperty($property)) {
if (preg_match(
'/^(?:src|unicode-range|font-(?:family|variant|feature-settings|stretch|weight|style))$/D',
$property)) {
return true;
} else {
... | [
"public",
"function",
"checkProperty",
"(",
"&",
"$",
"property",
")",
"{",
"if",
"(",
"parent",
"::",
"checkProperty",
"(",
"$",
"property",
")",
")",
"{",
"if",
"(",
"preg_match",
"(",
"'/^(?:src|unicode-range|font-(?:family|variant|feature-settings|stretch|weight|s... | Checks the declaration property.
@param string $property
@return bool | [
"Checks",
"the",
"declaration",
"property",
"."
] | train | https://github.com/crossjoin/Css/blob/7b50ca94c4bdad60d01cfa327f00b7a600d6f9f3/src/Crossjoin/Css/Format/Rule/AtFontFace/FontFaceDeclaration.php#L15-L29 |
cronario/cronario | src/Manager.php | Manager.parseManagerStatKey | public static function parseManagerStatKey($key)
{
list($namespace, $appId, $workerClass) = explode(':', $key);
return [
static::P_STATS_KEY_NAMESPACE => $namespace,
static::P_STATS_KEY_APP_ID => $appId,
static::P_STATS_KEY_WORKER_CLASS => $workerClass,
... | php | public static function parseManagerStatKey($key)
{
list($namespace, $appId, $workerClass) = explode(':', $key);
return [
static::P_STATS_KEY_NAMESPACE => $namespace,
static::P_STATS_KEY_APP_ID => $appId,
static::P_STATS_KEY_WORKER_CLASS => $workerClass,
... | [
"public",
"static",
"function",
"parseManagerStatKey",
"(",
"$",
"key",
")",
"{",
"list",
"(",
"$",
"namespace",
",",
"$",
"appId",
",",
"$",
"workerClass",
")",
"=",
"explode",
"(",
"':'",
",",
"$",
"key",
")",
";",
"return",
"[",
"static",
"::",
"P... | @param $key
@return array | [
"@param",
"$key"
] | train | https://github.com/cronario/cronario/blob/954df60e95efd3085269331d435e8ce6f4980441/src/Manager.php#L265-L274 |
cronario/cronario | src/Manager.php | Manager.getWorkerConfig | protected function getWorkerConfig($key = null)
{
/** @var AbstractWorker $class */
if (null === static::$workerConfig) {
$class = $this->workerClass;
static::$workerConfig = $class::getConfig();
}
return (null === $key)
? static::$workerConfig
... | php | protected function getWorkerConfig($key = null)
{
/** @var AbstractWorker $class */
if (null === static::$workerConfig) {
$class = $this->workerClass;
static::$workerConfig = $class::getConfig();
}
return (null === $key)
? static::$workerConfig
... | [
"protected",
"function",
"getWorkerConfig",
"(",
"$",
"key",
"=",
"null",
")",
"{",
"/** @var AbstractWorker $class */",
"if",
"(",
"null",
"===",
"static",
"::",
"$",
"workerConfig",
")",
"{",
"$",
"class",
"=",
"$",
"this",
"->",
"workerClass",
";",
"stati... | @param null $key
@return mixed | [
"@param",
"null",
"$key"
] | train | https://github.com/cronario/cronario/blob/954df60e95efd3085269331d435e8ce6f4980441/src/Manager.php#L508-L519 |
huasituo/hstcms | src/HstcmsServiceProvider.php | HstcmsServiceProvider.boot | public function boot()
{
$this->publishes([
__DIR__.'/../config/hstcms.php' => config_path('hstcms.php'),
], 'config');
$this->loadViewsFrom(__DIR__.'/../views', 'hstcms');
$this->publishes([
__DIR__.'/../assets' => public_path('assets'),
], 'public');... | php | public function boot()
{
$this->publishes([
__DIR__.'/../config/hstcms.php' => config_path('hstcms.php'),
], 'config');
$this->loadViewsFrom(__DIR__.'/../views', 'hstcms');
$this->publishes([
__DIR__.'/../assets' => public_path('assets'),
], 'public');... | [
"public",
"function",
"boot",
"(",
")",
"{",
"$",
"this",
"->",
"publishes",
"(",
"[",
"__DIR__",
".",
"'/../config/hstcms.php'",
"=>",
"config_path",
"(",
"'hstcms.php'",
")",
",",
"]",
",",
"'config'",
")",
";",
"$",
"this",
"->",
"loadViewsFrom",
"(",
... | Boot the service provider. | [
"Boot",
"the",
"service",
"provider",
"."
] | train | https://github.com/huasituo/hstcms/blob/12819979289e58ce38e3e92540aeeb16e205e525/src/HstcmsServiceProvider.php#L31-L46 |
huasituo/hstcms | src/HstcmsServiceProvider.php | HstcmsServiceProvider.register | public function register()
{
$this->mergeConfigFrom(
__DIR__.'/../config/hstcms.php', 'hstcms'
);
$this->app->register(RouteServiceProvider::class);
$this->app->register(HelperServiceProvider::class);
$this->app->register(ConsoleServiceProvider::class);
$t... | php | public function register()
{
$this->mergeConfigFrom(
__DIR__.'/../config/hstcms.php', 'hstcms'
);
$this->app->register(RouteServiceProvider::class);
$this->app->register(HelperServiceProvider::class);
$this->app->register(ConsoleServiceProvider::class);
$t... | [
"public",
"function",
"register",
"(",
")",
"{",
"$",
"this",
"->",
"mergeConfigFrom",
"(",
"__DIR__",
".",
"'/../config/hstcms.php'",
",",
"'hstcms'",
")",
";",
"$",
"this",
"->",
"app",
"->",
"register",
"(",
"RouteServiceProvider",
"::",
"class",
")",
";"... | Register the service provider. | [
"Register",
"the",
"service",
"provider",
"."
] | train | https://github.com/huasituo/hstcms/blob/12819979289e58ce38e3e92540aeeb16e205e525/src/HstcmsServiceProvider.php#L51-L68 |
drunomics/service-utils | src/Core/Render/MainContent/AjaxRendererTrait.php | AjaxRendererTrait.getAjaxRenderer | public function getAjaxRenderer() {
if (empty($this->AjaxRenderer)) {
$this->AjaxRenderer = \Drupal::service('main_content_renderer.ajax');
}
return $this->AjaxRenderer;
} | php | public function getAjaxRenderer() {
if (empty($this->AjaxRenderer)) {
$this->AjaxRenderer = \Drupal::service('main_content_renderer.ajax');
}
return $this->AjaxRenderer;
} | [
"public",
"function",
"getAjaxRenderer",
"(",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"this",
"->",
"AjaxRenderer",
")",
")",
"{",
"$",
"this",
"->",
"AjaxRenderer",
"=",
"\\",
"Drupal",
"::",
"service",
"(",
"'main_content_renderer.ajax'",
")",
";",
"}",
... | Gets the ajax renderer.
@return \Drupal\Core\Render\MainContent\MainContentRendererInterface
The ajax renderer. | [
"Gets",
"the",
"ajax",
"renderer",
"."
] | train | https://github.com/drunomics/service-utils/blob/56761750043132365ef4ae5d9e0cf4263459328f/src/Core/Render/MainContent/AjaxRendererTrait.php#L38-L43 |
yosmanyga/resource | src/Yosmanyga/Resource/Normalizer/DelegatorNormalizer.php | DelegatorNormalizer.supports | public function supports($data, Resource $resource)
{
try {
if ($this->pickNormalizer($data, $resource)) {
return true;
}
} catch (\RuntimeException $e) {
}
return false;
} | php | public function supports($data, Resource $resource)
{
try {
if ($this->pickNormalizer($data, $resource)) {
return true;
}
} catch (\RuntimeException $e) {
}
return false;
} | [
"public",
"function",
"supports",
"(",
"$",
"data",
",",
"Resource",
"$",
"resource",
")",
"{",
"try",
"{",
"if",
"(",
"$",
"this",
"->",
"pickNormalizer",
"(",
"$",
"data",
",",
"$",
"resource",
")",
")",
"{",
"return",
"true",
";",
"}",
"}",
"cat... | {@inheritdoc} | [
"{"
] | train | https://github.com/yosmanyga/resource/blob/a8b505c355920a908917a0484f764ddfa63205fa/src/Yosmanyga/Resource/Normalizer/DelegatorNormalizer.php#L25-L35 |
yosmanyga/resource | src/Yosmanyga/Resource/Normalizer/DelegatorNormalizer.php | DelegatorNormalizer.normalize | public function normalize($data, Resource $resource)
{
return $this->pickNormalizer($data, $resource)->normalize($data, $resource);
} | php | public function normalize($data, Resource $resource)
{
return $this->pickNormalizer($data, $resource)->normalize($data, $resource);
} | [
"public",
"function",
"normalize",
"(",
"$",
"data",
",",
"Resource",
"$",
"resource",
")",
"{",
"return",
"$",
"this",
"->",
"pickNormalizer",
"(",
"$",
"data",
",",
"$",
"resource",
")",
"->",
"normalize",
"(",
"$",
"data",
",",
"$",
"resource",
")",... | {@inheritdoc} | [
"{"
] | train | https://github.com/yosmanyga/resource/blob/a8b505c355920a908917a0484f764ddfa63205fa/src/Yosmanyga/Resource/Normalizer/DelegatorNormalizer.php#L40-L43 |
yosmanyga/resource | src/Yosmanyga/Resource/Normalizer/DelegatorNormalizer.php | DelegatorNormalizer.pickNormalizer | protected function pickNormalizer($data, Resource $resource)
{
foreach ($this->normalizers as $i => $normalizer) {
if ($normalizer->supports($data, $resource)) {
if (0 != $i) {
// Move normalizer to top to improve next pick
unset($this->nor... | php | protected function pickNormalizer($data, Resource $resource)
{
foreach ($this->normalizers as $i => $normalizer) {
if ($normalizer->supports($data, $resource)) {
if (0 != $i) {
// Move normalizer to top to improve next pick
unset($this->nor... | [
"protected",
"function",
"pickNormalizer",
"(",
"$",
"data",
",",
"Resource",
"$",
"resource",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"normalizers",
"as",
"$",
"i",
"=>",
"$",
"normalizer",
")",
"{",
"if",
"(",
"$",
"normalizer",
"->",
"supports",
... | @param mixed $data
@param \Yosmanyga\Resource\Resource $resource
@throws \RuntimeException If no normalizer is able to support
the resource
@return \Yosmanyga\Resource\Normalizer\NormalizerInterface | [
"@param",
"mixed",
"$data",
"@param",
"\\",
"Yosmanyga",
"\\",
"Resource",
"\\",
"Resource",
"$resource"
] | train | https://github.com/yosmanyga/resource/blob/a8b505c355920a908917a0484f764ddfa63205fa/src/Yosmanyga/Resource/Normalizer/DelegatorNormalizer.php#L54-L69 |
constant-null/backstubber | src/Utility/Formatter.php | Formatter.isArrayMultiline | protected static function isArrayMultiline($array)
{
if (empty($array)) return false;
switch (self::getArrayMode()) {
case self::ARR_MODE_SINGLELINE:
$isMultiline = false;
break;
case self::ARR_MODE_MULTILINE:
$isMultiline = tr... | php | protected static function isArrayMultiline($array)
{
if (empty($array)) return false;
switch (self::getArrayMode()) {
case self::ARR_MODE_SINGLELINE:
$isMultiline = false;
break;
case self::ARR_MODE_MULTILINE:
$isMultiline = tr... | [
"protected",
"static",
"function",
"isArrayMultiline",
"(",
"$",
"array",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"array",
")",
")",
"return",
"false",
";",
"switch",
"(",
"self",
"::",
"getArrayMode",
"(",
")",
")",
"{",
"case",
"self",
"::",
"ARR_MOD... | Determines if array should be formatted as a multiline one or not
@param array $array
@return bool | [
"Determines",
"if",
"array",
"should",
"be",
"formatted",
"as",
"a",
"multiline",
"one",
"or",
"not"
] | train | https://github.com/constant-null/backstubber/blob/1e7ee66091bae4e6b709642467609a8566dae479/src/Utility/Formatter.php#L28-L44 |
constant-null/backstubber | src/Utility/Formatter.php | Formatter.prepareArrayLines | protected static function prepareArrayLines(array $array)
{
$isAssoc = Arr::isAssoc($array);
array_walk($array, function (&$value, $index, $withIndexes = false) {
if (is_array($value)) {
$value = self::formatArray($value);
} else {
$value = se... | php | protected static function prepareArrayLines(array $array)
{
$isAssoc = Arr::isAssoc($array);
array_walk($array, function (&$value, $index, $withIndexes = false) {
if (is_array($value)) {
$value = self::formatArray($value);
} else {
$value = se... | [
"protected",
"static",
"function",
"prepareArrayLines",
"(",
"array",
"$",
"array",
")",
"{",
"$",
"isAssoc",
"=",
"Arr",
"::",
"isAssoc",
"(",
"$",
"array",
")",
";",
"array_walk",
"(",
"$",
"array",
",",
"function",
"(",
"&",
"$",
"value",
",",
"$",
... | Prepare array elements for formatting.
@param array $array
@return array | [
"Prepare",
"array",
"elements",
"for",
"formatting",
"."
] | train | https://github.com/constant-null/backstubber/blob/1e7ee66091bae4e6b709642467609a8566dae479/src/Utility/Formatter.php#L63-L80 |
constant-null/backstubber | src/Utility/Formatter.php | Formatter.indentLines | public static function indentLines($text, $indent, $skipFirstLine = false)
{
$lines = explode(PHP_EOL, $text);
// (つ◕.◕)つ━☆゚.*・。゚
!$skipFirstLine || $preparedLines[] = array_shift($lines);
foreach ($lines as $line) {
$preparedLines[] = self::indent($indent) . rtrim($lin... | php | public static function indentLines($text, $indent, $skipFirstLine = false)
{
$lines = explode(PHP_EOL, $text);
// (つ◕.◕)つ━☆゚.*・。゚
!$skipFirstLine || $preparedLines[] = array_shift($lines);
foreach ($lines as $line) {
$preparedLines[] = self::indent($indent) . rtrim($lin... | [
"public",
"static",
"function",
"indentLines",
"(",
"$",
"text",
",",
"$",
"indent",
",",
"$",
"skipFirstLine",
"=",
"false",
")",
"{",
"$",
"lines",
"=",
"explode",
"(",
"PHP_EOL",
",",
"$",
"text",
")",
";",
"// (つ◕.◕)つ━☆゚.*・。゚",
"!",
"$",
"skipFirstLi... | Add indents to multiline text
@param string $text
@param integer $indent indent in spaces
@param bool $skipFirstLine = false not apply indent to the first line of text
@return array | [
"Add",
"indents",
"to",
"multiline",
"text"
] | train | https://github.com/constant-null/backstubber/blob/1e7ee66091bae4e6b709642467609a8566dae479/src/Utility/Formatter.php#L90-L102 |
constant-null/backstubber | src/Utility/Formatter.php | Formatter.formatArray | public static function formatArray(array $array, $braces = true)
{
$isMultiline = self::isArrayMultiline($array);
$array = self::prepareArrayLines($array);
$eol = $isMultiline ? PHP_EOL : '';
$output = implode($array, ', ' . $eol);
if ($isMultiline) {
// apply... | php | public static function formatArray(array $array, $braces = true)
{
$isMultiline = self::isArrayMultiline($array);
$array = self::prepareArrayLines($array);
$eol = $isMultiline ? PHP_EOL : '';
$output = implode($array, ', ' . $eol);
if ($isMultiline) {
// apply... | [
"public",
"static",
"function",
"formatArray",
"(",
"array",
"$",
"array",
",",
"$",
"braces",
"=",
"true",
")",
"{",
"$",
"isMultiline",
"=",
"self",
"::",
"isArrayMultiline",
"(",
"$",
"array",
")",
";",
"$",
"array",
"=",
"self",
"::",
"prepareArrayLi... | Return text representation of array
@param array $array input array
@param bool $braces add array braces to output
@return string | [
"Return",
"text",
"representation",
"of",
"array"
] | train | https://github.com/constant-null/backstubber/blob/1e7ee66091bae4e6b709642467609a8566dae479/src/Utility/Formatter.php#L131-L153 |
goblindegook/Syllables | src/Exception/WP_Exception.php | WP_Exception.get_wp_error | public function get_wp_error() {
return $this->wp_error ? $this->wp_error : new \WP_Error( $this->code, $this->message, $this );
} | php | public function get_wp_error() {
return $this->wp_error ? $this->wp_error : new \WP_Error( $this->code, $this->message, $this );
} | [
"public",
"function",
"get_wp_error",
"(",
")",
"{",
"return",
"$",
"this",
"->",
"wp_error",
"?",
"$",
"this",
"->",
"wp_error",
":",
"new",
"\\",
"WP_Error",
"(",
"$",
"this",
"->",
"code",
",",
"$",
"this",
"->",
"message",
",",
"$",
"this",
")",
... | Obtain the exception's `\WP_Error` object.
@return \WP_Error WordPress error. | [
"Obtain",
"the",
"exception",
"s",
"\\",
"WP_Error",
"object",
"."
] | train | https://github.com/goblindegook/Syllables/blob/1a98cd15e37595a85b242242f88fee38c4e36acc/src/Exception/WP_Exception.php#L80-L82 |
movoin/one-swoole | src/Validation/Validators/CustomValidator.php | CustomValidator.createFromArray | public static function createFromArray(Validator $validator, array $callback): self
{
$self = new static($validator);
$self->setCallback(function (array $attributes, string $name, array $parameters) use ($callback) {
return call_user_func_array($callback, [
$attributes,
... | php | public static function createFromArray(Validator $validator, array $callback): self
{
$self = new static($validator);
$self->setCallback(function (array $attributes, string $name, array $parameters) use ($callback) {
return call_user_func_array($callback, [
$attributes,
... | [
"public",
"static",
"function",
"createFromArray",
"(",
"Validator",
"$",
"validator",
",",
"array",
"$",
"callback",
")",
":",
"self",
"{",
"$",
"self",
"=",
"new",
"static",
"(",
"$",
"validator",
")",
";",
"$",
"self",
"->",
"setCallback",
"(",
"funct... | 从数组回调创建自定义校验器
@param \One\Validation\Validator $validator
@param array $callback
@return self | [
"从数组回调创建自定义校验器"
] | train | https://github.com/movoin/one-swoole/blob/b9b175963ead91416cc50902a04e05ff3ef571de/src/Validation/Validators/CustomValidator.php#L34-L47 |
movoin/one-swoole | src/Validation/Validators/CustomValidator.php | CustomValidator.createFromClosure | public static function createFromClosure(Validator $validator, callable $callback): self
{
$self = new static($validator);
$self->setCallback(function (array $attributes, string $name, array $parameters) use ($callback) {
return $callback($attributes, $name, $parameters);
});
... | php | public static function createFromClosure(Validator $validator, callable $callback): self
{
$self = new static($validator);
$self->setCallback(function (array $attributes, string $name, array $parameters) use ($callback) {
return $callback($attributes, $name, $parameters);
});
... | [
"public",
"static",
"function",
"createFromClosure",
"(",
"Validator",
"$",
"validator",
",",
"callable",
"$",
"callback",
")",
":",
"self",
"{",
"$",
"self",
"=",
"new",
"static",
"(",
"$",
"validator",
")",
";",
"$",
"self",
"->",
"setCallback",
"(",
"... | 从回调创建自定义校验器
@param \One\Validation\Validator $validator
@param callable $callback
@return self | [
"从回调创建自定义校验器"
] | train | https://github.com/movoin/one-swoole/blob/b9b175963ead91416cc50902a04e05ff3ef571de/src/Validation/Validators/CustomValidator.php#L57-L66 |
movoin/one-swoole | src/Validation/Validators/CustomValidator.php | CustomValidator.validate | protected function validate(array $attributes, string $name, array $parameters = []): bool
{
$callback = $this->callback;
if (($result = $callback($attributes, $name, $parameters)) === false) {
$this->addError($name, $parameters, 'verification failed');
}
unset($callbac... | php | protected function validate(array $attributes, string $name, array $parameters = []): bool
{
$callback = $this->callback;
if (($result = $callback($attributes, $name, $parameters)) === false) {
$this->addError($name, $parameters, 'verification failed');
}
unset($callbac... | [
"protected",
"function",
"validate",
"(",
"array",
"$",
"attributes",
",",
"string",
"$",
"name",
",",
"array",
"$",
"parameters",
"=",
"[",
"]",
")",
":",
"bool",
"{",
"$",
"callback",
"=",
"$",
"this",
"->",
"callback",
";",
"if",
"(",
"(",
"$",
... | 校验规则
@param array $attributes
@param string $name
@param array $parameters
@return bool | [
"校验规则"
] | train | https://github.com/movoin/one-swoole/blob/b9b175963ead91416cc50902a04e05ff3ef571de/src/Validation/Validators/CustomValidator.php#L87-L98 |
movoin/one-swoole | src/Protocol/Message/UploadedFile.php | UploadedFile.moveTo | public function moveTo($targetPath)
{
if ($this->moved) {
throw new RuntimeException('Uploaded file already moved');
}
if (! is_writable(dirname($targetPath))) {
throw new InvalidArgumentException('Upload target path is not writable');
}
if (! @renam... | php | public function moveTo($targetPath)
{
if ($this->moved) {
throw new RuntimeException('Uploaded file already moved');
}
if (! is_writable(dirname($targetPath))) {
throw new InvalidArgumentException('Upload target path is not writable');
}
if (! @renam... | [
"public",
"function",
"moveTo",
"(",
"$",
"targetPath",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"moved",
")",
"{",
"throw",
"new",
"RuntimeException",
"(",
"'Uploaded file already moved'",
")",
";",
"}",
"if",
"(",
"!",
"is_writable",
"(",
"dirname",
"(",
... | 移动上传文件至目标路径
@param string $targetPath
@throws \RuntimeException
@throws \InvalidArgumentException | [
"移动上传文件至目标路径"
] | train | https://github.com/movoin/one-swoole/blob/b9b175963ead91416cc50902a04e05ff3ef571de/src/Protocol/Message/UploadedFile.php#L115-L132 |
huasituo/hstcms | src/Http/Controllers/Manage/BasicController.php | BasicController.loadTemplate | public function loadTemplate($tpl, $data = array(), $viewData = true)
{
$viewData && $data = $data + $this->viewData;
if(substr_count($tpl,'::') ) {
return view($tpl, $data);
}
return view('hstcms::manage.'.$tpl, $data);
} | php | public function loadTemplate($tpl, $data = array(), $viewData = true)
{
$viewData && $data = $data + $this->viewData;
if(substr_count($tpl,'::') ) {
return view($tpl, $data);
}
return view('hstcms::manage.'.$tpl, $data);
} | [
"public",
"function",
"loadTemplate",
"(",
"$",
"tpl",
",",
"$",
"data",
"=",
"array",
"(",
")",
",",
"$",
"viewData",
"=",
"true",
")",
"{",
"$",
"viewData",
"&&",
"$",
"data",
"=",
"$",
"data",
"+",
"$",
"this",
"->",
"viewData",
";",
"if",
"("... | 加载模版
@param string $tpl
@param array $data
@return template | [
"加载模版"
] | train | https://github.com/huasituo/hstcms/blob/12819979289e58ce38e3e92540aeeb16e205e525/src/Http/Controllers/Manage/BasicController.php#L50-L57 |
heyday/heystack | src/Loader/DBClosureLoader.php | DBClosureLoader.load | public function load($resource, $type = null)
{
$handler = $this->handler;
if (is_array($resource)) {
$rows = \DB::query(sprintf(
"SELECT %s FROM `%s` %s",
$resource[0],
$resource[1],
isset($resource[2]) ? "WHERE {$resource[... | php | public function load($resource, $type = null)
{
$handler = $this->handler;
if (is_array($resource)) {
$rows = \DB::query(sprintf(
"SELECT %s FROM `%s` %s",
$resource[0],
$resource[1],
isset($resource[2]) ? "WHERE {$resource[... | [
"public",
"function",
"load",
"(",
"$",
"resource",
",",
"$",
"type",
"=",
"null",
")",
"{",
"$",
"handler",
"=",
"$",
"this",
"->",
"handler",
";",
"if",
"(",
"is_array",
"(",
"$",
"resource",
")",
")",
"{",
"$",
"rows",
"=",
"\\",
"DB",
"::",
... | Loads a resource.
@param mixed $resource The resource
@param string $type The resource type
@throws \InvalidArgumentException
@throws \RuntimeException
@return void | [
"Loads",
"a",
"resource",
"."
] | train | https://github.com/heyday/heystack/blob/2c051933f8c532d0a9a23be6ee1ff5c619e47dfe/src/Loader/DBClosureLoader.php#L37-L56 |
jan-dolata/crude-crud | src/Engine/Helpers/CrudeSpecialFiles.php | CrudeSpecialFiles.getList | public function getList()
{
$result = [];
foreach (config('crude_special_files.files') as $key)
$result[$key] = [
'key' => $key,
'label' => $this->getLabel($key),
'data' => $this->getFileData($key)
];
return $result;
... | php | public function getList()
{
$result = [];
foreach (config('crude_special_files.files') as $key)
$result[$key] = [
'key' => $key,
'label' => $this->getLabel($key),
'data' => $this->getFileData($key)
];
return $result;
... | [
"public",
"function",
"getList",
"(",
")",
"{",
"$",
"result",
"=",
"[",
"]",
";",
"foreach",
"(",
"config",
"(",
"'crude_special_files.files'",
")",
"as",
"$",
"key",
")",
"$",
"result",
"[",
"$",
"key",
"]",
"=",
"[",
"'key'",
"=>",
"$",
"key",
"... | Get information about all files (key, label, data)
@return array | [
"Get",
"information",
"about",
"all",
"files",
"(",
"key",
"label",
"data",
")"
] | train | https://github.com/jan-dolata/crude-crud/blob/9129ea08278835cf5cecfd46a90369226ae6bdd7/src/Engine/Helpers/CrudeSpecialFiles.php#L15-L26 |
jan-dolata/crude-crud | src/Engine/Helpers/CrudeSpecialFiles.php | CrudeSpecialFiles.downloadData | public function downloadData($key)
{
$fileData = $this->getFileData($key);
if (! $fileData)
return false;
return [
'path' => $fileData['path'],
'name' => $this->getLabel($key) . '.' . $fileData['extension']
];
} | php | public function downloadData($key)
{
$fileData = $this->getFileData($key);
if (! $fileData)
return false;
return [
'path' => $fileData['path'],
'name' => $this->getLabel($key) . '.' . $fileData['extension']
];
} | [
"public",
"function",
"downloadData",
"(",
"$",
"key",
")",
"{",
"$",
"fileData",
"=",
"$",
"this",
"->",
"getFileData",
"(",
"$",
"key",
")",
";",
"if",
"(",
"!",
"$",
"fileData",
")",
"return",
"false",
";",
"return",
"[",
"'path'",
"=>",
"$",
"f... | Get download params: path and name
@param string $key
@return array | [
"Get",
"download",
"params",
":",
"path",
"and",
"name"
] | train | https://github.com/jan-dolata/crude-crud/blob/9129ea08278835cf5cecfd46a90369226ae6bdd7/src/Engine/Helpers/CrudeSpecialFiles.php#L34-L45 |
jan-dolata/crude-crud | src/Engine/Helpers/CrudeSpecialFiles.php | CrudeSpecialFiles.upload | public function upload($file, $key)
{
if (! $file || ! $this->isValidKey($key))
return;
$fileName = $file->getClientOriginalName();
$pathinfo = pathinfo($fileName);
$this->deleteStored($key);
Storage::putFileAs($this->getStoragePath(), $file, $key . '.' . $path... | php | public function upload($file, $key)
{
if (! $file || ! $this->isValidKey($key))
return;
$fileName = $file->getClientOriginalName();
$pathinfo = pathinfo($fileName);
$this->deleteStored($key);
Storage::putFileAs($this->getStoragePath(), $file, $key . '.' . $path... | [
"public",
"function",
"upload",
"(",
"$",
"file",
",",
"$",
"key",
")",
"{",
"if",
"(",
"!",
"$",
"file",
"||",
"!",
"$",
"this",
"->",
"isValidKey",
"(",
"$",
"key",
")",
")",
"return",
";",
"$",
"fileName",
"=",
"$",
"file",
"->",
"getClientOri... | Upload file if exist and key is correct
@param File $file
@param string $key | [
"Upload",
"file",
"if",
"exist",
"and",
"key",
"is",
"correct"
] | train | https://github.com/jan-dolata/crude-crud/blob/9129ea08278835cf5cecfd46a90369226ae6bdd7/src/Engine/Helpers/CrudeSpecialFiles.php#L53-L64 |
jan-dolata/crude-crud | src/Engine/Helpers/CrudeSpecialFiles.php | CrudeSpecialFiles.getFileData | private function getFileData($key)
{
foreach ($this->getStoredList() as $filePath) {
$pathinfo = pathinfo($filePath);
if ($key == $pathinfo['filename'])
return [
'storedPath' => $filePath,
'path' => storage_path('app/' . $file... | php | private function getFileData($key)
{
foreach ($this->getStoredList() as $filePath) {
$pathinfo = pathinfo($filePath);
if ($key == $pathinfo['filename'])
return [
'storedPath' => $filePath,
'path' => storage_path('app/' . $file... | [
"private",
"function",
"getFileData",
"(",
"$",
"key",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"getStoredList",
"(",
")",
"as",
"$",
"filePath",
")",
"{",
"$",
"pathinfo",
"=",
"pathinfo",
"(",
"$",
"filePath",
")",
";",
"if",
"(",
"$",
"key",
... | Get file path and extension or null if file is not stored
@param string $key
@return array|false | [
"Get",
"file",
"path",
"and",
"extension",
"or",
"null",
"if",
"file",
"is",
"not",
"stored"
] | train | https://github.com/jan-dolata/crude-crud/blob/9129ea08278835cf5cecfd46a90369226ae6bdd7/src/Engine/Helpers/CrudeSpecialFiles.php#L76-L93 |
iter8-au/builder | src/Builder/Builders/PhpSpreadsheet.php | PhpSpreadsheet.setCreator | public function setCreator(?string $creator = null)
{
$this->builder->getProperties()->setCreator($creator);
return $this;
} | php | public function setCreator(?string $creator = null)
{
$this->builder->getProperties()->setCreator($creator);
return $this;
} | [
"public",
"function",
"setCreator",
"(",
"?",
"string",
"$",
"creator",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"builder",
"->",
"getProperties",
"(",
")",
"->",
"setCreator",
"(",
"$",
"creator",
")",
";",
"return",
"$",
"this",
";",
"}"
] | {@inheritdoc} | [
"{"
] | train | https://github.com/iter8-au/builder/blob/95105636c2490c5c7a88da466702c523a9d0901c/src/Builder/Builders/PhpSpreadsheet.php#L45-L50 |
iter8-au/builder | src/Builder/Builders/PhpSpreadsheet.php | PhpSpreadsheet.setLastModifiedBy | public function setLastModifiedBy(?string $lastModifiedBy = null)
{
$this->builder->getProperties()->setLastModifiedBy($lastModifiedBy);
return $this;
} | php | public function setLastModifiedBy(?string $lastModifiedBy = null)
{
$this->builder->getProperties()->setLastModifiedBy($lastModifiedBy);
return $this;
} | [
"public",
"function",
"setLastModifiedBy",
"(",
"?",
"string",
"$",
"lastModifiedBy",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"builder",
"->",
"getProperties",
"(",
")",
"->",
"setLastModifiedBy",
"(",
"$",
"lastModifiedBy",
")",
";",
"return",
"$",
"this"... | {@inheritdoc} | [
"{"
] | train | https://github.com/iter8-au/builder/blob/95105636c2490c5c7a88da466702c523a9d0901c/src/Builder/Builders/PhpSpreadsheet.php#L55-L60 |
iter8-au/builder | src/Builder/Builders/PhpSpreadsheet.php | PhpSpreadsheet.setTitle | public function setTitle(?string $title = null)
{
$this->builder->getProperties()->setTitle($title);
return $this;
} | php | public function setTitle(?string $title = null)
{
$this->builder->getProperties()->setTitle($title);
return $this;
} | [
"public",
"function",
"setTitle",
"(",
"?",
"string",
"$",
"title",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"builder",
"->",
"getProperties",
"(",
")",
"->",
"setTitle",
"(",
"$",
"title",
")",
";",
"return",
"$",
"this",
";",
"}"
] | {@inheritdoc} | [
"{"
] | train | https://github.com/iter8-au/builder/blob/95105636c2490c5c7a88da466702c523a9d0901c/src/Builder/Builders/PhpSpreadsheet.php#L65-L70 |
iter8-au/builder | src/Builder/Builders/PhpSpreadsheet.php | PhpSpreadsheet.setSubject | public function setSubject(?string $subject = null)
{
$this->builder->getProperties()->setSubject($subject);
return $this;
} | php | public function setSubject(?string $subject = null)
{
$this->builder->getProperties()->setSubject($subject);
return $this;
} | [
"public",
"function",
"setSubject",
"(",
"?",
"string",
"$",
"subject",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"builder",
"->",
"getProperties",
"(",
")",
"->",
"setSubject",
"(",
"$",
"subject",
")",
";",
"return",
"$",
"this",
";",
"}"
] | {@inheritdoc} | [
"{"
] | train | https://github.com/iter8-au/builder/blob/95105636c2490c5c7a88da466702c523a9d0901c/src/Builder/Builders/PhpSpreadsheet.php#L75-L80 |
iter8-au/builder | src/Builder/Builders/PhpSpreadsheet.php | PhpSpreadsheet.setDescription | public function setDescription(?string $description = null)
{
$this->builder->getProperties()->setDescription($description);
return $this;
} | php | public function setDescription(?string $description = null)
{
$this->builder->getProperties()->setDescription($description);
return $this;
} | [
"public",
"function",
"setDescription",
"(",
"?",
"string",
"$",
"description",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"builder",
"->",
"getProperties",
"(",
")",
"->",
"setDescription",
"(",
"$",
"description",
")",
";",
"return",
"$",
"this",
";",
"... | {@inheritdoc} | [
"{"
] | train | https://github.com/iter8-au/builder/blob/95105636c2490c5c7a88da466702c523a9d0901c/src/Builder/Builders/PhpSpreadsheet.php#L85-L90 |
iter8-au/builder | src/Builder/Builders/PhpSpreadsheet.php | PhpSpreadsheet.createNewSheet | public function createNewSheet(): void
{
$newSheet = $this->builder->createSheet();
$newSheetIndex = $this->builder->getIndex($newSheet);
$this->setActiveSheetIndex($newSheetIndex);
} | php | public function createNewSheet(): void
{
$newSheet = $this->builder->createSheet();
$newSheetIndex = $this->builder->getIndex($newSheet);
$this->setActiveSheetIndex($newSheetIndex);
} | [
"public",
"function",
"createNewSheet",
"(",
")",
":",
"void",
"{",
"$",
"newSheet",
"=",
"$",
"this",
"->",
"builder",
"->",
"createSheet",
"(",
")",
";",
"$",
"newSheetIndex",
"=",
"$",
"this",
"->",
"builder",
"->",
"getIndex",
"(",
"$",
"newSheet",
... | {@inheritdoc} | [
"{"
] | train | https://github.com/iter8-au/builder/blob/95105636c2490c5c7a88da466702c523a9d0901c/src/Builder/Builders/PhpSpreadsheet.php#L115-L122 |
iter8-au/builder | src/Builder/Builders/PhpSpreadsheet.php | PhpSpreadsheet.buildRowStyle | public function buildRowStyle(array $style)
{
$finalStyleArray = [];
$defaultStyleArray = [
'alignment' => [
'horizontal' => Alignment::HORIZONTAL_LEFT,
],
'font' => [
'color' => [
'rgb' => BuilderInterfac... | php | public function buildRowStyle(array $style)
{
$finalStyleArray = [];
$defaultStyleArray = [
'alignment' => [
'horizontal' => Alignment::HORIZONTAL_LEFT,
],
'font' => [
'color' => [
'rgb' => BuilderInterfac... | [
"public",
"function",
"buildRowStyle",
"(",
"array",
"$",
"style",
")",
"{",
"$",
"finalStyleArray",
"=",
"[",
"]",
";",
"$",
"defaultStyleArray",
"=",
"[",
"'alignment'",
"=>",
"[",
"'horizontal'",
"=>",
"Alignment",
"::",
"HORIZONTAL_LEFT",
",",
"]",
",",
... | http://stackoverflow.com/questions/12918586/phpexcel-specific-cell-formatting-from-style-object
@param array $style
@return array | [
"http",
":",
"//",
"stackoverflow",
".",
"com",
"/",
"questions",
"/",
"12918586",
"/",
"phpexcel",
"-",
"specific",
"-",
"cell",
"-",
"formatting",
"-",
"from",
"-",
"style",
"-",
"object"
] | train | https://github.com/iter8-au/builder/blob/95105636c2490c5c7a88da466702c523a9d0901c/src/Builder/Builders/PhpSpreadsheet.php#L131-L182 |
iter8-au/builder | src/Builder/Builders/PhpSpreadsheet.php | PhpSpreadsheet.buildHeaderRow | public function buildHeaderRow(
array $columns,
$style = null
): void {
// The row needs to start at 1 at the beginning of execution.
// The top left corner of the sheet is actually position (col = 0, row = 1).
$row = 1;
$column = 1;
foreach ($columns as $... | php | public function buildHeaderRow(
array $columns,
$style = null
): void {
// The row needs to start at 1 at the beginning of execution.
// The top left corner of the sheet is actually position (col = 0, row = 1).
$row = 1;
$column = 1;
foreach ($columns as $... | [
"public",
"function",
"buildHeaderRow",
"(",
"array",
"$",
"columns",
",",
"$",
"style",
"=",
"null",
")",
":",
"void",
"{",
"// The row needs to start at 1 at the beginning of execution.",
"// The top left corner of the sheet is actually position (col = 0, row = 1).",
"$",
"ro... | {@inheritdoc} | [
"{"
] | train | https://github.com/iter8-au/builder/blob/95105636c2490c5c7a88da466702c523a9d0901c/src/Builder/Builders/PhpSpreadsheet.php#L187-L210 |
iter8-au/builder | src/Builder/Builders/PhpSpreadsheet.php | PhpSpreadsheet.buildRow | public function buildRow(
array $row,
$style = null,
$rowIndex = 1
): void {
$columnIndex = 1;
foreach ($row as $column) {
$this->builder->getActiveSheet()->setCellValueByColumnAndRow($columnIndex, $rowIndex, $column);
$columnIndex++;
}
... | php | public function buildRow(
array $row,
$style = null,
$rowIndex = 1
): void {
$columnIndex = 1;
foreach ($row as $column) {
$this->builder->getActiveSheet()->setCellValueByColumnAndRow($columnIndex, $rowIndex, $column);
$columnIndex++;
}
... | [
"public",
"function",
"buildRow",
"(",
"array",
"$",
"row",
",",
"$",
"style",
"=",
"null",
",",
"$",
"rowIndex",
"=",
"1",
")",
":",
"void",
"{",
"$",
"columnIndex",
"=",
"1",
";",
"foreach",
"(",
"$",
"row",
"as",
"$",
"column",
")",
"{",
"$",
... | {@inheritdoc} | [
"{"
] | train | https://github.com/iter8-au/builder/blob/95105636c2490c5c7a88da466702c523a9d0901c/src/Builder/Builders/PhpSpreadsheet.php#L215-L229 |
iter8-au/builder | src/Builder/Builders/PhpSpreadsheet.php | PhpSpreadsheet.buildRows | public function buildRows(
array $rows,
$style = null
): void {
// The row needs to start at 1 at the beginning of execution.
// The top left corner of the sheet is actually position (col = 1, row = 1).
$rowIndex = 1;
// If we have a header row then we need to bump t... | php | public function buildRows(
array $rows,
$style = null
): void {
// The row needs to start at 1 at the beginning of execution.
// The top left corner of the sheet is actually position (col = 1, row = 1).
$rowIndex = 1;
// If we have a header row then we need to bump t... | [
"public",
"function",
"buildRows",
"(",
"array",
"$",
"rows",
",",
"$",
"style",
"=",
"null",
")",
":",
"void",
"{",
"// The row needs to start at 1 at the beginning of execution.",
"// The top left corner of the sheet is actually position (col = 1, row = 1).",
"$",
"rowIndex",... | http://stackoverflow.com/questions/2584954/phpexcel-how-to-set-cell-value-dynamically
{@inheritdoc} | [
"http",
":",
"//",
"stackoverflow",
".",
"com",
"/",
"questions",
"/",
"2584954",
"/",
"phpexcel",
"-",
"how",
"-",
"to",
"-",
"set",
"-",
"cell",
"-",
"value",
"-",
"dynamically"
] | train | https://github.com/iter8-au/builder/blob/95105636c2490c5c7a88da466702c523a9d0901c/src/Builder/Builders/PhpSpreadsheet.php#L236-L257 |
iter8-au/builder | src/Builder/Builders/PhpSpreadsheet.php | PhpSpreadsheet.applyColumnWidths | public function applyColumnWidths(
array $columns,
array $widths,
$sheet = null
): void {
if ($sheet !== null) {
$this->builder->setActiveSheetIndex($sheet);
}
// Loop through all of our column values - we only set values for columns that we actually hav... | php | public function applyColumnWidths(
array $columns,
array $widths,
$sheet = null
): void {
if ($sheet !== null) {
$this->builder->setActiveSheetIndex($sheet);
}
// Loop through all of our column values - we only set values for columns that we actually hav... | [
"public",
"function",
"applyColumnWidths",
"(",
"array",
"$",
"columns",
",",
"array",
"$",
"widths",
",",
"$",
"sheet",
"=",
"null",
")",
":",
"void",
"{",
"if",
"(",
"$",
"sheet",
"!==",
"null",
")",
"{",
"$",
"this",
"->",
"builder",
"->",
"setAct... | {@inheritdoc} | [
"{"
] | train | https://github.com/iter8-au/builder/blob/95105636c2490c5c7a88da466702c523a9d0901c/src/Builder/Builders/PhpSpreadsheet.php#L262-L277 |
iter8-au/builder | src/Builder/Builders/PhpSpreadsheet.php | PhpSpreadsheet.autoSizeColumns | public function autoSizeColumns(
array $columns,
$sheet = null
): void {
if ($sheet !== null) {
$this->builder->setActiveSheetIndex($sheet);
}
$columnCount = count($columns);
for ($columnIndex = 1; $columnIndex <= $columnCount; $columnIndex++) {
... | php | public function autoSizeColumns(
array $columns,
$sheet = null
): void {
if ($sheet !== null) {
$this->builder->setActiveSheetIndex($sheet);
}
$columnCount = count($columns);
for ($columnIndex = 1; $columnIndex <= $columnCount; $columnIndex++) {
... | [
"public",
"function",
"autoSizeColumns",
"(",
"array",
"$",
"columns",
",",
"$",
"sheet",
"=",
"null",
")",
":",
"void",
"{",
"if",
"(",
"$",
"sheet",
"!==",
"null",
")",
"{",
"$",
"this",
"->",
"builder",
"->",
"setActiveSheetIndex",
"(",
"$",
"sheet"... | {@inheritdoc} | [
"{"
] | train | https://github.com/iter8-au/builder/blob/95105636c2490c5c7a88da466702c523a9d0901c/src/Builder/Builders/PhpSpreadsheet.php#L282-L297 |
iter8-au/builder | src/Builder/Builders/PhpSpreadsheet.php | PhpSpreadsheet.closeAndWrite | public function closeAndWrite(string $type = 'Xlsx'): void
{
$writer = IOFactory::createWriter($this->builder, $type);
$writer->save($this->getTempName());
} | php | public function closeAndWrite(string $type = 'Xlsx'): void
{
$writer = IOFactory::createWriter($this->builder, $type);
$writer->save($this->getTempName());
} | [
"public",
"function",
"closeAndWrite",
"(",
"string",
"$",
"type",
"=",
"'Xlsx'",
")",
":",
"void",
"{",
"$",
"writer",
"=",
"IOFactory",
"::",
"createWriter",
"(",
"$",
"this",
"->",
"builder",
",",
"$",
"type",
")",
";",
"$",
"writer",
"->",
"save",
... | {@inheritdoc} | [
"{"
] | train | https://github.com/iter8-au/builder/blob/95105636c2490c5c7a88da466702c523a9d0901c/src/Builder/Builders/PhpSpreadsheet.php#L302-L307 |
tonicospinelli/class-generation | src/ClassGeneration/Collection/ArrayCollection.php | ArrayCollection.contains | public function contains($element)
{
foreach ($this->elements as $collectionElement) {
if ($element === $collectionElement) {
return true;
}
}
return false;
} | php | public function contains($element)
{
foreach ($this->elements as $collectionElement) {
if ($element === $collectionElement) {
return true;
}
}
return false;
} | [
"public",
"function",
"contains",
"(",
"$",
"element",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"elements",
"as",
"$",
"collectionElement",
")",
"{",
"if",
"(",
"$",
"element",
"===",
"$",
"collectionElement",
")",
"{",
"return",
"true",
";",
"}",
... | {@inheritdoc} | [
"{"
] | train | https://github.com/tonicospinelli/class-generation/blob/eee63bdb68c066b25b885b57b23656e809381a76/src/ClassGeneration/Collection/ArrayCollection.php#L163-L172 |
tonicospinelli/class-generation | src/ClassGeneration/Collection/ArrayCollection.php | ArrayCollection.exists | public function exists($findKey = null, $findElement = null)
{
if (!is_null($findKey) && is_null($findElement)) {
return $this->containsKey($findKey);
} elseif (is_null($findKey) && !is_null($findElement)) {
return $this->contains($findElement);
} else {
r... | php | public function exists($findKey = null, $findElement = null)
{
if (!is_null($findKey) && is_null($findElement)) {
return $this->containsKey($findKey);
} elseif (is_null($findKey) && !is_null($findElement)) {
return $this->contains($findElement);
} else {
r... | [
"public",
"function",
"exists",
"(",
"$",
"findKey",
"=",
"null",
",",
"$",
"findElement",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"is_null",
"(",
"$",
"findKey",
")",
"&&",
"is_null",
"(",
"$",
"findElement",
")",
")",
"{",
"return",
"$",
"this",
"... | {@inheritdoc}
@param string $findElement | [
"{"
] | train | https://github.com/tonicospinelli/class-generation/blob/eee63bdb68c066b25b885b57b23656e809381a76/src/ClassGeneration/Collection/ArrayCollection.php#L178-L187 |
movoin/one-swoole | src/Protocol/Exceptions/ProtocolException.php | ProtocolException.badRequest | public static function badRequest(string $message, string $protocol = Protocol::HTTP): self
{
return new static(sprintf('Bad Request: `%s`', $message), $protocol, 400);
} | php | public static function badRequest(string $message, string $protocol = Protocol::HTTP): self
{
return new static(sprintf('Bad Request: `%s`', $message), $protocol, 400);
} | [
"public",
"static",
"function",
"badRequest",
"(",
"string",
"$",
"message",
",",
"string",
"$",
"protocol",
"=",
"Protocol",
"::",
"HTTP",
")",
":",
"self",
"{",
"return",
"new",
"static",
"(",
"sprintf",
"(",
"'Bad Request: `%s`'",
",",
"$",
"message",
"... | 非法请求
@param string $message
@param string $protocol
@return self 400 | [
"非法请求"
] | train | https://github.com/movoin/one-swoole/blob/b9b175963ead91416cc50902a04e05ff3ef571de/src/Protocol/Exceptions/ProtocolException.php#L50-L53 |
movoin/one-swoole | src/Protocol/Exceptions/ProtocolException.php | ProtocolException.unauthorized | public static function unauthorized(string $uri, string $protocol = Protocol::HTTP): self
{
return new static(sprintf('Unauthorized: `%s`', $uri), $protocol, 401);
} | php | public static function unauthorized(string $uri, string $protocol = Protocol::HTTP): self
{
return new static(sprintf('Unauthorized: `%s`', $uri), $protocol, 401);
} | [
"public",
"static",
"function",
"unauthorized",
"(",
"string",
"$",
"uri",
",",
"string",
"$",
"protocol",
"=",
"Protocol",
"::",
"HTTP",
")",
":",
"self",
"{",
"return",
"new",
"static",
"(",
"sprintf",
"(",
"'Unauthorized: `%s`'",
",",
"$",
"uri",
")",
... | 未授权请求
@param string $uri
@param string $protocol
@return self 401 | [
"未授权请求"
] | train | https://github.com/movoin/one-swoole/blob/b9b175963ead91416cc50902a04e05ff3ef571de/src/Protocol/Exceptions/ProtocolException.php#L63-L66 |
movoin/one-swoole | src/Protocol/Exceptions/ProtocolException.php | ProtocolException.notFound | public static function notFound(string $uri, string $protocol = Protocol::HTTP): self
{
return new static(sprintf('Not Found: %s', $uri), $protocol, 404);
} | php | public static function notFound(string $uri, string $protocol = Protocol::HTTP): self
{
return new static(sprintf('Not Found: %s', $uri), $protocol, 404);
} | [
"public",
"static",
"function",
"notFound",
"(",
"string",
"$",
"uri",
",",
"string",
"$",
"protocol",
"=",
"Protocol",
"::",
"HTTP",
")",
":",
"self",
"{",
"return",
"new",
"static",
"(",
"sprintf",
"(",
"'Not Found: %s'",
",",
"$",
"uri",
")",
",",
"... | URI 未找到
@param string $uri
@param string $protocol
@return self 404 | [
"URI",
"未找到"
] | train | https://github.com/movoin/one-swoole/blob/b9b175963ead91416cc50902a04e05ff3ef571de/src/Protocol/Exceptions/ProtocolException.php#L88-L91 |
movoin/one-swoole | src/Protocol/Exceptions/ProtocolException.php | ProtocolException.methodNotAllowed | public static function methodNotAllowed(string $method, string $uri, string $protocol = Protocol::HTTP): self
{
return new static(sprintf('`%s` not allowed `%s` method', $uri, $method), $protocol, 405);
} | php | public static function methodNotAllowed(string $method, string $uri, string $protocol = Protocol::HTTP): self
{
return new static(sprintf('`%s` not allowed `%s` method', $uri, $method), $protocol, 405);
} | [
"public",
"static",
"function",
"methodNotAllowed",
"(",
"string",
"$",
"method",
",",
"string",
"$",
"uri",
",",
"string",
"$",
"protocol",
"=",
"Protocol",
"::",
"HTTP",
")",
":",
"self",
"{",
"return",
"new",
"static",
"(",
"sprintf",
"(",
"'`%s` not al... | 请求方式不允许
@param string $method
@param string $uri
@param string $protocol
@return self 405 | [
"请求方式不允许"
] | train | https://github.com/movoin/one-swoole/blob/b9b175963ead91416cc50902a04e05ff3ef571de/src/Protocol/Exceptions/ProtocolException.php#L102-L105 |
movoin/one-swoole | src/Protocol/Exceptions/ProtocolException.php | ProtocolException.notAcceptable | public static function notAcceptable(string $contentType, string $protocol = Protocol::HTTP): self
{
return new static(sprintf('Content type `%s` not acceptable', $contentType), $protocol, 406);
} | php | public static function notAcceptable(string $contentType, string $protocol = Protocol::HTTP): self
{
return new static(sprintf('Content type `%s` not acceptable', $contentType), $protocol, 406);
} | [
"public",
"static",
"function",
"notAcceptable",
"(",
"string",
"$",
"contentType",
",",
"string",
"$",
"protocol",
"=",
"Protocol",
"::",
"HTTP",
")",
":",
"self",
"{",
"return",
"new",
"static",
"(",
"sprintf",
"(",
"'Content type `%s` not acceptable'",
",",
... | 请求内容类型不支持
@param string $contentType
@param string $protocol
@return self 406 | [
"请求内容类型不支持"
] | train | https://github.com/movoin/one-swoole/blob/b9b175963ead91416cc50902a04e05ff3ef571de/src/Protocol/Exceptions/ProtocolException.php#L115-L118 |
movoin/one-swoole | src/Protocol/Exceptions/ProtocolException.php | ProtocolException.makeResponse | public function makeResponse(Request $request, Response $response, Responder $responder): Response
{
return $responder(
$request,
$response,
new Payload(
$this->getCode(),
'',
$this->getMessage()
)
);
... | php | public function makeResponse(Request $request, Response $response, Responder $responder): Response
{
return $responder(
$request,
$response,
new Payload(
$this->getCode(),
'',
$this->getMessage()
)
);
... | [
"public",
"function",
"makeResponse",
"(",
"Request",
"$",
"request",
",",
"Response",
"$",
"response",
",",
"Responder",
"$",
"responder",
")",
":",
"Response",
"{",
"return",
"$",
"responder",
"(",
"$",
"request",
",",
"$",
"response",
",",
"new",
"Paylo... | 获得异常响应对象
@param \One\Protocol\Contracts\Request $request
@param \One\Protocol\Contracts\Response $response
@param \One\Protocol\Contracts\Responder $responder
@return \One\Protocol\Contracts\Response | [
"获得异常响应对象"
] | train | https://github.com/movoin/one-swoole/blob/b9b175963ead91416cc50902a04e05ff3ef571de/src/Protocol/Exceptions/ProtocolException.php#L175-L186 |
Srokap/code_review | classes/CodeReview/Autoloader.php | Autoloader.registerDirectory | private function registerDirectory($basePath, $prefix = '') {
$basePath = str_replace('\\', '/', $basePath);
$basePath = rtrim($basePath, '/') . '/';
$prefix = ($prefix ? $prefix . '_' : '' );
$files = scandir($basePath);
foreach ($files as $file) {
if ($file[0] == '.') {
continue;
}
$path = $bas... | php | private function registerDirectory($basePath, $prefix = '') {
$basePath = str_replace('\\', '/', $basePath);
$basePath = rtrim($basePath, '/') . '/';
$prefix = ($prefix ? $prefix . '_' : '' );
$files = scandir($basePath);
foreach ($files as $file) {
if ($file[0] == '.') {
continue;
}
$path = $bas... | [
"private",
"function",
"registerDirectory",
"(",
"$",
"basePath",
",",
"$",
"prefix",
"=",
"''",
")",
"{",
"$",
"basePath",
"=",
"str_replace",
"(",
"'\\\\'",
",",
"'/'",
",",
"$",
"basePath",
")",
";",
"$",
"basePath",
"=",
"rtrim",
"(",
"$",
"basePat... | Not fully PSR-0 compatible, but good enough for this particular plugin
@param string $basePath
@param string $prefix | [
"Not",
"fully",
"PSR",
"-",
"0",
"compatible",
"but",
"good",
"enough",
"for",
"this",
"particular",
"plugin"
] | train | https://github.com/Srokap/code_review/blob/c79c619f99279cf15713b118ae19b0ef017db362/classes/CodeReview/Autoloader.php#L24-L43 |
fuelphp/display | src/View.php | View.render | public function render(array $data = [])
{
if ( ! empty($data))
{
$this->set($data);
}
return $this->parser->parse($this->file, $this->getData());
} | php | public function render(array $data = [])
{
if ( ! empty($data))
{
$this->set($data);
}
return $this->parser->parse($this->file, $this->getData());
} | [
"public",
"function",
"render",
"(",
"array",
"$",
"data",
"=",
"[",
"]",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"data",
")",
")",
"{",
"$",
"this",
"->",
"set",
"(",
"$",
"data",
")",
";",
"}",
"return",
"$",
"this",
"->",
"parser",
"-... | Renders the view
@param array $data additional view data
@return string | [
"Renders",
"the",
"view"
] | train | https://github.com/fuelphp/display/blob/d9a3eddbf80f0fd81beb40d9f4507600ac6611a4/src/View.php#L68-L76 |
hudhaifas/silverstripe-dataobject-manager | src/Extension/DataObject_PrivicyExtension.php | DataObject_PrivicyExtension.canCreate | public function canCreate($member) {
if (!$this->owner->isCreatable()) {
return false;
}
if (!$member) {
$member = Member::currentUserID();
}
if ($member && is_numeric($member)) {
$member = DataObject::get_by_id('Member', $member);
... | php | public function canCreate($member) {
if (!$this->owner->isCreatable()) {
return false;
}
if (!$member) {
$member = Member::currentUserID();
}
if ($member && is_numeric($member)) {
$member = DataObject::get_by_id('Member', $member);
... | [
"public",
"function",
"canCreate",
"(",
"$",
"member",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"owner",
"->",
"isCreatable",
"(",
")",
")",
"{",
"return",
"false",
";",
"}",
"if",
"(",
"!",
"$",
"member",
")",
"{",
"$",
"member",
"=",
"Membe... | / Permissions /// | [
"/",
"Permissions",
"///"
] | train | https://github.com/hudhaifas/silverstripe-dataobject-manager/blob/a8ecaeee785da4d3cdb722e44b40b8eff96e1f82/src/Extension/DataObject_PrivicyExtension.php#L116-L144 |
sulu/SuluSalesShippingBundle | src/Sulu/Bundle/Sales/OrderBundle/Controller/TemplateController.php | TemplateController.getSystemUserArray | public function getSystemUserArray()
{
$repo = $this->get('sulu_security.user_repository');
$users = $repo->getUserInSystem();
$contacts = [];
foreach ($users as $user) {
$contact = $user->getContact();
$contacts[] = array(
'id' => $contact->g... | php | public function getSystemUserArray()
{
$repo = $this->get('sulu_security.user_repository');
$users = $repo->getUserInSystem();
$contacts = [];
foreach ($users as $user) {
$contact = $user->getContact();
$contacts[] = array(
'id' => $contact->g... | [
"public",
"function",
"getSystemUserArray",
"(",
")",
"{",
"$",
"repo",
"=",
"$",
"this",
"->",
"get",
"(",
"'sulu_security.user_repository'",
")",
";",
"$",
"users",
"=",
"$",
"repo",
"->",
"getUserInSystem",
"(",
")",
";",
"$",
"contacts",
"=",
"[",
"]... | returns all sulu system users
@return array | [
"returns",
"all",
"sulu",
"system",
"users"
] | train | https://github.com/sulu/SuluSalesShippingBundle/blob/0d39de262d58579e5679db99a77dbf717d600b5e/src/Sulu/Bundle/Sales/OrderBundle/Controller/TemplateController.php#L51-L65 |
sulu/SuluSalesShippingBundle | src/Sulu/Bundle/Sales/OrderBundle/Controller/TemplateController.php | TemplateController.getOrderStatus | public function getOrderStatus()
{
$statuses = $this->getDoctrine()->getRepository(self::$orderStatusEntityName)->findAll();
$locale = $this->getUser()->getLocale();
$statusArray = [];
foreach ($statuses as $statusEntity) {
$status = new OrderStatus($statusEntity, $local... | php | public function getOrderStatus()
{
$statuses = $this->getDoctrine()->getRepository(self::$orderStatusEntityName)->findAll();
$locale = $this->getUser()->getLocale();
$statusArray = [];
foreach ($statuses as $statusEntity) {
$status = new OrderStatus($statusEntity, $local... | [
"public",
"function",
"getOrderStatus",
"(",
")",
"{",
"$",
"statuses",
"=",
"$",
"this",
"->",
"getDoctrine",
"(",
")",
"->",
"getRepository",
"(",
"self",
"::",
"$",
"orderStatusEntityName",
")",
"->",
"findAll",
"(",
")",
";",
"$",
"locale",
"=",
"$",... | returns array of order statuses
@return array | [
"returns",
"array",
"of",
"order",
"statuses"
] | train | https://github.com/sulu/SuluSalesShippingBundle/blob/0d39de262d58579e5679db99a77dbf717d600b5e/src/Sulu/Bundle/Sales/OrderBundle/Controller/TemplateController.php#L90-L104 |
sulu/SuluSalesShippingBundle | src/Sulu/Bundle/Sales/OrderBundle/Controller/TemplateController.php | TemplateController.getCurrencies | private function getCurrencies($language)
{
/** @var Currency[] $currencies */
$currencies = $this->get('sulu_product.currency_manager')->findAll($language);
$currencyValues = array();
foreach ($currencies as $currency) {
$currencyValues[] = array(
'id' ... | php | private function getCurrencies($language)
{
/** @var Currency[] $currencies */
$currencies = $this->get('sulu_product.currency_manager')->findAll($language);
$currencyValues = array();
foreach ($currencies as $currency) {
$currencyValues[] = array(
'id' ... | [
"private",
"function",
"getCurrencies",
"(",
"$",
"language",
")",
"{",
"/** @var Currency[] $currencies */",
"$",
"currencies",
"=",
"$",
"this",
"->",
"get",
"(",
"'sulu_product.currency_manager'",
")",
"->",
"findAll",
"(",
"$",
"language",
")",
";",
"$",
"cu... | Returns currencies
@param $language
@return array | [
"Returns",
"currencies"
] | train | https://github.com/sulu/SuluSalesShippingBundle/blob/0d39de262d58579e5679db99a77dbf717d600b5e/src/Sulu/Bundle/Sales/OrderBundle/Controller/TemplateController.php#L112-L128 |
geosocio/http-serializer-bundle | src/DependencyInjection/GeoSocioHttpSerializerExtension.php | GeoSocioHttpSerializerExtension.load | public function load(array $configs, ContainerBuilder $container)
{
$configuration = new Configuration();
$config = $this->processConfiguration($configuration, $configs);
// Group Resolver
$container->register(
'geosocio_http_serializer.request_group_resolver_manager',
... | php | public function load(array $configs, ContainerBuilder $container)
{
$configuration = new Configuration();
$config = $this->processConfiguration($configuration, $configs);
// Group Resolver
$container->register(
'geosocio_http_serializer.request_group_resolver_manager',
... | [
"public",
"function",
"load",
"(",
"array",
"$",
"configs",
",",
"ContainerBuilder",
"$",
"container",
")",
"{",
"$",
"configuration",
"=",
"new",
"Configuration",
"(",
")",
";",
"$",
"config",
"=",
"$",
"this",
"->",
"processConfiguration",
"(",
"$",
"con... | {@inheritdoc} | [
"{"
] | train | https://github.com/geosocio/http-serializer-bundle/blob/2ceb24a148204b1f3b14083b202db7e5afff2099/src/DependencyInjection/GeoSocioHttpSerializerExtension.php#L37-L134 |
dpi/ak | src/AvatarIdentifier.php | AvatarIdentifier.setRaw | public function setRaw(string $raw) {
$this->raw = $raw;
$this->hashed = NULL;
return $this;
} | php | public function setRaw(string $raw) {
$this->raw = $raw;
$this->hashed = NULL;
return $this;
} | [
"public",
"function",
"setRaw",
"(",
"string",
"$",
"raw",
")",
"{",
"$",
"this",
"->",
"raw",
"=",
"$",
"raw",
";",
"$",
"this",
"->",
"hashed",
"=",
"NULL",
";",
"return",
"$",
"this",
";",
"}"
] | {@inheritdoc} | [
"{"
] | train | https://github.com/dpi/ak/blob/cc61b172a827498cf6284191d51ce04d0f7c0f97/src/AvatarIdentifier.php#L48-L52 |
dpi/ak | src/AvatarIdentifier.php | AvatarIdentifier.getHashed | public function getHashed() {
if (isset($this->hashed)) {
return $this->hashed;
}
$hasher = $this->hasher ?? NULL;
$raw = $this->raw ?? NULL;
if ($raw) {
if (!is_callable($hasher)) {
throw new AvatarIdentifierException('No hashing algorithm set.');
}
return call_user... | php | public function getHashed() {
if (isset($this->hashed)) {
return $this->hashed;
}
$hasher = $this->hasher ?? NULL;
$raw = $this->raw ?? NULL;
if ($raw) {
if (!is_callable($hasher)) {
throw new AvatarIdentifierException('No hashing algorithm set.');
}
return call_user... | [
"public",
"function",
"getHashed",
"(",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"hashed",
")",
")",
"{",
"return",
"$",
"this",
"->",
"hashed",
";",
"}",
"$",
"hasher",
"=",
"$",
"this",
"->",
"hasher",
"??",
"NULL",
";",
"$",
"raw"... | {@inheritdoc} | [
"{"
] | train | https://github.com/dpi/ak/blob/cc61b172a827498cf6284191d51ce04d0f7c0f97/src/AvatarIdentifier.php#L57-L73 |
dpi/ak | src/AvatarIdentifier.php | AvatarIdentifier.setHashed | public function setHashed(string $string) {
$this->raw = NULL;
$this->hashed = $string;
return $this;
} | php | public function setHashed(string $string) {
$this->raw = NULL;
$this->hashed = $string;
return $this;
} | [
"public",
"function",
"setHashed",
"(",
"string",
"$",
"string",
")",
"{",
"$",
"this",
"->",
"raw",
"=",
"NULL",
";",
"$",
"this",
"->",
"hashed",
"=",
"$",
"string",
";",
"return",
"$",
"this",
";",
"}"
] | {@inheritdoc} | [
"{"
] | train | https://github.com/dpi/ak/blob/cc61b172a827498cf6284191d51ce04d0f7c0f97/src/AvatarIdentifier.php#L78-L82 |
chriswoodford/foursquare-php | lib/TheTwelve/Foursquare/HttpClient/CurlHttpClient.php | CurlHttpClient.get | public function get($uri, array $params = array())
{
$uri .= '?' . http_build_query($params);
$ch = $this->initCurlHandler($uri);
return $this->makeRequest($ch);
} | php | public function get($uri, array $params = array())
{
$uri .= '?' . http_build_query($params);
$ch = $this->initCurlHandler($uri);
return $this->makeRequest($ch);
} | [
"public",
"function",
"get",
"(",
"$",
"uri",
",",
"array",
"$",
"params",
"=",
"array",
"(",
")",
")",
"{",
"$",
"uri",
".=",
"'?'",
".",
"http_build_query",
"(",
"$",
"params",
")",
";",
"$",
"ch",
"=",
"$",
"this",
"->",
"initCurlHandler",
"(",
... | (non-PHPdoc)
@see TheTwelve\Foursquare.HttpClient::get() | [
"(",
"non",
"-",
"PHPdoc",
")"
] | train | https://github.com/chriswoodford/foursquare-php/blob/edbfcba2993a101ead8f381394742a4689aec398/lib/TheTwelve/Foursquare/HttpClient/CurlHttpClient.php#L73-L81 |
chriswoodford/foursquare-php | lib/TheTwelve/Foursquare/HttpClient/CurlHttpClient.php | CurlHttpClient.post | public function post($uri, array $params = array())
{
$ch = $this->initCurlHandler($uri);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $params);
return $this->makeRequest($ch);
} | php | public function post($uri, array $params = array())
{
$ch = $this->initCurlHandler($uri);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $params);
return $this->makeRequest($ch);
} | [
"public",
"function",
"post",
"(",
"$",
"uri",
",",
"array",
"$",
"params",
"=",
"array",
"(",
")",
")",
"{",
"$",
"ch",
"=",
"$",
"this",
"->",
"initCurlHandler",
"(",
"$",
"uri",
")",
";",
"curl_setopt",
"(",
"$",
"ch",
",",
"CURLOPT_POST",
",",
... | (non-PHPdoc)
@see TheTwelve\Foursquare.HttpClient::post() | [
"(",
"non",
"-",
"PHPdoc",
")"
] | train | https://github.com/chriswoodford/foursquare-php/blob/edbfcba2993a101ead8f381394742a4689aec398/lib/TheTwelve/Foursquare/HttpClient/CurlHttpClient.php#L87-L96 |
chriswoodford/foursquare-php | lib/TheTwelve/Foursquare/HttpClient/CurlHttpClient.php | CurlHttpClient.initCurlHandler | protected function initCurlHandler($uri)
{
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $uri);
curl_setopt($ch, CURLOPT_USERAGENT, 'twelvelabs/foursquare client');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, $this->verifyHost)... | php | protected function initCurlHandler($uri)
{
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $uri);
curl_setopt($ch, CURLOPT_USERAGENT, 'twelvelabs/foursquare client');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, $this->verifyHost)... | [
"protected",
"function",
"initCurlHandler",
"(",
"$",
"uri",
")",
"{",
"$",
"ch",
"=",
"curl_init",
"(",
")",
";",
"curl_setopt",
"(",
"$",
"ch",
",",
"CURLOPT_URL",
",",
"$",
"uri",
")",
";",
"curl_setopt",
"(",
"$",
"ch",
",",
"CURLOPT_USERAGENT",
",... | initialize the cURL handler
@param string $uri
@return resource | [
"initialize",
"the",
"cURL",
"handler"
] | train | https://github.com/chriswoodford/foursquare-php/blob/edbfcba2993a101ead8f381394742a4689aec398/lib/TheTwelve/Foursquare/HttpClient/CurlHttpClient.php#L103-L128 |
chriswoodford/foursquare-php | lib/TheTwelve/Foursquare/HttpClient/CurlHttpClient.php | CurlHttpClient.makeRequest | protected function makeRequest($ch)
{
$response = curl_exec($ch);
$error = curl_error($ch);
$code = curl_errno($ch);
if ($error) {
curl_close($ch);
throw new \RuntimeException($error, $code);
}
curl_close($ch);
return $response;
... | php | protected function makeRequest($ch)
{
$response = curl_exec($ch);
$error = curl_error($ch);
$code = curl_errno($ch);
if ($error) {
curl_close($ch);
throw new \RuntimeException($error, $code);
}
curl_close($ch);
return $response;
... | [
"protected",
"function",
"makeRequest",
"(",
"$",
"ch",
")",
"{",
"$",
"response",
"=",
"curl_exec",
"(",
"$",
"ch",
")",
";",
"$",
"error",
"=",
"curl_error",
"(",
"$",
"ch",
")",
";",
"$",
"code",
"=",
"curl_errno",
"(",
"$",
"ch",
")",
";",
"i... | make the cURL request
@param resource $ch
@return mixed | [
"make",
"the",
"cURL",
"request"
] | train | https://github.com/chriswoodford/foursquare-php/blob/edbfcba2993a101ead8f381394742a4689aec398/lib/TheTwelve/Foursquare/HttpClient/CurlHttpClient.php#L135-L151 |
etki/opencart-core-installer | src/Installer.php | Installer.supports | public function supports($packageType)
{
DebugPrinter::log(
'Checking support for package type `%s` (%s)',
array($packageType, $packageType === $this->packageType ? 'y' : 'n')
);
return $packageType === $this->packageType;
} | php | public function supports($packageType)
{
DebugPrinter::log(
'Checking support for package type `%s` (%s)',
array($packageType, $packageType === $this->packageType ? 'y' : 'n')
);
return $packageType === $this->packageType;
} | [
"public",
"function",
"supports",
"(",
"$",
"packageType",
")",
"{",
"DebugPrinter",
"::",
"log",
"(",
"'Checking support for package type `%s` (%s)'",
",",
"array",
"(",
"$",
"packageType",
",",
"$",
"packageType",
"===",
"$",
"this",
"->",
"packageType",
"?",
... | Tells composer if this installer supports provided package type.
@param string $packageType Package type name.
@return bool
@since 0.1.0 | [
"Tells",
"composer",
"if",
"this",
"installer",
"supports",
"provided",
"package",
"type",
"."
] | train | https://github.com/etki/opencart-core-installer/blob/e651c94982afe966cd36977bbdc2ff4f7e785475/src/Installer.php#L53-L60 |
etki/opencart-core-installer | src/Installer.php | Installer.getInstallPath | public function getInstallPath(PackageInterface $package)
{
$prettyName = $package->getPrettyName();
DebugPrinter::log(
'Getting install path for `%s` package',
array($prettyName,)
);
if (isset($this->installDirCache[$prettyName])) {
return $this->... | php | public function getInstallPath(PackageInterface $package)
{
$prettyName = $package->getPrettyName();
DebugPrinter::log(
'Getting install path for `%s` package',
array($prettyName,)
);
if (isset($this->installDirCache[$prettyName])) {
return $this->... | [
"public",
"function",
"getInstallPath",
"(",
"PackageInterface",
"$",
"package",
")",
"{",
"$",
"prettyName",
"=",
"$",
"package",
"->",
"getPrettyName",
"(",
")",
";",
"DebugPrinter",
"::",
"log",
"(",
"'Getting install path for `%s` package'",
",",
"array",
"(",... | Provides installation path for package. Kudos go to
https://github.com/johnpbloch/wordpress-core-installer
@param PackageInterface $package Installed package.
@todo refactor
@return string
@since 0.1.0 | [
"Provides",
"installation",
"path",
"for",
"package",
".",
"Kudos",
"go",
"to",
"https",
":",
"//",
"github",
".",
"com",
"/",
"johnpbloch",
"/",
"wordpress",
"-",
"core",
"-",
"installer"
] | train | https://github.com/etki/opencart-core-installer/blob/e651c94982afe966cd36977bbdc2ff4f7e785475/src/Installer.php#L73-L111 |
etki/opencart-core-installer | src/Installer.php | Installer.install | public function install(
InstalledRepositoryInterface $repo,
PackageInterface $package
) {
$installPath = $this->getInstallPath($package);
$junglist = new FileJunglist;
DebugPrinter::log(
'Installing package `%s` to %s',
array($package->getPrettyName()... | php | public function install(
InstalledRepositoryInterface $repo,
PackageInterface $package
) {
$installPath = $this->getInstallPath($package);
$junglist = new FileJunglist;
DebugPrinter::log(
'Installing package `%s` to %s',
array($package->getPrettyName()... | [
"public",
"function",
"install",
"(",
"InstalledRepositoryInterface",
"$",
"repo",
",",
"PackageInterface",
"$",
"package",
")",
"{",
"$",
"installPath",
"=",
"$",
"this",
"->",
"getInstallPath",
"(",
"$",
"package",
")",
";",
"$",
"junglist",
"=",
"new",
"F... | {@inheritdoc}
@param InstalledRepositoryInterface $repo Repository,
@param PackageInterface $package Package.
@return void
@since 0.1.0 | [
"{",
"@inheritdoc",
"}"
] | train | https://github.com/etki/opencart-core-installer/blob/e651c94982afe966cd36977bbdc2ff4f7e785475/src/Installer.php#L122-L137 |
etki/opencart-core-installer | src/Installer.php | Installer.update | public function update(
InstalledRepositoryInterface $repo,
PackageInterface $initial,
PackageInterface $target
) {
$installPath = $this->getInstallPath($target);
$junglist = new FileJunglist;
$junglist->saveModifiedFiles($installPath);
DebugPrinter::log('Upda... | php | public function update(
InstalledRepositoryInterface $repo,
PackageInterface $initial,
PackageInterface $target
) {
$installPath = $this->getInstallPath($target);
$junglist = new FileJunglist;
$junglist->saveModifiedFiles($installPath);
DebugPrinter::log('Upda... | [
"public",
"function",
"update",
"(",
"InstalledRepositoryInterface",
"$",
"repo",
",",
"PackageInterface",
"$",
"initial",
",",
"PackageInterface",
"$",
"target",
")",
"{",
"$",
"installPath",
"=",
"$",
"this",
"->",
"getInstallPath",
"(",
"$",
"target",
")",
... | {@inheritdoc}
@param InstalledRepositoryInterface $repo Repository,
@param PackageInterface $initial Current package.
@param PackageInterface $target Newly installed package.
@return void
@since 0.1.0 | [
"{",
"@inheritdoc",
"}"
] | train | https://github.com/etki/opencart-core-installer/blob/e651c94982afe966cd36977bbdc2ff4f7e785475/src/Installer.php#L149-L163 |
sfnt/wechat-php-sdk | src/Wechat.php | Wechat.uploadForeverMedia | public function uploadForeverMedia($data, $type,$is_video=false,$video_info=array()){
if (!$this->access_token && !$this->checkAuth()) return false;
//#TODO 暂不确定此接口是否需要让视频文件走http协议
//如果要获取的素材是视频文件时,不能使用https协议,必须更换成http协议
//$url_prefix = $is_video?str_replace('https','http',self::API_URL... | php | public function uploadForeverMedia($data, $type,$is_video=false,$video_info=array()){
if (!$this->access_token && !$this->checkAuth()) return false;
//#TODO 暂不确定此接口是否需要让视频文件走http协议
//如果要获取的素材是视频文件时,不能使用https协议,必须更换成http协议
//$url_prefix = $is_video?str_replace('https','http',self::API_URL... | [
"public",
"function",
"uploadForeverMedia",
"(",
"$",
"data",
",",
"$",
"type",
",",
"$",
"is_video",
"=",
"false",
",",
"$",
"video_info",
"=",
"array",
"(",
")",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"access_token",
"&&",
"!",
"$",
"this",
... | 上传永久素材(认证后的订阅号可用)
新增的永久素材也可以在公众平台官网素材管理模块中看到
注意:上传大文件时可能需要先调用 set_time_limit(0) 避免超时
注意:数组的键值任意,但文件名前必须加@,使用单引号以避免本地路径斜杠被转义
@param array $data {"media":'@Path\filename.jpg'}
@param type 类型:图片:image 语音:voice 视频:video 缩略图:thumb
@param boolean $is_video 是否为视频文件,默认为否
@param array $video_info 视频信息数组,非视频素材不需要提供 array('title'... | [
"上传永久素材",
"(",
"认证后的订阅号可用",
")",
"新增的永久素材也可以在公众平台官网素材管理模块中看到",
"注意:上传大文件时可能需要先调用",
"set_time_limit",
"(",
"0",
")",
"避免超时",
"注意:数组的键值任意,但文件名前必须加"
] | train | https://github.com/sfnt/wechat-php-sdk/blob/d14b8511f96cfcf0da5f413b446e69943cc3ea90/src/Wechat.php#L1572-L1591 |
sfnt/wechat-php-sdk | src/Wechat.php | Wechat.updateForeverArticles | public function updateForeverArticles($media_id,$data,$index=0){
if (!$this->access_token && !$this->checkAuth()) return false;
if (!isset($data['media_id'])) $data['media_id'] = $media_id;
if (!isset($data['index'])) $data['index'] = $index;
$result = $this->http_post(self::API_URL_PREF... | php | public function updateForeverArticles($media_id,$data,$index=0){
if (!$this->access_token && !$this->checkAuth()) return false;
if (!isset($data['media_id'])) $data['media_id'] = $media_id;
if (!isset($data['index'])) $data['index'] = $index;
$result = $this->http_post(self::API_URL_PREF... | [
"public",
"function",
"updateForeverArticles",
"(",
"$",
"media_id",
",",
"$",
"data",
",",
"$",
"index",
"=",
"0",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"access_token",
"&&",
"!",
"$",
"this",
"->",
"checkAuth",
"(",
")",
")",
"return",
"fals... | 修改永久图文素材(认证后的订阅号可用)
永久素材也可以在公众平台官网素材管理模块中看到
@param string $media_id 图文素材id
@param array $data 消息结构{"articles":[{...}]}
@param int $index 更新的文章在图文素材的位置,第一篇为0,仅多图文使用
@return boolean|array | [
"修改永久图文素材",
"(",
"认证后的订阅号可用",
")",
"永久素材也可以在公众平台官网素材管理模块中看到"
] | train | https://github.com/sfnt/wechat-php-sdk/blob/d14b8511f96cfcf0da5f413b446e69943cc3ea90/src/Wechat.php#L1623-L1639 |
sfnt/wechat-php-sdk | src/Wechat.php | Wechat.delForeverMedia | public function delForeverMedia($media_id){
if (!$this->access_token && !$this->checkAuth()) return false;
$data = array('media_id' => $media_id);
$result = $this->http_post(self::API_URL_PREFIX.self::MEDIA_FOREVER_DEL_URL.'access_token='.$this->access_token,self::json_encode($data));
if... | php | public function delForeverMedia($media_id){
if (!$this->access_token && !$this->checkAuth()) return false;
$data = array('media_id' => $media_id);
$result = $this->http_post(self::API_URL_PREFIX.self::MEDIA_FOREVER_DEL_URL.'access_token='.$this->access_token,self::json_encode($data));
if... | [
"public",
"function",
"delForeverMedia",
"(",
"$",
"media_id",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"access_token",
"&&",
"!",
"$",
"this",
"->",
"checkAuth",
"(",
")",
")",
"return",
"false",
";",
"$",
"data",
"=",
"array",
"(",
"'media_id'",
... | 删除永久素材(认证后的订阅号可用)
@param string $media_id 媒体文件id
@return boolean | [
"删除永久素材",
"(",
"认证后的订阅号可用",
")"
] | train | https://github.com/sfnt/wechat-php-sdk/blob/d14b8511f96cfcf0da5f413b446e69943cc3ea90/src/Wechat.php#L1676-L1691 |
sfnt/wechat-php-sdk | src/Wechat.php | Wechat.getForeverList | public function getForeverList($type,$offset,$count){
if (!$this->access_token && !$this->checkAuth()) return false;
$data = array(
'type' => $type,
'offset' => $offset,
'count' => $count,
);
$result = $this->http_post(self::API_URL_PREFIX.self::MEDIA_... | php | public function getForeverList($type,$offset,$count){
if (!$this->access_token && !$this->checkAuth()) return false;
$data = array(
'type' => $type,
'offset' => $offset,
'count' => $count,
);
$result = $this->http_post(self::API_URL_PREFIX.self::MEDIA_... | [
"public",
"function",
"getForeverList",
"(",
"$",
"type",
",",
"$",
"offset",
",",
"$",
"count",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"access_token",
"&&",
"!",
"$",
"this",
"->",
"checkAuth",
"(",
")",
")",
"return",
"false",
";",
"$",
"da... | 获取永久素材列表(认证后的订阅号可用)
@param string $type 素材的类型,图片(image)、视频(video)、语音 (voice)、图文(news)
@param int $offset 全部素材的偏移位置,0表示从第一个素材
@param int $count 返回素材的数量,取值在1到20之间
@return boolean|array
返回数组格式:
array(
'total_count'=>0, //该类型的素材的总数
'item_count'=>0, //本次调用获取的素材的数量
'item'=>array() //素材列表数组,内容定义请参考官方文档
) | [
"获取永久素材列表",
"(",
"认证后的订阅号可用",
")"
] | train | https://github.com/sfnt/wechat-php-sdk/blob/d14b8511f96cfcf0da5f413b446e69943cc3ea90/src/Wechat.php#L1706-L1725 |
sfnt/wechat-php-sdk | src/Wechat.php | Wechat.getForeverCount | public function getForeverCount(){
if (!$this->access_token && !$this->checkAuth()) return false;
$result = $this->http_get(self::API_URL_PREFIX.self::MEDIA_FOREVER_COUNT_URL.'access_token='.$this->access_token);
if ($result)
{
$json = json_decode($result,true);
i... | php | public function getForeverCount(){
if (!$this->access_token && !$this->checkAuth()) return false;
$result = $this->http_get(self::API_URL_PREFIX.self::MEDIA_FOREVER_COUNT_URL.'access_token='.$this->access_token);
if ($result)
{
$json = json_decode($result,true);
i... | [
"public",
"function",
"getForeverCount",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"access_token",
"&&",
"!",
"$",
"this",
"->",
"checkAuth",
"(",
")",
")",
"return",
"false",
";",
"$",
"result",
"=",
"$",
"this",
"->",
"http_get",
"(",
"self... | 获取永久素材总数(认证后的订阅号可用)
@return boolean|array
返回数组格式:
array(
'voice_count'=>0, //语音总数量
'video_count'=>0, //视频总数量
'image_count'=>0, //图片总数量
'news_count'=>0 //图文总数量
) | [
"获取永久素材总数",
"(",
"认证后的订阅号可用",
")"
] | train | https://github.com/sfnt/wechat-php-sdk/blob/d14b8511f96cfcf0da5f413b446e69943cc3ea90/src/Wechat.php#L1738-L1752 |
sfnt/wechat-php-sdk | src/Wechat.php | Wechat.getQRCode | public function getQRCode($scene_id,$type=0,$expire=1800){
if (!$this->access_token && !$this->checkAuth()) return false;
$type = ($type && is_string($scene_id))?2:$type;
$data = array(
'action_name'=>$type?($type == 2?"QR_LIMIT_STR_SCENE":"QR_LIMIT_SCENE"):"QR_SCENE",
'expire_seconds'=>$expire,
'action_... | php | public function getQRCode($scene_id,$type=0,$expire=1800){
if (!$this->access_token && !$this->checkAuth()) return false;
$type = ($type && is_string($scene_id))?2:$type;
$data = array(
'action_name'=>$type?($type == 2?"QR_LIMIT_STR_SCENE":"QR_LIMIT_SCENE"):"QR_SCENE",
'expire_seconds'=>$expire,
'action_... | [
"public",
"function",
"getQRCode",
"(",
"$",
"scene_id",
",",
"$",
"type",
"=",
"0",
",",
"$",
"expire",
"=",
"1800",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"access_token",
"&&",
"!",
"$",
"this",
"->",
"checkAuth",
"(",
")",
")",
"return",
... | 创建二维码ticket
@param int|string $scene_id 自定义追踪id,临时二维码只能用数值型
@param int $type 0:临时二维码;1:永久二维码(此时expire参数无效);2:永久二维码(此时expire参数无效)
@param int $expire 临时二维码有效期,最大为1800秒
@return array('ticket'=>'qrcode字串','expire_seconds'=>1800,'url'=>'二维码图片解析后的地址') | [
"创建二维码ticket"
] | train | https://github.com/sfnt/wechat-php-sdk/blob/d14b8511f96cfcf0da5f413b446e69943cc3ea90/src/Wechat.php#L1955-L1978 |
sfnt/wechat-php-sdk | src/Wechat.php | Wechat.batchUpdateGroupMembers | public function batchUpdateGroupMembers($groupid,$openid_list){
if (!$this->access_token && !$this->checkAuth()) return false;
$data = array(
'openid_list'=>$openid_list,
'to_groupid'=>$groupid
);
$result = $this->http_post(self::API_URL_PREFIX.self::GROUP_MEMBER_BATCHUPDATE_URL.'access_token='.$this->a... | php | public function batchUpdateGroupMembers($groupid,$openid_list){
if (!$this->access_token && !$this->checkAuth()) return false;
$data = array(
'openid_list'=>$openid_list,
'to_groupid'=>$groupid
);
$result = $this->http_post(self::API_URL_PREFIX.self::GROUP_MEMBER_BATCHUPDATE_URL.'access_token='.$this->a... | [
"public",
"function",
"batchUpdateGroupMembers",
"(",
"$",
"groupid",
",",
"$",
"openid_list",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"access_token",
"&&",
"!",
"$",
"this",
"->",
"checkAuth",
"(",
")",
")",
"return",
"false",
";",
"$",
"data",
"... | 批量移动用户分组
@param int $groupid 分组id
@param string $openid_list 用户openid数组,一次不能超过50个
@return boolean|array | [
"批量移动用户分组"
] | train | https://github.com/sfnt/wechat-php-sdk/blob/d14b8511f96cfcf0da5f413b446e69943cc3ea90/src/Wechat.php#L2237-L2255 |
sfnt/wechat-php-sdk | src/Wechat.php | Wechat.getKFSession | public function getKFSession($openid){
if (!$this->access_token && !$this->checkAuth()) return false;
$result = $this->http_get(self::API_BASE_URL_PREFIX.self::CUSTOM_SESSION_GET .'access_token='.$this->access_token.'&openid='.$openid);
if ($result)
{
$json = json_decode($result,true);
... | php | public function getKFSession($openid){
if (!$this->access_token && !$this->checkAuth()) return false;
$result = $this->http_get(self::API_BASE_URL_PREFIX.self::CUSTOM_SESSION_GET .'access_token='.$this->access_token.'&openid='.$openid);
if ($result)
{
$json = json_decode($result,true);
... | [
"public",
"function",
"getKFSession",
"(",
"$",
"openid",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"access_token",
"&&",
"!",
"$",
"this",
"->",
"checkAuth",
"(",
")",
")",
"return",
"false",
";",
"$",
"result",
"=",
"$",
"this",
"->",
"http_get"... | 获取用户会话状态
@param string $openid //用户openid
@return boolean | array //成功返回json数组
{
"errcode" : 0,
"errmsg" : "ok",
"kf_account" : "test1@test", //正在接待的客服
"createtime": 123456789, //会话接入时间
} | [
"获取用户会话状态"
] | train | https://github.com/sfnt/wechat-php-sdk/blob/d14b8511f96cfcf0da5f413b446e69943cc3ea90/src/Wechat.php#L2632-L2646 |
sfnt/wechat-php-sdk | src/Wechat.php | Wechat.getKFSessionlist | public function getKFSessionlist($kf_account){
if (!$this->access_token && !$this->checkAuth()) return false;
$result = $this->http_get(self::API_BASE_URL_PREFIX.self::CUSTOM_SESSION_GET_LIST .'access_token='.$this->access_token.'&kf_account='.$kf_account);
if ($result)
{
$json = json_decod... | php | public function getKFSessionlist($kf_account){
if (!$this->access_token && !$this->checkAuth()) return false;
$result = $this->http_get(self::API_BASE_URL_PREFIX.self::CUSTOM_SESSION_GET_LIST .'access_token='.$this->access_token.'&kf_account='.$kf_account);
if ($result)
{
$json = json_decod... | [
"public",
"function",
"getKFSessionlist",
"(",
"$",
"kf_account",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"access_token",
"&&",
"!",
"$",
"this",
"->",
"checkAuth",
"(",
")",
")",
"return",
"false",
";",
"$",
"result",
"=",
"$",
"this",
"->",
"h... | 获取指定客服的会话列表
@param string $openid //用户openid
@return boolean | array //成功返回json数组
array(
'sessionlist' => array (
array (
'openid'=>'OPENID', //客户 openid
'createtime'=>123456789, //会话创建时间,UNIX 时间戳
),
array (
'openid'=>'OPENID', //客户 openid
'createtime'=>123456789, //会话创建时间... | [
"获取指定客服的会话列表"
] | train | https://github.com/sfnt/wechat-php-sdk/blob/d14b8511f96cfcf0da5f413b446e69943cc3ea90/src/Wechat.php#L2665-L2679 |
sfnt/wechat-php-sdk | src/Wechat.php | Wechat.getKFSessionWait | public function getKFSessionWait(){
if (!$this->access_token && !$this->checkAuth()) return false;
$result = $this->http_get(self::API_BASE_URL_PREFIX.self::CUSTOM_SESSION_GET_WAIT .'access_token='.$this->access_token);
if ($result)
{
$json = json_decode($result,true);
if (!$json |... | php | public function getKFSessionWait(){
if (!$this->access_token && !$this->checkAuth()) return false;
$result = $this->http_get(self::API_BASE_URL_PREFIX.self::CUSTOM_SESSION_GET_WAIT .'access_token='.$this->access_token);
if ($result)
{
$json = json_decode($result,true);
if (!$json |... | [
"public",
"function",
"getKFSessionWait",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"access_token",
"&&",
"!",
"$",
"this",
"->",
"checkAuth",
"(",
")",
")",
"return",
"false",
";",
"$",
"result",
"=",
"$",
"this",
"->",
"http_get",
"(",
"sel... | 获取未接入会话列表
@param string $openid //用户openid
@return boolean | array //成功返回json数组
array (
'count' => 150 , //未接入会话数量
'waitcaselist' => array (
array (
'openid'=>'OPENID', //客户 openid
'kf_account ' =>'', //指定接待的客服,为空则未指定
'createtime'=>123456789,... | [
"获取未接入会话列表"
] | train | https://github.com/sfnt/wechat-php-sdk/blob/d14b8511f96cfcf0da5f413b446e69943cc3ea90/src/Wechat.php#L2701-L2715 |
sfnt/wechat-php-sdk | src/Wechat.php | Wechat.searchShakeAroundDevice | public function searchShakeAroundDevice($data){
if (!$this->access_token && !$this->checkAuth()) return false;
$result = $this->http_post(self::API_BASE_URL_PREFIX . self::SHAKEAROUND_DEVICE_SEARCH . 'access_token=' . $this->access_token, self::json_encode($data));
$this->log($result);
i... | php | public function searchShakeAroundDevice($data){
if (!$this->access_token && !$this->checkAuth()) return false;
$result = $this->http_post(self::API_BASE_URL_PREFIX . self::SHAKEAROUND_DEVICE_SEARCH . 'access_token=' . $this->access_token, self::json_encode($data));
$this->log($result);
i... | [
"public",
"function",
"searchShakeAroundDevice",
"(",
"$",
"data",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"access_token",
"&&",
"!",
"$",
"this",
"->",
"checkAuth",
"(",
")",
")",
"return",
"false",
";",
"$",
"result",
"=",
"$",
"this",
"->",
"... | 查询设备列表
[searchShakeAroundDevice 查询已有的设备ID、UUID、Major、Minor、激活状态、备注信息、关联门店、关联页面等信息。
可指定设备ID 或完整的UUID、Major、Minor 查询,也可批量拉取设备信息列表。]
@param array $data
$data 三种格式:
①查询指定设备时:$data = array(
"device_identifiers" => array(
array(
"device_id" => 10100,
"uuid" => "FDA50693-A4E2-4FB1-AFCF-C6EB07647825",
"major" => 10001,
"minor"... | [
"查询设备列表",
"[",
"searchShakeAroundDevice",
"查询已有的设备ID、UUID、Major、Minor、激活状态、备注信息、关联门店、关联页面等信息。",
"可指定设备ID",
"或完整的UUID、Major、Minor",
"查询,也可批量拉取设备信息列表。",
"]"
] | train | https://github.com/sfnt/wechat-php-sdk/blob/d14b8511f96cfcf0da5f413b446e69943cc3ea90/src/Wechat.php#L3545-L3559 |
sfnt/wechat-php-sdk | src/Wechat.php | Wechat.bindLocationShakeAroundDevice | public function bindLocationShakeAroundDevice($device_id,$poi_id,$uuid='',$major=0,$minor=0){
if (!$this->access_token && !$this->checkAuth()) return false;
if(!$device_id){
if(!$uuid || !$major || !$minor){
return false;
}
$device_identifier = array(
... | php | public function bindLocationShakeAroundDevice($device_id,$poi_id,$uuid='',$major=0,$minor=0){
if (!$this->access_token && !$this->checkAuth()) return false;
if(!$device_id){
if(!$uuid || !$major || !$minor){
return false;
}
$device_identifier = array(
... | [
"public",
"function",
"bindLocationShakeAroundDevice",
"(",
"$",
"device_id",
",",
"$",
"poi_id",
",",
"$",
"uuid",
"=",
"''",
",",
"$",
"major",
"=",
"0",
",",
"$",
"minor",
"=",
"0",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"access_token",
"&&"... | [bindLocationShakeAroundDevice 配置设备与门店的关联关系]
@param string $device_id 设备编号,若填了UUID、major、minor,则可不填设备编号,若二者都填,则以设备编号为优先
@param int $poi_id 待关联的门店ID
@param string $uuid UUID、major、minor,三个信息需填写完整,若填了设备编号,则可不填此信息
@param int $major
@param int $minor
@return boolean|mixed
正确返回JSON 数据示例:
{
"data": {
},
"errcode": 0,
"errmsg... | [
"[",
"bindLocationShakeAroundDevice",
"配置设备与门店的关联关系",
"]"
] | train | https://github.com/sfnt/wechat-php-sdk/blob/d14b8511f96cfcf0da5f413b446e69943cc3ea90/src/Wechat.php#L3581-L3613 |
sfnt/wechat-php-sdk | src/Wechat.php | Wechat.bindPageShakeAroundDevice | public function bindPageShakeAroundDevice($device_id,$page_ids=array(),$bind=1,$append=1,$uuid='',$major=0,$minor=0){
if (!$this->access_token && !$this->checkAuth()) return false;
if(!$device_id){
if(!$uuid || !$major || !$minor){
return false;
}
$dev... | php | public function bindPageShakeAroundDevice($device_id,$page_ids=array(),$bind=1,$append=1,$uuid='',$major=0,$minor=0){
if (!$this->access_token && !$this->checkAuth()) return false;
if(!$device_id){
if(!$uuid || !$major || !$minor){
return false;
}
$dev... | [
"public",
"function",
"bindPageShakeAroundDevice",
"(",
"$",
"device_id",
",",
"$",
"page_ids",
"=",
"array",
"(",
")",
",",
"$",
"bind",
"=",
"1",
",",
"$",
"append",
"=",
"1",
",",
"$",
"uuid",
"=",
"''",
",",
"$",
"major",
"=",
"0",
",",
"$",
... | [bindPageShakeAroundDevice 配置设备与页面的关联关系。
支持建立或解除关联关系,也支持新增页面或覆盖页面等操作。
配置完成后,在此设备的信号范围内,即可摇出关联的页面信息。
若设备配置多个页面,则随机出现页面信息]
@param string $device_id 设备编号,若填了UUID、major、minor,则可不填设备编号,若二者都填,则以设备编号为优先
@param array $page_ids 待关联的页面列表
@param number $bind 关联操作标志位, 0 为解除关联关系,1 为建立关联关系
@param number $append 新增操作标志位, 0 为覆盖,1 为新增
... | [
"[",
"bindPageShakeAroundDevice",
"配置设备与页面的关联关系。",
"支持建立或解除关联关系,也支持新增页面或覆盖页面等操作。",
"配置完成后,在此设备的信号范围内,即可摇出关联的页面信息。",
"若设备配置多个页面,则随机出现页面信息",
"]"
] | train | https://github.com/sfnt/wechat-php-sdk/blob/d14b8511f96cfcf0da5f413b446e69943cc3ea90/src/Wechat.php#L3640-L3674 |
sfnt/wechat-php-sdk | src/Wechat.php | Wechat.addShakeAroundPage | public function addShakeAroundPage($title,$description,$icon_url,$page_url,$comment=''){
if (!$this->access_token && !$this->checkAuth()) return false;
$data = array(
"title" => $title,
"description" => $description,
"icon_url" => $icon_url,
"page_url" => ... | php | public function addShakeAroundPage($title,$description,$icon_url,$page_url,$comment=''){
if (!$this->access_token && !$this->checkAuth()) return false;
$data = array(
"title" => $title,
"description" => $description,
"icon_url" => $icon_url,
"page_url" => ... | [
"public",
"function",
"addShakeAroundPage",
"(",
"$",
"title",
",",
"$",
"description",
",",
"$",
"icon_url",
",",
"$",
"page_url",
",",
"$",
"comment",
"=",
"''",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"access_token",
"&&",
"!",
"$",
"this",
"... | [addShakeAroundPage 增加摇一摇出来的页面信息,包括在摇一摇页面出现的主标题、副标题、图片和点击进去的超链接。]
@param string $title 在摇一摇页面展示的主标题,不超过6 个字
@param string $description 在摇一摇页面展示的副标题,不超过7 个字
@param sting $icon_url 在摇一摇页面展示的图片, 格式限定为:jpg,jpeg,png,gif; 建议120*120 , 限制不超过200*200
@param string $page_url 跳转链接
@param string $comment 页面的备注信息,不超过15 个字,可不填
@retur... | [
"[",
"addShakeAroundPage",
"增加摇一摇出来的页面信息,包括在摇一摇页面出现的主标题、副标题、图片和点击进去的超链接。",
"]"
] | train | https://github.com/sfnt/wechat-php-sdk/blob/d14b8511f96cfcf0da5f413b446e69943cc3ea90/src/Wechat.php#L3729-L3750 |
sfnt/wechat-php-sdk | src/Wechat.php | Wechat.searchShakeAroundPage | public function searchShakeAroundPage($page_ids=array(),$begin=0,$count=1){
if (!$this->access_token && !$this->checkAuth()) return false;
if(!empty($page_ids)){
$data = array(
'page_ids' => $page_ids
);
}else{
$data = array(
'b... | php | public function searchShakeAroundPage($page_ids=array(),$begin=0,$count=1){
if (!$this->access_token && !$this->checkAuth()) return false;
if(!empty($page_ids)){
$data = array(
'page_ids' => $page_ids
);
}else{
$data = array(
'b... | [
"public",
"function",
"searchShakeAroundPage",
"(",
"$",
"page_ids",
"=",
"array",
"(",
")",
",",
"$",
"begin",
"=",
"0",
",",
"$",
"count",
"=",
"1",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"access_token",
"&&",
"!",
"$",
"this",
"->",
"check... | [searchShakeAroundPage 查询已有的页面,包括在摇一摇页面出现的主标题、副标题、图片和点击进去的超链接。
提供两种查询方式,①可指定页面ID 查询,②也可批量拉取页面列表。]
@param array $page_ids
@param int $begin
@param int $count
①需要查询指定页面时:
{
"page_ids":[12345, 23456, 34567]
}
+-------------------------------------------------------------------------------------------------------------
②需要... | [
"[",
"searchShakeAroundPage",
"查询已有的页面,包括在摇一摇页面出现的主标题、副标题、图片和点击进去的超链接。",
"提供两种查询方式,①可指定页面ID",
"查询,②也可批量拉取页面列表。",
"]"
] | train | https://github.com/sfnt/wechat-php-sdk/blob/d14b8511f96cfcf0da5f413b446e69943cc3ea90/src/Wechat.php#L3855-L3879 |
sfnt/wechat-php-sdk | src/Wechat.php | Wechat.deleteShakeAroundPage | public function deleteShakeAroundPage($page_ids=array()){
if (!$this->access_token && !$this->checkAuth()) return false;
$data = array(
'page_ids' => $page_ids
);
$result = $this->http_post(self::API_BASE_URL_PREFIX . self::SHAKEAROUND_PAGE_DELETE . 'access_token=' . $this->a... | php | public function deleteShakeAroundPage($page_ids=array()){
if (!$this->access_token && !$this->checkAuth()) return false;
$data = array(
'page_ids' => $page_ids
);
$result = $this->http_post(self::API_BASE_URL_PREFIX . self::SHAKEAROUND_PAGE_DELETE . 'access_token=' . $this->a... | [
"public",
"function",
"deleteShakeAroundPage",
"(",
"$",
"page_ids",
"=",
"array",
"(",
")",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"access_token",
"&&",
"!",
"$",
"this",
"->",
"checkAuth",
"(",
")",
")",
"return",
"false",
";",
"$",
"data",
"... | [deleteShakeAroundPage 删除已有的页面,包括在摇一摇页面出现的主标题、副标题、图片和点击进去的超链接。
只有页面与设备没有关联关系时,才可被删除。]
@param array $page_ids
{
"page_ids":[12345,23456,34567]
}
@return boolean|mixed
正确返回JSON 数据示例:
{
"data": {
},
"errcode": 0,
"errmsg": "success."
}
@access public
@author polo<gao.bo168@gmail.com>
@version 2015-3-25 下午3:23:00
@copyrigh... | [
"[",
"deleteShakeAroundPage",
"删除已有的页面,包括在摇一摇页面出现的主标题、副标题、图片和点击进去的超链接。",
"只有页面与设备没有关联关系时,才可被删除。",
"]"
] | train | https://github.com/sfnt/wechat-php-sdk/blob/d14b8511f96cfcf0da5f413b446e69943cc3ea90/src/Wechat.php#L3901-L3918 |
sfnt/wechat-php-sdk | src/Wechat.php | Wechat.getShakeInfoShakeAroundUser | public function getShakeInfoShakeAroundUser($ticket){
if (!$this->access_token && !$this->checkAuth()) return false;
$data = array('ticket' => $ticket);
$result = $this->http_post(self::API_BASE_URL_PREFIX . self::SHAKEAROUND_USER_GETSHAKEINFO . 'access_token=' . $this->access_token, self::json_... | php | public function getShakeInfoShakeAroundUser($ticket){
if (!$this->access_token && !$this->checkAuth()) return false;
$data = array('ticket' => $ticket);
$result = $this->http_post(self::API_BASE_URL_PREFIX . self::SHAKEAROUND_USER_GETSHAKEINFO . 'access_token=' . $this->access_token, self::json_... | [
"public",
"function",
"getShakeInfoShakeAroundUser",
"(",
"$",
"ticket",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"access_token",
"&&",
"!",
"$",
"this",
"->",
"checkAuth",
"(",
")",
")",
"return",
"false",
";",
"$",
"data",
"=",
"array",
"(",
"'ti... | [getShakeInfoShakeAroundUser 获取设备信息,包括UUID、major、minor,以及距离、openID 等信息。]
@param string $ticket 摇周边业务的ticket,可在摇到的URL 中得到,ticket生效时间为30 分钟
@return boolean|mixed
正确返回JSON 数据示例:
{
"data": {
"page_id ": 14211,
"beacon_info": {
"distance": 55.00620700469034,
"major": 10001,
"minor": 19007,
"uuid": "FDA50693-A4E2-4FB1-AFCF-C... | [
"[",
"getShakeInfoShakeAroundUser",
"获取设备信息,包括UUID、major、minor,以及距离、openID",
"等信息。",
"]"
] | train | https://github.com/sfnt/wechat-php-sdk/blob/d14b8511f96cfcf0da5f413b446e69943cc3ea90/src/Wechat.php#L3951-L3966 |
sfnt/wechat-php-sdk | src/Wechat.php | Wechat.deviceShakeAroundStatistics | public function deviceShakeAroundStatistics($device_id,$begin_date,$end_date,$uuid='',$major=0,$minor=0){
if (!$this->access_token && !$this->checkAuth()) return false;
if(!$device_id){
if(!$uuid || !$major || !$minor){
return false;
}
$device_identifi... | php | public function deviceShakeAroundStatistics($device_id,$begin_date,$end_date,$uuid='',$major=0,$minor=0){
if (!$this->access_token && !$this->checkAuth()) return false;
if(!$device_id){
if(!$uuid || !$major || !$minor){
return false;
}
$device_identifi... | [
"public",
"function",
"deviceShakeAroundStatistics",
"(",
"$",
"device_id",
",",
"$",
"begin_date",
",",
"$",
"end_date",
",",
"$",
"uuid",
"=",
"''",
",",
"$",
"major",
"=",
"0",
",",
"$",
"minor",
"=",
"0",
")",
"{",
"if",
"(",
"!",
"$",
"this",
... | [deviceShakeAroundStatistics 以设备为维度的数据统计接口。
查询单个设备进行摇周边操作的人数、次数,点击摇周边消息的人数、次数;查询的最长时间跨度为30天。]
@param int $device_id 设备编号,若填了UUID、major、minor,即可不填设备编号,二者选其一
@param int $begin_date 起始日期时间戳,最长时间跨度为30 天
@param int $end_date 结束日期时间戳,最长时间跨度为30 天
@param string $uuid UUID、major、minor,三个信息需填写完成,若填了设备编辑,即可不填此信息,二者选其一
@param int ... | [
"[",
"deviceShakeAroundStatistics",
"以设备为维度的数据统计接口。",
"查询单个设备进行摇周边操作的人数、次数,点击摇周边消息的人数、次数;查询的最长时间跨度为30天。",
"]"
] | train | https://github.com/sfnt/wechat-php-sdk/blob/d14b8511f96cfcf0da5f413b446e69943cc3ea90/src/Wechat.php#L4010-L4043 |
sfnt/wechat-php-sdk | src/Wechat.php | Wechat.pageShakeAroundStatistics | public function pageShakeAroundStatistics($page_id,$begin_date,$end_date){
if (!$this->access_token && !$this->checkAuth()) return false;
$data = array(
'page_id' => $page_id,
'begin_date' => $begin_date,
'end_date' => $end_date
);
$result = $this->htt... | php | public function pageShakeAroundStatistics($page_id,$begin_date,$end_date){
if (!$this->access_token && !$this->checkAuth()) return false;
$data = array(
'page_id' => $page_id,
'begin_date' => $begin_date,
'end_date' => $end_date
);
$result = $this->htt... | [
"public",
"function",
"pageShakeAroundStatistics",
"(",
"$",
"page_id",
",",
"$",
"begin_date",
",",
"$",
"end_date",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"access_token",
"&&",
"!",
"$",
"this",
"->",
"checkAuth",
"(",
")",
")",
"return",
"false"... | [pageShakeAroundStatistics 以页面为维度的数据统计接口。
查询单个页面通过摇周边摇出来的人数、次数,点击摇周边页面的人数、次数;查询的最长时间跨度为30天。]
@param int $page_id 指定页面的ID
@param int $begin_date 起始日期时间戳,最长时间跨度为30 天
@param int $end_date 结束日期时间戳,最长时间跨度为30 天
@return boolean|mixed
正确返回JSON 数据示例:
{
"data": [
{
"click_pv": 0,
"click_uv": 0,
"ftime": 1425052800,
"shake_pv": 0... | [
"[",
"pageShakeAroundStatistics",
"以页面为维度的数据统计接口。",
"查询单个页面通过摇周边摇出来的人数、次数,点击摇周边页面的人数、次数;查询的最长时间跨度为30天。",
"]"
] | train | https://github.com/sfnt/wechat-php-sdk/blob/d14b8511f96cfcf0da5f413b446e69943cc3ea90/src/Wechat.php#L4083-L4102 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.