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 |
|---|---|---|---|---|---|---|---|---|---|---|
titon/db | src/Titon/Db/Behavior/HierarchyBehavior.php | HierarchyBehavior.preDelete | public function preDelete(Event $event, Query $query, $id) {
if (!$this->getConfig('onDelete')) {
return true;
}
if ($node = $this->getNode($id)) {
$count = $this->getRepository()->select()
->where($this->getConfig('parentField'), $id)
->c... | php | public function preDelete(Event $event, Query $query, $id) {
if (!$this->getConfig('onDelete')) {
return true;
}
if ($node = $this->getNode($id)) {
$count = $this->getRepository()->select()
->where($this->getConfig('parentField'), $id)
->c... | [
"public",
"function",
"preDelete",
"(",
"Event",
"$",
"event",
",",
"Query",
"$",
"query",
",",
"$",
"id",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"getConfig",
"(",
"'onDelete'",
")",
")",
"{",
"return",
"true",
";",
"}",
"if",
"(",
"$",
"no... | Before a delete, fetch the node and save its left index.
If a node has children, the delete will fail.
@param \Titon\Event\Event $event
@param \Titon\Db\Query $query
@param int|int[] $id
@return bool | [
"Before",
"a",
"delete",
"fetch",
"the",
"node",
"and",
"save",
"its",
"left",
"index",
".",
"If",
"a",
"node",
"has",
"children",
"the",
"delete",
"will",
"fail",
"."
] | train | https://github.com/titon/db/blob/fbc5159d1ce9d2139759c9367565986981485604/src/Titon/Db/Behavior/HierarchyBehavior.php#L444-L462 |
titon/db | src/Titon/Db/Behavior/HierarchyBehavior.php | HierarchyBehavior.postDelete | public function postDelete(Event $event, $id, $count) {
if (!$this->getConfig('onDelete') || !$this->_deleteIndex) {
return;
}
$this->_removeNode($id, $this->_deleteIndex);
$this->_deleteIndex = null;
} | php | public function postDelete(Event $event, $id, $count) {
if (!$this->getConfig('onDelete') || !$this->_deleteIndex) {
return;
}
$this->_removeNode($id, $this->_deleteIndex);
$this->_deleteIndex = null;
} | [
"public",
"function",
"postDelete",
"(",
"Event",
"$",
"event",
",",
"$",
"id",
",",
"$",
"count",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"getConfig",
"(",
"'onDelete'",
")",
"||",
"!",
"$",
"this",
"->",
"_deleteIndex",
")",
"{",
"return",
"... | After a delete, shift all nodes up using the base index.
@param \Titon\Event\Event $event
@param int|int[] $id
@param int $count | [
"After",
"a",
"delete",
"shift",
"all",
"nodes",
"up",
"using",
"the",
"base",
"index",
"."
] | train | https://github.com/titon/db/blob/fbc5159d1ce9d2139759c9367565986981485604/src/Titon/Db/Behavior/HierarchyBehavior.php#L471-L478 |
titon/db | src/Titon/Db/Behavior/HierarchyBehavior.php | HierarchyBehavior.preSave | public function preSave(Event $event, Query $query, $id, array &$data) {
if (!$this->getConfig('onSave')) {
return true;
}
$parent = $this->getConfig('parentField');
$left = $this->getConfig('leftField');
$right = $this->getConfig('rightField');
// Append le... | php | public function preSave(Event $event, Query $query, $id, array &$data) {
if (!$this->getConfig('onSave')) {
return true;
}
$parent = $this->getConfig('parentField');
$left = $this->getConfig('leftField');
$right = $this->getConfig('rightField');
// Append le... | [
"public",
"function",
"preSave",
"(",
"Event",
"$",
"event",
",",
"Query",
"$",
"query",
",",
"$",
"id",
",",
"array",
"&",
"$",
"data",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"getConfig",
"(",
"'onSave'",
")",
")",
"{",
"return",
"true",
"... | Before an insert, determine the correct left and right using the parent or root node as a base.
Do not shift the nodes until postSave() just in case the insert fails.
Before an update, remove the left and right fields so that the tree cannot be modified.
Use moveUp(), moveDown(), moveTo() or reOrder() to update existi... | [
"Before",
"an",
"insert",
"determine",
"the",
"correct",
"left",
"and",
"right",
"using",
"the",
"parent",
"or",
"root",
"node",
"as",
"a",
"base",
".",
"Do",
"not",
"shift",
"the",
"nodes",
"until",
"postSave",
"()",
"just",
"in",
"case",
"the",
"insert... | train | https://github.com/titon/db/blob/fbc5159d1ce9d2139759c9367565986981485604/src/Titon/Db/Behavior/HierarchyBehavior.php#L493-L536 |
titon/db | src/Titon/Db/Behavior/HierarchyBehavior.php | HierarchyBehavior.postSave | public function postSave(Event $event, $id, $count) {
if (!$this->getConfig('onSave') || !$this->_saveIndex) {
return;
}
$this->_insertNode($id, $this->_saveIndex);
$this->_saveIndex = null;
} | php | public function postSave(Event $event, $id, $count) {
if (!$this->getConfig('onSave') || !$this->_saveIndex) {
return;
}
$this->_insertNode($id, $this->_saveIndex);
$this->_saveIndex = null;
} | [
"public",
"function",
"postSave",
"(",
"Event",
"$",
"event",
",",
"$",
"id",
",",
"$",
"count",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"getConfig",
"(",
"'onSave'",
")",
"||",
"!",
"$",
"this",
"->",
"_saveIndex",
")",
"{",
"return",
";",
... | After an insert, shift all nodes down using the base index.
@param \Titon\Event\Event $event
@param int|int[] $id
@Param int $count | [
"After",
"an",
"insert",
"shift",
"all",
"nodes",
"down",
"using",
"the",
"base",
"index",
"."
] | train | https://github.com/titon/db/blob/fbc5159d1ce9d2139759c9367565986981485604/src/Titon/Db/Behavior/HierarchyBehavior.php#L545-L552 |
titon/db | src/Titon/Db/Behavior/HierarchyBehavior.php | HierarchyBehavior._moveNode | protected function _moveNode(Closure $callback, array $data) {
return $this->getRepository()->updateMany($data, $callback, [
'before' => false,
'after' => false
]);
} | php | protected function _moveNode(Closure $callback, array $data) {
return $this->getRepository()->updateMany($data, $callback, [
'before' => false,
'after' => false
]);
} | [
"protected",
"function",
"_moveNode",
"(",
"Closure",
"$",
"callback",
",",
"array",
"$",
"data",
")",
"{",
"return",
"$",
"this",
"->",
"getRepository",
"(",
")",
"->",
"updateMany",
"(",
"$",
"data",
",",
"$",
"callback",
",",
"[",
"'before'",
"=>",
... | Move a node, or nodes, by applying a where clause to an update query and saving data.
Disable before and after callbacks to recursive events don't trigger.
@param callable $callback
@param array $data
@return int | [
"Move",
"a",
"node",
"or",
"nodes",
"by",
"applying",
"a",
"where",
"clause",
"to",
"an",
"update",
"query",
"and",
"saving",
"data",
".",
"Disable",
"before",
"and",
"after",
"callbacks",
"to",
"recursive",
"events",
"don",
"t",
"trigger",
"."
] | train | https://github.com/titon/db/blob/fbc5159d1ce9d2139759c9367565986981485604/src/Titon/Db/Behavior/HierarchyBehavior.php#L608-L613 |
titon/db | src/Titon/Db/Behavior/HierarchyBehavior.php | HierarchyBehavior._removeNode | protected function _removeNode($id, $index) {
$pk = $this->getRepository()->getPrimaryKey();
foreach ([$this->getConfig('leftField'), $this->getConfig('rightField')] as $field) {
$this->_moveNode(function(Query $query) use ($field, $index, $id, $pk) {
$query->where($field, '... | php | protected function _removeNode($id, $index) {
$pk = $this->getRepository()->getPrimaryKey();
foreach ([$this->getConfig('leftField'), $this->getConfig('rightField')] as $field) {
$this->_moveNode(function(Query $query) use ($field, $index, $id, $pk) {
$query->where($field, '... | [
"protected",
"function",
"_removeNode",
"(",
"$",
"id",
",",
"$",
"index",
")",
"{",
"$",
"pk",
"=",
"$",
"this",
"->",
"getRepository",
"(",
")",
"->",
"getPrimaryKey",
"(",
")",
";",
"foreach",
"(",
"[",
"$",
"this",
"->",
"getConfig",
"(",
"'leftF... | Prepares a node for removal by moving all following nodes up.
@param int $id
@param int $index | [
"Prepares",
"a",
"node",
"for",
"removal",
"by",
"moving",
"all",
"following",
"nodes",
"up",
"."
] | train | https://github.com/titon/db/blob/fbc5159d1ce9d2139759c9367565986981485604/src/Titon/Db/Behavior/HierarchyBehavior.php#L621-L635 |
titon/db | src/Titon/Db/Behavior/HierarchyBehavior.php | HierarchyBehavior._reOrder | protected function _reOrder($parent_id, $left, array $order = []) {
$parent = $this->getConfig('parentField');
$repo = $this->getRepository();
$pk = $repo->getPrimaryKey();
$right = $left + 1;
// Get children and sort
$children = $repo->select()
->where($pare... | php | protected function _reOrder($parent_id, $left, array $order = []) {
$parent = $this->getConfig('parentField');
$repo = $this->getRepository();
$pk = $repo->getPrimaryKey();
$right = $left + 1;
// Get children and sort
$children = $repo->select()
->where($pare... | [
"protected",
"function",
"_reOrder",
"(",
"$",
"parent_id",
",",
"$",
"left",
",",
"array",
"$",
"order",
"=",
"[",
"]",
")",
"{",
"$",
"parent",
"=",
"$",
"this",
"->",
"getConfig",
"(",
"'parentField'",
")",
";",
"$",
"repo",
"=",
"$",
"this",
"-... | Re-order the tree by recursively looping through all parents and children,
ordering the results, and generating the correct left and right indexes.
@param int $parent_id
@param int $left
@param array $order
@return int | [
"Re",
"-",
"order",
"the",
"tree",
"by",
"recursively",
"looping",
"through",
"all",
"parents",
"and",
"children",
"ordering",
"the",
"results",
"and",
"generating",
"the",
"correct",
"left",
"and",
"right",
"indexes",
"."
] | train | https://github.com/titon/db/blob/fbc5159d1ce9d2139759c9367565986981485604/src/Titon/Db/Behavior/HierarchyBehavior.php#L646-L673 |
seeruo/framework | src/Service/BuildService.php | BuildService.init | public function init()
{
$config = store('config');
// 配置文件处理
$config['themes_dir'] = ROOT.DIRECTORY_SEPARATOR.'Themes/'.$config['themes'];
$config['plugin_dir'] = ROOT.DIRECTORY_SEPARATOR.'Plugins';
$config['logs_dir'] = ROOT.DIRECTORY_SEPARATOR.'Logs';
$config['pu... | php | public function init()
{
$config = store('config');
// 配置文件处理
$config['themes_dir'] = ROOT.DIRECTORY_SEPARATOR.'Themes/'.$config['themes'];
$config['plugin_dir'] = ROOT.DIRECTORY_SEPARATOR.'Plugins';
$config['logs_dir'] = ROOT.DIRECTORY_SEPARATOR.'Logs';
$config['pu... | [
"public",
"function",
"init",
"(",
")",
"{",
"$",
"config",
"=",
"store",
"(",
"'config'",
")",
";",
"// 配置文件处理",
"$",
"config",
"[",
"'themes_dir'",
"]",
"=",
"ROOT",
".",
"DIRECTORY_SEPARATOR",
".",
"'Themes/'",
".",
"$",
"config",
"[",
"'themes'",
"]"... | 初始化构建对象
@DateTime 2019-01-02
@return [type] [description] | [
"初始化构建对象"
] | train | https://github.com/seeruo/framework/blob/689c6e95bc95fe2ae037e056d8228820dd08d7e9/src/Service/BuildService.php#L84-L99 |
seeruo/framework | src/Service/BuildService.php | BuildService.run | public function run()
{
// @检查单页
$this->checkSinglePages();
// @解析文件设置
$this->resolveFiles();
// @静态文件构建
$this->createStatic();
// @生成查询json
$this->createSearchData();
// @生成文章信息
$this->createHome();
// @生成文章页面
$this->cr... | php | public function run()
{
// @检查单页
$this->checkSinglePages();
// @解析文件设置
$this->resolveFiles();
// @静态文件构建
$this->createStatic();
// @生成查询json
$this->createSearchData();
// @生成文章信息
$this->createHome();
// @生成文章页面
$this->cr... | [
"public",
"function",
"run",
"(",
")",
"{",
"// @检查单页",
"$",
"this",
"->",
"checkSinglePages",
"(",
")",
";",
"// @解析文件设置",
"$",
"this",
"->",
"resolveFiles",
"(",
")",
";",
"// @静态文件构建",
"$",
"this",
"->",
"createStatic",
"(",
")",
";",
"// @生成查询json",
... | 构建静态网站所需文件 | [
"构建静态网站所需文件"
] | train | https://github.com/seeruo/framework/blob/689c6e95bc95fe2ae037e056d8228820dd08d7e9/src/Service/BuildService.php#L104-L124 |
seeruo/framework | src/Service/BuildService.php | BuildService.createStatic | private function createStatic()
{
// 主题里面的静态文件
$files = $this->fileSys->getFiles($this->themes_dir . DIRECTORY_SEPARATOR . 'static');
// 文件拷贝
array_walk($files, function ($file)
{
$search_str = $this->themes_dir . DIRECTORY_SEPARATOR . 'static';
$repla... | php | private function createStatic()
{
// 主题里面的静态文件
$files = $this->fileSys->getFiles($this->themes_dir . DIRECTORY_SEPARATOR . 'static');
// 文件拷贝
array_walk($files, function ($file)
{
$search_str = $this->themes_dir . DIRECTORY_SEPARATOR . 'static';
$repla... | [
"private",
"function",
"createStatic",
"(",
")",
"{",
"// 主题里面的静态文件",
"$",
"files",
"=",
"$",
"this",
"->",
"fileSys",
"->",
"getFiles",
"(",
"$",
"this",
"->",
"themes_dir",
".",
"DIRECTORY_SEPARATOR",
".",
"'static'",
")",
";",
"// 文件拷贝",
"array_walk",
"("... | [createStatic 静态资源文件转移]
@Author danier cdking95@gmail.com
@DateTime 2018-08-12
@return [type] | [
"[",
"createStatic",
"静态资源文件转移",
"]"
] | train | https://github.com/seeruo/framework/blob/689c6e95bc95fe2ae037e056d8228820dd08d7e9/src/Service/BuildService.php#L132-L144 |
seeruo/framework | src/Service/BuildService.php | BuildService.createSinglePage | private function createSinglePage()
{
if (isset($this->config['single_pages'])) {
$themes = $this->config['single_pages'];
foreach ($themes as $key => $v) {
$theme_page = $this->source_dir.DIRECTORY_SEPARATOR . $v;
if ( file_exists($theme_page) ) {
... | php | private function createSinglePage()
{
if (isset($this->config['single_pages'])) {
$themes = $this->config['single_pages'];
foreach ($themes as $key => $v) {
$theme_page = $this->source_dir.DIRECTORY_SEPARATOR . $v;
if ( file_exists($theme_page) ) {
... | [
"private",
"function",
"createSinglePage",
"(",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"config",
"[",
"'single_pages'",
"]",
")",
")",
"{",
"$",
"themes",
"=",
"$",
"this",
"->",
"config",
"[",
"'single_pages'",
"]",
";",
"foreach",
"(",... | [createSinglePage 构建单页页面]
@Author danier cdking95@gmail.com
@DateTime 2018-09-19
@return [type] [description] | [
"[",
"createSinglePage",
"构建单页页面",
"]"
] | train | https://github.com/seeruo/framework/blob/689c6e95bc95fe2ae037e056d8228820dd08d7e9/src/Service/BuildService.php#L152-L165 |
seeruo/framework | src/Service/BuildService.php | BuildService.createSearchData | private function createSearchData()
{
$search_data = [];
$files = $this->files;
// 单页文件不解析
foreach ($files as $key => $file) {
if (in_array($file['page_uuid'], $this->single_pages)) {
unset($files[$key]);
continue;
}
... | php | private function createSearchData()
{
$search_data = [];
$files = $this->files;
// 单页文件不解析
foreach ($files as $key => $file) {
if (in_array($file['page_uuid'], $this->single_pages)) {
unset($files[$key]);
continue;
}
... | [
"private",
"function",
"createSearchData",
"(",
")",
"{",
"$",
"search_data",
"=",
"[",
"]",
";",
"$",
"files",
"=",
"$",
"this",
"->",
"files",
";",
"// 单页文件不解析",
"foreach",
"(",
"$",
"files",
"as",
"$",
"key",
"=>",
"$",
"file",
")",
"{",
"if",
"... | [createSinglePage 构建查询json]
@Author danier cdking95@gmail.com
@DateTime 2018-09-19
@return [type] [description] | [
"[",
"createSinglePage",
"构建查询json",
"]"
] | train | https://github.com/seeruo/framework/blob/689c6e95bc95fe2ae037e056d8228820dd08d7e9/src/Service/BuildService.php#L173-L198 |
seeruo/framework | src/Service/BuildService.php | BuildService.createHome | public function createHome()
{
// 检查是否设置了主页
$home_page = @$this->config['home_page'] ?: '';
if ( !empty($home_page) && file_exists($this->source_dir.DIRECTORY_SEPARATOR . $home_page) ) {
// 渲染html
$home_page = $this->source_dir.DIRECTORY_SEPARATOR . $home_page;
... | php | public function createHome()
{
// 检查是否设置了主页
$home_page = @$this->config['home_page'] ?: '';
if ( !empty($home_page) && file_exists($this->source_dir.DIRECTORY_SEPARATOR . $home_page) ) {
// 渲染html
$home_page = $this->source_dir.DIRECTORY_SEPARATOR . $home_page;
... | [
"public",
"function",
"createHome",
"(",
")",
"{",
"// 检查是否设置了主页",
"$",
"home_page",
"=",
"@",
"$",
"this",
"->",
"config",
"[",
"'home_page'",
"]",
"?",
":",
"''",
";",
"if",
"(",
"!",
"empty",
"(",
"$",
"home_page",
")",
"&&",
"file_exists",
"(",
"... | [createHome 构建主页静态文件]
@Author danier cdking95@gmail.com
@DateTime 2018-08-12
@return [type] | [
"[",
"createHome",
"构建主页静态文件",
"]"
] | train | https://github.com/seeruo/framework/blob/689c6e95bc95fe2ae037e056d8228820dd08d7e9/src/Service/BuildService.php#L206-L249 |
seeruo/framework | src/Service/BuildService.php | BuildService.renderHome | public function renderHome($rep=[], $pages, $curr_page)
{
// 如果分页太多,就创建一个分页导航
$pages_html = '';
if ($pages>1) {
$pages_html .= '<div class="pages">';
for ($i=1; $i <= $pages; $i++) {
if ($i === $curr_page) {
$pages_html .= '<span cl... | php | public function renderHome($rep=[], $pages, $curr_page)
{
// 如果分页太多,就创建一个分页导航
$pages_html = '';
if ($pages>1) {
$pages_html .= '<div class="pages">';
for ($i=1; $i <= $pages; $i++) {
if ($i === $curr_page) {
$pages_html .= '<span cl... | [
"public",
"function",
"renderHome",
"(",
"$",
"rep",
"=",
"[",
"]",
",",
"$",
"pages",
",",
"$",
"curr_page",
")",
"{",
"// 如果分页太多,就创建一个分页导航",
"$",
"pages_html",
"=",
"''",
";",
"if",
"(",
"$",
"pages",
">",
"1",
")",
"{",
"$",
"pages_html",
".=",
... | [renderHome 解析主页静态页面]
@Author danier cdking95@gmail.com
@DateTime 2018-09-19
@param array $rep [文件数组]
@param [type] $pages [总页码]
@param [type] $curr_page [当前页码]
@param [type] $path_key [路径关键字]
@return [type] [descript... | [
"[",
"renderHome",
"解析主页静态页面",
"]"
] | train | https://github.com/seeruo/framework/blob/689c6e95bc95fe2ae037e056d8228820dd08d7e9/src/Service/BuildService.php#L261-L304 |
seeruo/framework | src/Service/BuildService.php | BuildService.createArticles | private function createArticles()
{
// 解析文件索引
$site_title = $this->config['title'];
foreach ($this->files as $key => $file) {
// 单页文件不解析
if (in_array($file['page_uuid'], $this->single_pages)) {
continue;
}
$html = $this->renderA... | php | private function createArticles()
{
// 解析文件索引
$site_title = $this->config['title'];
foreach ($this->files as $key => $file) {
// 单页文件不解析
if (in_array($file['page_uuid'], $this->single_pages)) {
continue;
}
$html = $this->renderA... | [
"private",
"function",
"createArticles",
"(",
")",
"{",
"// 解析文件索引",
"$",
"site_title",
"=",
"$",
"this",
"->",
"config",
"[",
"'title'",
"]",
";",
"foreach",
"(",
"$",
"this",
"->",
"files",
"as",
"$",
"key",
"=>",
"$",
"file",
")",
"{",
"// 单页文件不解析",... | [createArticles 构建文章静态页面]
@Author danier cdking95@gmail.com
@DateTime 2018-08-12
@return [type] | [
"[",
"createArticles",
"构建文章静态页面",
"]"
] | train | https://github.com/seeruo/framework/blob/689c6e95bc95fe2ae037e056d8228820dd08d7e9/src/Service/BuildService.php#L312-L324 |
seeruo/framework | src/Service/BuildService.php | BuildService.renderArticle | public function renderArticle($file_path, $single_page=false)
{
$file_path = str_replace("\\","/", $file_path);
$page_uuid = md5($file_path);
$file = $this->files[$page_uuid];
$file_data = $this->fileSys->getContent($file['file_path']);
$file['content'] = $this->m... | php | public function renderArticle($file_path, $single_page=false)
{
$file_path = str_replace("\\","/", $file_path);
$page_uuid = md5($file_path);
$file = $this->files[$page_uuid];
$file_data = $this->fileSys->getContent($file['file_path']);
$file['content'] = $this->m... | [
"public",
"function",
"renderArticle",
"(",
"$",
"file_path",
",",
"$",
"single_page",
"=",
"false",
")",
"{",
"$",
"file_path",
"=",
"str_replace",
"(",
"\"\\\\\"",
",",
"\"/\"",
",",
"$",
"file_path",
")",
";",
"$",
"page_uuid",
"=",
"md5",
"(",
"$",
... | [renderArticle 解析文章静态页面]
@DateTime 2018-10-12
@param [type] $file_path [文件路径]
@param boolean $single_page [是否单页,用于通知全段]
@return [type] [description] | [
"[",
"renderArticle",
"解析文章静态页面",
"]"
] | train | https://github.com/seeruo/framework/blob/689c6e95bc95fe2ae037e056d8228820dd08d7e9/src/Service/BuildService.php#L333-L357 |
seeruo/framework | src/Service/BuildService.php | BuildService.createTimer | public function createTimer()
{
$archives = [];
$files = $this->files;
foreach ($files as $key => $file) {
// 单页文件不解析
if (in_array($file['page_uuid'], $this->single_pages)) {
unset($files[$key]);
continue;
}
// ... | php | public function createTimer()
{
$archives = [];
$files = $this->files;
foreach ($files as $key => $file) {
// 单页文件不解析
if (in_array($file['page_uuid'], $this->single_pages)) {
unset($files[$key]);
continue;
}
// ... | [
"public",
"function",
"createTimer",
"(",
")",
"{",
"$",
"archives",
"=",
"[",
"]",
";",
"$",
"files",
"=",
"$",
"this",
"->",
"files",
";",
"foreach",
"(",
"$",
"files",
"as",
"$",
"key",
"=>",
"$",
"file",
")",
"{",
"// 单页文件不解析",
"if",
"(",
"in... | [createTimer 创建时间归档页面]
@Author danier cdking95@gmail.com
@DateTime 2018-09-18
@return [type] [description] | [
"[",
"createTimer",
"创建时间归档页面",
"]"
] | train | https://github.com/seeruo/framework/blob/689c6e95bc95fe2ae037e056d8228820dd08d7e9/src/Service/BuildService.php#L366-L412 |
seeruo/framework | src/Service/BuildService.php | BuildService.renderTimer | public function renderTimer($rep=[], $pages, $curr_page, $path_key)
{
// 基础路径解析
$path_key_arr = array_filter(explode('-', $path_key), function($s){
return $s !== 'all';
});
$path = empty($path_key_arr)? '' : implode('/', $path_key_arr) . '/';
$path = '/archives/'.... | php | public function renderTimer($rep=[], $pages, $curr_page, $path_key)
{
// 基础路径解析
$path_key_arr = array_filter(explode('-', $path_key), function($s){
return $s !== 'all';
});
$path = empty($path_key_arr)? '' : implode('/', $path_key_arr) . '/';
$path = '/archives/'.... | [
"public",
"function",
"renderTimer",
"(",
"$",
"rep",
"=",
"[",
"]",
",",
"$",
"pages",
",",
"$",
"curr_page",
",",
"$",
"path_key",
")",
"{",
"// 基础路径解析",
"$",
"path_key_arr",
"=",
"array_filter",
"(",
"explode",
"(",
"'-'",
",",
"$",
"path_key",
")",... | [renderTimer 解析时间归档页面]
@Author danier cdking95@gmail.com
@DateTime 2018-09-19
@param array $rep [文件数组]
@param [type] $pages [总页码]
@param [type] $curr_page [当前页码]
@param [type] $path_key [路径关键字]
@return [type] [descrip... | [
"[",
"renderTimer",
"解析时间归档页面",
"]"
] | train | https://github.com/seeruo/framework/blob/689c6e95bc95fe2ae037e056d8228820dd08d7e9/src/Service/BuildService.php#L424-L459 |
seeruo/framework | src/Service/BuildService.php | BuildService.createCategory | private function createCategory($value='')
{
$files = $this->files;
// 构建文件分类
$archives = [];
foreach ($files as $key => $file) {
// 单页文件不解析
if (in_array($file['page_uuid'], $this->single_pages)) {
unset($files[$key]);
continue... | php | private function createCategory($value='')
{
$files = $this->files;
// 构建文件分类
$archives = [];
foreach ($files as $key => $file) {
// 单页文件不解析
if (in_array($file['page_uuid'], $this->single_pages)) {
unset($files[$key]);
continue... | [
"private",
"function",
"createCategory",
"(",
"$",
"value",
"=",
"''",
")",
"{",
"$",
"files",
"=",
"$",
"this",
"->",
"files",
";",
"// 构建文件分类",
"$",
"archives",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"files",
"as",
"$",
"key",
"=>",
"$",
"file"... | [createCategory 创建分类归档页面]
@DateTime 2018-10-08
@param string $value [description]
@return [type] [description] | [
"[",
"createCategory",
"创建分类归档页面",
"]"
] | train | https://github.com/seeruo/framework/blob/689c6e95bc95fe2ae037e056d8228820dd08d7e9/src/Service/BuildService.php#L468-L520 |
seeruo/framework | src/Service/BuildService.php | BuildService.renderCategory | public function renderCategory($rep=[], $pages, $curr_page, $path_key)
{
// 基础路径解析
$path_key_arr = array_filter(explode('__', $path_key), function($s){
return $s !== 'all';
});
$path_key_arr = array_values($path_key_arr);
$path = empty($path_key_arr)? '' : implode... | php | public function renderCategory($rep=[], $pages, $curr_page, $path_key)
{
// 基础路径解析
$path_key_arr = array_filter(explode('__', $path_key), function($s){
return $s !== 'all';
});
$path_key_arr = array_values($path_key_arr);
$path = empty($path_key_arr)? '' : implode... | [
"public",
"function",
"renderCategory",
"(",
"$",
"rep",
"=",
"[",
"]",
",",
"$",
"pages",
",",
"$",
"curr_page",
",",
"$",
"path_key",
")",
"{",
"// 基础路径解析",
"$",
"path_key_arr",
"=",
"array_filter",
"(",
"explode",
"(",
"'__'",
",",
"$",
"path_key",
... | [renderCategory 解析分类归档页面]
@Author danier cdking95@gmail.com
@DateTime 2018-09-19
@param array $rep [文件数组]
@param [type] $pages [总页码]
@param [type] $curr_page [当前页码]
@param [type] $path_key [路径关键字]
@return [type] [desc... | [
"[",
"renderCategory",
"解析分类归档页面",
"]"
] | train | https://github.com/seeruo/framework/blob/689c6e95bc95fe2ae037e056d8228820dd08d7e9/src/Service/BuildService.php#L532-L574 |
seeruo/framework | src/Service/BuildService.php | BuildService.resolveFiles | public function resolveFiles()
{
// 获取文件列表
$files = $this->fileSys->getFiles($this->source_dir);
// 对文件按时间重新排序
$this->resortByTime($files);
// 文章归集
// $lvl_index = []; // 解析文章索引
$new_files = []; // 新的文件数组
foreach ($files a... | php | public function resolveFiles()
{
// 获取文件列表
$files = $this->fileSys->getFiles($this->source_dir);
// 对文件按时间重新排序
$this->resortByTime($files);
// 文章归集
// $lvl_index = []; // 解析文章索引
$new_files = []; // 新的文件数组
foreach ($files a... | [
"public",
"function",
"resolveFiles",
"(",
")",
"{",
"// 获取文件列表",
"$",
"files",
"=",
"$",
"this",
"->",
"fileSys",
"->",
"getFiles",
"(",
"$",
"this",
"->",
"source_dir",
")",
";",
"// 对文件按时间重新排序",
"$",
"this",
"->",
"resortByTime",
"(",
"$",
"files",
")... | [resolveFiles 解析文件]
@Author danier cdking95@gmail.com
@DateTime 2018-09-18
@return [type] [description] | [
"[",
"resolveFiles",
"解析文件",
"]"
] | train | https://github.com/seeruo/framework/blob/689c6e95bc95fe2ae037e056d8228820dd08d7e9/src/Service/BuildService.php#L582-L637 |
seeruo/framework | src/Service/BuildService.php | BuildService.resolveFileMenu | public function resolveFileMenu()
{
$file_index = [];
$files = $this->files;
foreach ($files as $key => $file) {
// 单页文件不做索引
if (in_array($file['page_uuid'], $this->single_pages)) {
continue;
}
// 标题索引处理
$content = $... | php | public function resolveFileMenu()
{
$file_index = [];
$files = $this->files;
foreach ($files as $key => $file) {
// 单页文件不做索引
if (in_array($file['page_uuid'], $this->single_pages)) {
continue;
}
// 标题索引处理
$content = $... | [
"public",
"function",
"resolveFileMenu",
"(",
")",
"{",
"$",
"file_index",
"=",
"[",
"]",
";",
"$",
"files",
"=",
"$",
"this",
"->",
"files",
";",
"foreach",
"(",
"$",
"files",
"as",
"$",
"key",
"=>",
"$",
"file",
")",
"{",
"// 单页文件不做索引",
"if",
"("... | [FunctionName 单文件子菜单索引]
@DateTime 2018-10-10
@param string $value [description] | [
"[",
"FunctionName",
"单文件子菜单索引",
"]"
] | train | https://github.com/seeruo/framework/blob/689c6e95bc95fe2ae037e056d8228820dd08d7e9/src/Service/BuildService.php#L644-L685 |
seeruo/framework | src/Service/BuildService.php | BuildService.resolveTypeIndex | private function resolveTypeIndex()
{
// 构建文件分类
$archives = [];
$files = $this->files;
foreach ($files as $key => $file) {
// 单页文件不做索引
if (in_array($file['page_uuid'], $this->single_pages)) {
continue;
}
// 文件类型处理
... | php | private function resolveTypeIndex()
{
// 构建文件分类
$archives = [];
$files = $this->files;
foreach ($files as $key => $file) {
// 单页文件不做索引
if (in_array($file['page_uuid'], $this->single_pages)) {
continue;
}
// 文件类型处理
... | [
"private",
"function",
"resolveTypeIndex",
"(",
")",
"{",
"// 构建文件分类",
"$",
"archives",
"=",
"[",
"]",
";",
"$",
"files",
"=",
"$",
"this",
"->",
"files",
";",
"foreach",
"(",
"$",
"files",
"as",
"$",
"key",
"=>",
"$",
"file",
")",
"{",
"// 单页文件不做索引"... | [resolveTypeIndex 根据类型多级分类]
@DateTime 2018-10-09
@param [type] $arr [description]
@return [type] [description] | [
"[",
"resolveTypeIndex",
"根据类型多级分类",
"]"
] | train | https://github.com/seeruo/framework/blob/689c6e95bc95fe2ae037e056d8228820dd08d7e9/src/Service/BuildService.php#L694-L736 |
seeruo/framework | src/Service/BuildService.php | BuildService.my_merge | private function my_merge($a, $b){
if (is_array($b)) {
foreach ($b as $k => $v) {
if (isset($a[$k])) {
$a[$k] = $this->my_merge($a[$k], $v);
}else{
$a[$k] = $v;
}
}
}
@asort($a);
... | php | private function my_merge($a, $b){
if (is_array($b)) {
foreach ($b as $k => $v) {
if (isset($a[$k])) {
$a[$k] = $this->my_merge($a[$k], $v);
}else{
$a[$k] = $v;
}
}
}
@asort($a);
... | [
"private",
"function",
"my_merge",
"(",
"$",
"a",
",",
"$",
"b",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"b",
")",
")",
"{",
"foreach",
"(",
"$",
"b",
"as",
"$",
"k",
"=>",
"$",
"v",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"a",
"[",
"$... | [my_merge 数组深处合并]
@DateTime 2018-10-10
@param [type] $a [description]
@param [type] $b [description]
@return [type] [description] | [
"[",
"my_merge",
"数组深处合并",
"]"
] | train | https://github.com/seeruo/framework/blob/689c6e95bc95fe2ae037e056d8228820dd08d7e9/src/Service/BuildService.php#L745-L757 |
seeruo/framework | src/Service/BuildService.php | BuildService.getArray | private function getArray($i, $length, $arr, $url){
$str=array();
if($i==$length-1){
$str[$arr[$i]] = [
'title' => $arr[$i],
'href' => $url.'/'.getpy($arr[$i]),
'uuid' => getpy($arr[$i])
];
}else{
$str[$arr[$i]... | php | private function getArray($i, $length, $arr, $url){
$str=array();
if($i==$length-1){
$str[$arr[$i]] = [
'title' => $arr[$i],
'href' => $url.'/'.getpy($arr[$i]),
'uuid' => getpy($arr[$i])
];
}else{
$str[$arr[$i]... | [
"private",
"function",
"getArray",
"(",
"$",
"i",
",",
"$",
"length",
",",
"$",
"arr",
",",
"$",
"url",
")",
"{",
"$",
"str",
"=",
"array",
"(",
")",
";",
"if",
"(",
"$",
"i",
"==",
"$",
"length",
"-",
"1",
")",
"{",
"$",
"str",
"[",
"$",
... | [getArray 字符串转数组]
@DateTime 2018-10-10
@param [type] $i [description]
@param [type] $length [description]
@param [type] $arr [description]
@param [type] $url [description]
@return [type] [description] | [
"[",
"getArray",
"字符串转数组",
"]"
] | train | https://github.com/seeruo/framework/blob/689c6e95bc95fe2ae037e056d8228820dd08d7e9/src/Service/BuildService.php#L768-L784 |
seeruo/framework | src/Service/BuildService.php | BuildService.resortByTime | private function resortByTime(&$files)
{
$length = count($files); // 文件数量
for($i=1; $i<$length; $i++) {
for($j=0; $j<$length - $i; $j++){
if ( (int)strtotime($files[$j]['date']) < (int)strtotime($files[$j+1]['date'])) {
$temp = $files[$j+1];
... | php | private function resortByTime(&$files)
{
$length = count($files); // 文件数量
for($i=1; $i<$length; $i++) {
for($j=0; $j<$length - $i; $j++){
if ( (int)strtotime($files[$j]['date']) < (int)strtotime($files[$j+1]['date'])) {
$temp = $files[$j+1];
... | [
"private",
"function",
"resortByTime",
"(",
"&",
"$",
"files",
")",
"{",
"$",
"length",
"=",
"count",
"(",
"$",
"files",
")",
";",
"// 文件数量",
"for",
"(",
"$",
"i",
"=",
"1",
";",
"$",
"i",
"<",
"$",
"length",
";",
"$",
"i",
"++",
")",
"{",
"f... | [resortByTime 对数组按照时间重新排序]
@DateTime 2018-10-09
@param [type] &$files [description]
@return [type] [description] | [
"[",
"resortByTime",
"对数组按照时间重新排序",
"]"
] | train | https://github.com/seeruo/framework/blob/689c6e95bc95fe2ae037e056d8228820dd08d7e9/src/Service/BuildService.php#L809-L821 |
seeruo/framework | src/Service/BuildService.php | BuildService.checkSinglePages | public function checkSinglePages()
{
$sg_pgs = @$this->config['single_pages'] ?: [];
$sg_pgs = array_values($sg_pgs);
// 检查需要剔除的页面
$home_page = @$this->config['home_page'] ?: '';
if (!empty($home_page)) {
array_push($sg_pgs, $home_page);
}
if (!emp... | php | public function checkSinglePages()
{
$sg_pgs = @$this->config['single_pages'] ?: [];
$sg_pgs = array_values($sg_pgs);
// 检查需要剔除的页面
$home_page = @$this->config['home_page'] ?: '';
if (!empty($home_page)) {
array_push($sg_pgs, $home_page);
}
if (!emp... | [
"public",
"function",
"checkSinglePages",
"(",
")",
"{",
"$",
"sg_pgs",
"=",
"@",
"$",
"this",
"->",
"config",
"[",
"'single_pages'",
"]",
"?",
":",
"[",
"]",
";",
"$",
"sg_pgs",
"=",
"array_values",
"(",
"$",
"sg_pgs",
")",
";",
"// 检查需要剔除的页面",
"$",
... | [checkSinglePages 监测单页]
@DateTime 2018-10-09
@return [type] [description] | [
"[",
"checkSinglePages",
"监测单页",
"]"
] | train | https://github.com/seeruo/framework/blob/689c6e95bc95fe2ae037e056d8228820dd08d7e9/src/Service/BuildService.php#L828-L844 |
seeruo/framework | src/Service/BuildService.php | BuildService.render | public function render($file, $data=[])
{
\Twig_Autoloader::register();
$loader = new \Twig_loader_Filesystem($this->themes_dir);
$twig = new \Twig_Environment(
$loader,
[
'cache' => false, //或者直接指定路径
'de... | php | public function render($file, $data=[])
{
\Twig_Autoloader::register();
$loader = new \Twig_loader_Filesystem($this->themes_dir);
$twig = new \Twig_Environment(
$loader,
[
'cache' => false, //或者直接指定路径
'de... | [
"public",
"function",
"render",
"(",
"$",
"file",
",",
"$",
"data",
"=",
"[",
"]",
")",
"{",
"\\",
"Twig_Autoloader",
"::",
"register",
"(",
")",
";",
"$",
"loader",
"=",
"new",
"\\",
"Twig_loader_Filesystem",
"(",
"$",
"this",
"->",
"themes_dir",
")",... | [render 模版解析]
@DateTime 2018-10-09
@param [type] $file [模版文件]
@param array $data [填充数据]
@return [type] [模版代码] | [
"[",
"render",
"模版解析",
"]"
] | train | https://github.com/seeruo/framework/blob/689c6e95bc95fe2ae037e056d8228820dd08d7e9/src/Service/BuildService.php#L853-L867 |
seeruo/framework | src/Service/BuildService.php | BuildService.getFilesHashKey | public function getFilesHashKey()
{
$file_locker = [];
// $config = $this->config['config_root'].'/config.php';
// $file_config = [];
// $file = @$this->fileSys->getContent($this->config['config_root'].'/config.php');
// $file_config[] = $file['setting'];
$files_sourc... | php | public function getFilesHashKey()
{
$file_locker = [];
// $config = $this->config['config_root'].'/config.php';
// $file_config = [];
// $file = @$this->fileSys->getContent($this->config['config_root'].'/config.php');
// $file_config[] = $file['setting'];
$files_sourc... | [
"public",
"function",
"getFilesHashKey",
"(",
")",
"{",
"$",
"file_locker",
"=",
"[",
"]",
";",
"// $config = $this->config['config_root'].'/config.php';",
"// $file_config = [];",
"// $file = @$this->fileSys->getContent($this->config['config_root'].'/config.php');",
"// $file_config[]... | [getFilesHashKey 获取文件hash-key]
@DateTime 2018-09-23
@return [type] [description] | [
"[",
"getFilesHashKey",
"获取文件hash",
"-",
"key",
"]"
] | train | https://github.com/seeruo/framework/blob/689c6e95bc95fe2ae037e056d8228820dd08d7e9/src/Service/BuildService.php#L875-L889 |
seeruo/framework | src/Service/BuildService.php | BuildService.listen | public function listen()
{
try {
Log::info('['.date('H:i:s').']文件监测程序运行中...');
while (true) {
sleep(1);
// 获取新key
$now_keys = $this->getFilesHashKey();
// 获取旧key
$old_keys = file_get_contents(ROOT.'/Confi... | php | public function listen()
{
try {
Log::info('['.date('H:i:s').']文件监测程序运行中...');
while (true) {
sleep(1);
// 获取新key
$now_keys = $this->getFilesHashKey();
// 获取旧key
$old_keys = file_get_contents(ROOT.'/Confi... | [
"public",
"function",
"listen",
"(",
")",
"{",
"try",
"{",
"Log",
"::",
"info",
"(",
"'['",
".",
"date",
"(",
"'H:i:s'",
")",
".",
"']文件监测程序运行中...');",
"",
"",
"while",
"(",
"true",
")",
"{",
"sleep",
"(",
"1",
")",
";",
"// 获取新key",
"$",
"now_keys... | [文件变动监听]
@Author danier cdking95@gmail.com
@DateTime 2018-08-25
@return [type] | [
"[",
"文件变动监听",
"]"
] | train | https://github.com/seeruo/framework/blob/689c6e95bc95fe2ae037e056d8228820dd08d7e9/src/Service/BuildService.php#L897-L927 |
webforge-labs/psc-cms | lib/Psc/Doctrine/NavigationNodeRepository.php | NavigationNodeRepository.findAllNodes | public function findAllNodes($context = NULL) {
$qb = $this->createQueryBuilder('node');
$qb->addSelect('page');
$qb->leftJoin('node.page', 'page');
$qb->andWhere($qb->expr()->eq('node.context', ':context'));
$query = $qb->getQuery();
$query->setParameter('context', $context ?: $this->conte... | php | public function findAllNodes($context = NULL) {
$qb = $this->createQueryBuilder('node');
$qb->addSelect('page');
$qb->leftJoin('node.page', 'page');
$qb->andWhere($qb->expr()->eq('node.context', ':context'));
$query = $qb->getQuery();
$query->setParameter('context', $context ?: $this->conte... | [
"public",
"function",
"findAllNodes",
"(",
"$",
"context",
"=",
"NULL",
")",
"{",
"$",
"qb",
"=",
"$",
"this",
"->",
"createQueryBuilder",
"(",
"'node'",
")",
";",
"$",
"qb",
"->",
"addSelect",
"(",
"'page'",
")",
";",
"$",
"qb",
"->",
"leftJoin",
"(... | Returns all Nodes (not filtered in any way except $context)
@return array | [
"Returns",
"all",
"Nodes",
"(",
"not",
"filtered",
"in",
"any",
"way",
"except",
"$context",
")"
] | train | https://github.com/webforge-labs/psc-cms/blob/467bfa2547e6b4fa487d2d7f35fa6cc618dbc763/lib/Psc/Doctrine/NavigationNodeRepository.php#L103-L113 |
webforge-labs/psc-cms | lib/Psc/Doctrine/NavigationNodeRepository.php | NavigationNodeRepository.exportParentPointer | public function exportParentPointer($locale, \Closure $qbHook = NULL) {
$qb = $this->childrenQueryBuilder(NULL, $qbHook ?: $this->getDefaultQueryBuilderHook());
$query = $qb->getQuery();
$nodes = $query->getResult();
$exported = array();
foreach ($nodes as $node) {
$exported[] = array(
... | php | public function exportParentPointer($locale, \Closure $qbHook = NULL) {
$qb = $this->childrenQueryBuilder(NULL, $qbHook ?: $this->getDefaultQueryBuilderHook());
$query = $qb->getQuery();
$nodes = $query->getResult();
$exported = array();
foreach ($nodes as $node) {
$exported[] = array(
... | [
"public",
"function",
"exportParentPointer",
"(",
"$",
"locale",
",",
"\\",
"Closure",
"$",
"qbHook",
"=",
"NULL",
")",
"{",
"$",
"qb",
"=",
"$",
"this",
"->",
"childrenQueryBuilder",
"(",
"NULL",
",",
"$",
"qbHook",
"?",
":",
"$",
"this",
"->",
"getDe... | Returns a parentPointer array, linked with just one title of $locale
useful for creating nested set examples
@return array[] | [
"Returns",
"a",
"parentPointer",
"array",
"linked",
"with",
"just",
"one",
"title",
"of",
"$locale"
] | train | https://github.com/webforge-labs/psc-cms/blob/467bfa2547e6b4fa487d2d7f35fa6cc618dbc763/lib/Psc/Doctrine/NavigationNodeRepository.php#L181-L196 |
webforge-labs/psc-cms | lib/Psc/Doctrine/NavigationNodeRepository.php | NavigationNodeRepository.getPath | public function getPath($node) {
// ACTIVE ?
$qb = $this->createQueryBuilder('node');
$qb
->where($qb->expr()->lte('node.lft', $node->getLft()))
->andWhere($qb->expr()->gte('node.rgt', $node->getRgt()))
->andWhere('node.context = :context')
->orderBy('node.lft', 'ASC')
... | php | public function getPath($node) {
// ACTIVE ?
$qb = $this->createQueryBuilder('node');
$qb
->where($qb->expr()->lte('node.lft', $node->getLft()))
->andWhere($qb->expr()->gte('node.rgt', $node->getRgt()))
->andWhere('node.context = :context')
->orderBy('node.lft', 'ASC')
... | [
"public",
"function",
"getPath",
"(",
"$",
"node",
")",
"{",
"// ACTIVE ?",
"$",
"qb",
"=",
"$",
"this",
"->",
"createQueryBuilder",
"(",
"'node'",
")",
";",
"$",
"qb",
"->",
"where",
"(",
"$",
"qb",
"->",
"expr",
"(",
")",
"->",
"lte",
"(",
"'node... | Get the path of a node
the path first element is the root node
the last node is $node itself
@param object $node
@return array() | [
"Get",
"the",
"path",
"of",
"a",
"node"
] | train | https://github.com/webforge-labs/psc-cms/blob/467bfa2547e6b4fa487d2d7f35fa6cc618dbc763/lib/Psc/Doctrine/NavigationNodeRepository.php#L310-L333 |
slashworks/control-bundle | src/Slashworks/AppBundle/Services/Api.php | Api.call | public static function call($method, $params, $url, $publickey, $oRemoteApp = null)
{
$response = "";
try {
$sOldErrorhandler = set_error_handler('Slashworks\AppBundle\Services\Api::errorHandler');
if(!self::$_container){
throw new \I... | php | public static function call($method, $params, $url, $publickey, $oRemoteApp = null)
{
$response = "";
try {
$sOldErrorhandler = set_error_handler('Slashworks\AppBundle\Services\Api::errorHandler');
if(!self::$_container){
throw new \I... | [
"public",
"static",
"function",
"call",
"(",
"$",
"method",
",",
"$",
"params",
",",
"$",
"url",
",",
"$",
"publickey",
",",
"$",
"oRemoteApp",
"=",
"null",
")",
"{",
"$",
"response",
"=",
"\"\"",
";",
"try",
"{",
"$",
"sOldErrorhandler",
"=",
"set_e... | @param $method
@param $params
@param $url
@param $publickey
@param null $oRemoteApp
@return array|mixed
@throws \Exception | [
"@param",
"$method",
"@param",
"$params",
"@param",
"$url",
"@param",
"$publickey",
"@param",
"null",
"$oRemoteApp"
] | train | https://github.com/slashworks/control-bundle/blob/2ba86d96f1f41f9424e2229c4e2b13017e973f89/src/Slashworks/AppBundle/Services/Api.php#L66-L223 |
phpmob/changmin | src/PhpMob/ChangMinBundle/Doctrine/ORM/TaxonRepository.php | TaxonRepository.findNodesTreeSorted | public function findNodesTreeSorted($rootCode = null)
{
$queryBuilder = $this->createQueryBuilder('o')
->addOrderBy('o.root')
->addOrderBy('o.left')
;
/** @var TaxonInterface $root */
if (null !== $rootCode && $root = $this->findOneBy(['code' => $rootCode])) ... | php | public function findNodesTreeSorted($rootCode = null)
{
$queryBuilder = $this->createQueryBuilder('o')
->addOrderBy('o.root')
->addOrderBy('o.left')
;
/** @var TaxonInterface $root */
if (null !== $rootCode && $root = $this->findOneBy(['code' => $rootCode])) ... | [
"public",
"function",
"findNodesTreeSorted",
"(",
"$",
"rootCode",
"=",
"null",
")",
"{",
"$",
"queryBuilder",
"=",
"$",
"this",
"->",
"createQueryBuilder",
"(",
"'o'",
")",
"->",
"addOrderBy",
"(",
"'o.root'",
")",
"->",
"addOrderBy",
"(",
"'o.left'",
")",
... | {@inheritdoc} | [
"{"
] | train | https://github.com/phpmob/changmin/blob/bfebb1561229094d1c138574abab75f2f1d17d66/src/PhpMob/ChangMinBundle/Doctrine/ORM/TaxonRepository.php#L63-L85 |
phpmob/changmin | src/PhpMob/ChangMinBundle/Doctrine/ORM/TaxonRepository.php | TaxonRepository.createFilterQueryBuilder | public function createFilterQueryBuilder(string $locale, ?string $parentCode): QueryBuilder
{
$queryBuilder = $this->createQueryBuilder('o')
->addSelect('translation')
->innerJoin('o.translations', 'translation', 'WITH', 'translation.locale = :locale')
->setParameter('loc... | php | public function createFilterQueryBuilder(string $locale, ?string $parentCode): QueryBuilder
{
$queryBuilder = $this->createQueryBuilder('o')
->addSelect('translation')
->innerJoin('o.translations', 'translation', 'WITH', 'translation.locale = :locale')
->setParameter('loc... | [
"public",
"function",
"createFilterQueryBuilder",
"(",
"string",
"$",
"locale",
",",
"?",
"string",
"$",
"parentCode",
")",
":",
"QueryBuilder",
"{",
"$",
"queryBuilder",
"=",
"$",
"this",
"->",
"createQueryBuilder",
"(",
"'o'",
")",
"->",
"addSelect",
"(",
... | {@inheritdoc} | [
"{"
] | train | https://github.com/phpmob/changmin/blob/bfebb1561229094d1c138574abab75f2f1d17d66/src/PhpMob/ChangMinBundle/Doctrine/ORM/TaxonRepository.php#L90-L117 |
phore/phore-micro-app | src/Auth/AuthManager.php | AuthManager.doAuth | public function doAuth (string $userId, string $passwd)
{
if(($user = $this->userProvider->validateUser($userId, $passwd, $this->roleMap)) !== null) {
$this->authUser = $user;
if ($this->authMech instanceof SessionBasedAuthMech)
$this->authMech->setSessionUserId($use... | php | public function doAuth (string $userId, string $passwd)
{
if(($user = $this->userProvider->validateUser($userId, $passwd, $this->roleMap)) !== null) {
$this->authUser = $user;
if ($this->authMech instanceof SessionBasedAuthMech)
$this->authMech->setSessionUserId($use... | [
"public",
"function",
"doAuth",
"(",
"string",
"$",
"userId",
",",
"string",
"$",
"passwd",
")",
"{",
"if",
"(",
"(",
"$",
"user",
"=",
"$",
"this",
"->",
"userProvider",
"->",
"validateUser",
"(",
"$",
"userId",
",",
"$",
"passwd",
",",
"$",
"this",... | @param string $userId
@param string $passwd
@return bool
@throws InvalidUserException | [
"@param",
"string",
"$userId",
"@param",
"string",
"$passwd"
] | train | https://github.com/phore/phore-micro-app/blob/6cf87a647b8b0be05afbfe6bd020650e98558c23/src/Auth/AuthManager.php#L95-L106 |
xinix-technology/norm | src/Norm/Cursor/MongoCursor.php | MongoCursor.getNext | public function getNext()
{
$next = $this->getCursor()->getNext();
return isset($next) ? $this->collection->attach($next) : null;
} | php | public function getNext()
{
$next = $this->getCursor()->getNext();
return isset($next) ? $this->collection->attach($next) : null;
} | [
"public",
"function",
"getNext",
"(",
")",
"{",
"$",
"next",
"=",
"$",
"this",
"->",
"getCursor",
"(",
")",
"->",
"getNext",
"(",
")",
";",
"return",
"isset",
"(",
"$",
"next",
")",
"?",
"$",
"this",
"->",
"collection",
"->",
"attach",
"(",
"$",
... | {@inheritDoc} | [
"{"
] | train | https://github.com/xinix-technology/norm/blob/c357f7d3a75d05324dd84b8f6a968a094c53d603/src/Norm/Cursor/MongoCursor.php#L27-L32 |
xinix-technology/norm | src/Norm/Cursor/MongoCursor.php | MongoCursor.translateCriteria | public function translateCriteria(array $criteria = array())
{
if (empty($criteria)) {
return $criteria;
}
$newCriteria = array();
foreach ($criteria as $key => $value) {
list($newKey, $newValue) = $this->grammarExpression($key, $value);
if (is_... | php | public function translateCriteria(array $criteria = array())
{
if (empty($criteria)) {
return $criteria;
}
$newCriteria = array();
foreach ($criteria as $key => $value) {
list($newKey, $newValue) = $this->grammarExpression($key, $value);
if (is_... | [
"public",
"function",
"translateCriteria",
"(",
"array",
"$",
"criteria",
"=",
"array",
"(",
")",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"criteria",
")",
")",
"{",
"return",
"$",
"criteria",
";",
"}",
"$",
"newCriteria",
"=",
"array",
"(",
")",
";",... | {@inheritDoc} | [
"{"
] | train | https://github.com/xinix-technology/norm/blob/c357f7d3a75d05324dd84b8f6a968a094c53d603/src/Norm/Cursor/MongoCursor.php#L45-L69 |
xinix-technology/norm | src/Norm/Cursor/MongoCursor.php | MongoCursor.current | public function current()
{
$data = $this->getCursor()->current();
return isset($data) ? $this->collection->attach($data) : null;
} | php | public function current()
{
$data = $this->getCursor()->current();
return isset($data) ? $this->collection->attach($data) : null;
} | [
"public",
"function",
"current",
"(",
")",
"{",
"$",
"data",
"=",
"$",
"this",
"->",
"getCursor",
"(",
")",
"->",
"current",
"(",
")",
";",
"return",
"isset",
"(",
"$",
"data",
")",
"?",
"$",
"this",
"->",
"collection",
"->",
"attach",
"(",
"$",
... | {@inheritDoc} | [
"{"
] | train | https://github.com/xinix-technology/norm/blob/c357f7d3a75d05324dd84b8f6a968a094c53d603/src/Norm/Cursor/MongoCursor.php#L74-L79 |
xinix-technology/norm | src/Norm/Cursor/MongoCursor.php | MongoCursor.getCursor | public function getCursor()
{
if (is_null($this->cursor)) {
$rawCollection = $this->connection->getRaw()->{$this->collection->getName()};
if (empty($this->criteria)) {
$this->cursor = $rawCollection->find();
} else {
$this->cursor = $rawCo... | php | public function getCursor()
{
if (is_null($this->cursor)) {
$rawCollection = $this->connection->getRaw()->{$this->collection->getName()};
if (empty($this->criteria)) {
$this->cursor = $rawCollection->find();
} else {
$this->cursor = $rawCo... | [
"public",
"function",
"getCursor",
"(",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"this",
"->",
"cursor",
")",
")",
"{",
"$",
"rawCollection",
"=",
"$",
"this",
"->",
"connection",
"->",
"getRaw",
"(",
")",
"->",
"{",
"$",
"this",
"->",
"collection",... | {@inheritDoc} | [
"{"
] | train | https://github.com/xinix-technology/norm/blob/c357f7d3a75d05324dd84b8f6a968a094c53d603/src/Norm/Cursor/MongoCursor.php#L116-L141 |
xinix-technology/norm | src/Norm/Cursor/MongoCursor.php | MongoCursor.grammarExpression | public function grammarExpression($key, $value)
{
if ($key === '!or' || $key === '!and') {
if (!is_array($value)) {
throw new Exception('[Norm/MongoCursor] "!or" and "!and" must have value as array.');
}
$newValue = array();
foreach ($value a... | php | public function grammarExpression($key, $value)
{
if ($key === '!or' || $key === '!and') {
if (!is_array($value)) {
throw new Exception('[Norm/MongoCursor] "!or" and "!and" must have value as array.');
}
$newValue = array();
foreach ($value a... | [
"public",
"function",
"grammarExpression",
"(",
"$",
"key",
",",
"$",
"value",
")",
"{",
"if",
"(",
"$",
"key",
"===",
"'!or'",
"||",
"$",
"key",
"===",
"'!and'",
")",
"{",
"if",
"(",
"!",
"is_array",
"(",
"$",
"value",
")",
")",
"{",
"throw",
"n... | Generate a standard NORM query expression.
@param string $key
@param mixed $value
@return array | [
"Generate",
"a",
"standard",
"NORM",
"query",
"expression",
"."
] | train | https://github.com/xinix-technology/norm/blob/c357f7d3a75d05324dd84b8f6a968a094c53d603/src/Norm/Cursor/MongoCursor.php#L151-L241 |
xinix-technology/norm | src/Norm/Cursor/MongoCursor.php | MongoCursor.distinct | public function distinct($key) {
$rawCollection = $this->connection->getRaw()->{$this->collection->getName()};
$result = $rawCollection->distinct($key);
return $result;
} | php | public function distinct($key) {
$rawCollection = $this->connection->getRaw()->{$this->collection->getName()};
$result = $rawCollection->distinct($key);
return $result;
} | [
"public",
"function",
"distinct",
"(",
"$",
"key",
")",
"{",
"$",
"rawCollection",
"=",
"$",
"this",
"->",
"connection",
"->",
"getRaw",
"(",
")",
"->",
"{",
"$",
"this",
"->",
"collection",
"->",
"getName",
"(",
")",
"}",
";",
"$",
"result",
"=",
... | {@inheritDoc} | [
"{"
] | train | https://github.com/xinix-technology/norm/blob/c357f7d3a75d05324dd84b8f6a968a094c53d603/src/Norm/Cursor/MongoCursor.php#L247-L252 |
maniaplanet/matchmaking-lobby | MatchMakingLobby/Lobby/Plugin.php | Plugin.onTick | function onTick()
{
$timers = array();
$this->tick++;
if ($this->tick % 8 == 0)
{
gc_collect_cycles();
$mtime = microtime(true);
foreach($this->blockedPlayers as $login => $time)
{
$this->updateKarma($login);
}
$timers['blocked'] = microtime(true) - $mtime;
}
if... | php | function onTick()
{
$timers = array();
$this->tick++;
if ($this->tick % 8 == 0)
{
gc_collect_cycles();
$mtime = microtime(true);
foreach($this->blockedPlayers as $login => $time)
{
$this->updateKarma($login);
}
$timers['blocked'] = microtime(true) - $mtime;
}
if... | [
"function",
"onTick",
"(",
")",
"{",
"$",
"timers",
"=",
"array",
"(",
")",
";",
"$",
"this",
"->",
"tick",
"++",
";",
"if",
"(",
"$",
"this",
"->",
"tick",
"%",
"8",
"==",
"0",
")",
"{",
"gc_collect_cycles",
"(",
")",
";",
"$",
"mtime",
"=",
... | Core of the plugin | [
"Core",
"of",
"the",
"plugin"
] | train | https://github.com/maniaplanet/matchmaking-lobby/blob/384f22cdd2cfb0204a071810549eaf1eb01d8b7f/MatchMakingLobby/Lobby/Plugin.php#L337-L514 |
Kylob/Bootstrap | src/Navbar.php | Navbar.open | public function open($brand, $align = '', $inverse = false)
{
if (is_array($brand)) {
list($brand, $link) = (count($brand) > 1) ? $brand : each($brand);
} else {
$link = $this->page->url['base'];
}
$id = $this->page->id('navbar');
$class = 'navbar';
... | php | public function open($brand, $align = '', $inverse = false)
{
if (is_array($brand)) {
list($brand, $link) = (count($brand) > 1) ? $brand : each($brand);
} else {
$link = $this->page->url['base'];
}
$id = $this->page->id('navbar');
$class = 'navbar';
... | [
"public",
"function",
"open",
"(",
"$",
"brand",
",",
"$",
"align",
"=",
"''",
",",
"$",
"inverse",
"=",
"false",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"brand",
")",
")",
"{",
"list",
"(",
"$",
"brand",
",",
"$",
"link",
")",
"=",
"(",
"... | Create a new navbar.
@param mixed $brand The name of your website. If this is a string then it will automatically link to your ``$page->url['base']``. If you want to override that, then make this an ``array($brand => $link)``.
@param string $align Either '**top**', '**bottom**', or '**static**' if you want to fix... | [
"Create",
"a",
"new",
"navbar",
"."
] | train | https://github.com/Kylob/Bootstrap/blob/0d7677a90656fbc461eabb5512ab16f9d5f728c6/src/Navbar.php#L22-L58 |
Kylob/Bootstrap | src/Navbar.php | Navbar.menu | public function menu(array $links, array $options = array())
{
$align = (isset($options['pull'])) ? ' navbar-'.$options['pull'] : '';
unset($options['pull']);
return "\n\t".'<ul class="nav navbar-nav'.$align.'">'.$this->links('li', $links, $options).'</ul>';
} | php | public function menu(array $links, array $options = array())
{
$align = (isset($options['pull'])) ? ' navbar-'.$options['pull'] : '';
unset($options['pull']);
return "\n\t".'<ul class="nav navbar-nav'.$align.'">'.$this->links('li', $links, $options).'</ul>';
} | [
"public",
"function",
"menu",
"(",
"array",
"$",
"links",
",",
"array",
"$",
"options",
"=",
"array",
"(",
")",
")",
"{",
"$",
"align",
"=",
"(",
"isset",
"(",
"$",
"options",
"[",
"'pull'",
"]",
")",
")",
"?",
"' navbar-'",
".",
"$",
"options",
... | Create a menu of links across your navbar.
@param array $links An ``array($name => $href, ...)`` of links. If ``$href`` is an array unto itself, then it will be turned into a dropdown menu with the same header and divider rules applied as with buttons.
@param array $options The options available here are:
- '**acti... | [
"Create",
"a",
"menu",
"of",
"links",
"across",
"your",
"navbar",
"."
] | train | https://github.com/Kylob/Bootstrap/blob/0d7677a90656fbc461eabb5512ab16f9d5f728c6/src/Navbar.php#L87-L93 |
Kylob/Bootstrap | src/Navbar.php | Navbar.button | public function button($class, $name, array $options = array())
{
$class .= ' navbar-btn';
if (isset($options['pull'])) {
$class .= ' navbar-'.$options['pull'];
}
unset($options['pull']);
return "\n\t".parent::button($class, $name, $options);
} | php | public function button($class, $name, array $options = array())
{
$class .= ' navbar-btn';
if (isset($options['pull'])) {
$class .= ' navbar-'.$options['pull'];
}
unset($options['pull']);
return "\n\t".parent::button($class, $name, $options);
} | [
"public",
"function",
"button",
"(",
"$",
"class",
",",
"$",
"name",
",",
"array",
"$",
"options",
"=",
"array",
"(",
")",
")",
"{",
"$",
"class",
".=",
"' navbar-btn'",
";",
"if",
"(",
"isset",
"(",
"$",
"options",
"[",
"'pull'",
"]",
")",
")",
... | Exactly the same as ``$bp->button()``, except that it will receive a '**navbar-btn**' class.
@param string $class To pull it one way or the other, you can add the class '**navbar-right** or '**navbar-left**'.
@param string $name The text of your button.
@param array $options You can also pull the button here by ... | [
"Exactly",
"the",
"same",
"as",
"$bp",
"-",
">",
"button",
"()",
"except",
"that",
"it",
"will",
"receive",
"a",
"**",
"navbar",
"-",
"btn",
"**",
"class",
"."
] | train | https://github.com/Kylob/Bootstrap/blob/0d7677a90656fbc461eabb5512ab16f9d5f728c6/src/Navbar.php#L112-L121 |
Kylob/Bootstrap | src/Navbar.php | Navbar.search | public function search($url, array $form = array())
{
if (!isset($form['class'])) {
$form['class'] = 'navbar-form navbar-right';
}
return "\n\t".parent::search($url, $form);
} | php | public function search($url, array $form = array())
{
if (!isset($form['class'])) {
$form['class'] = 'navbar-form navbar-right';
}
return "\n\t".parent::search($url, $form);
} | [
"public",
"function",
"search",
"(",
"$",
"url",
",",
"array",
"$",
"form",
"=",
"array",
"(",
")",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"form",
"[",
"'class'",
"]",
")",
")",
"{",
"$",
"form",
"[",
"'class'",
"]",
"=",
"'navbar-form navb... | Exactly the same as ``$bp->search()``, except the ``<form>`` will receive a **'navbar-form navbar-right'** class.
@param string $url Where to send the search term.
@param array $form You can pull the search form left by adding ``array('class' => 'navbar-form navbar-left')``.
@return string
@example
```php
echo $b... | [
"Exactly",
"the",
"same",
"as",
"$bp",
"-",
">",
"search",
"()",
"except",
"the",
"<form",
">",
"will",
"receive",
"a",
"**",
"navbar",
"-",
"form",
"navbar",
"-",
"right",
"**",
"class",
"."
] | train | https://github.com/Kylob/Bootstrap/blob/0d7677a90656fbc461eabb5512ab16f9d5f728c6/src/Navbar.php#L139-L146 |
Kylob/Bootstrap | src/Navbar.php | Navbar.text | public function text($string, $pull = false)
{
$align = (in_array($pull, array('left', 'right'))) ? ' navbar-'.$pull : '';
return "\n\t".'<p class="navbar-text'.$align.'">'.$this->addClass($string, array('a' => 'navbar-link')).'</p>';
} | php | public function text($string, $pull = false)
{
$align = (in_array($pull, array('left', 'right'))) ? ' navbar-'.$pull : '';
return "\n\t".'<p class="navbar-text'.$align.'">'.$this->addClass($string, array('a' => 'navbar-link')).'</p>';
} | [
"public",
"function",
"text",
"(",
"$",
"string",
",",
"$",
"pull",
"=",
"false",
")",
"{",
"$",
"align",
"=",
"(",
"in_array",
"(",
"$",
"pull",
",",
"array",
"(",
"'left'",
",",
"'right'",
")",
")",
")",
"?",
"' navbar-'",
".",
"$",
"pull",
":"... | Add a string of text to your navbar.
@param string $string The message you would like to get across. It will be wrapped in a ``<p class="navbar-text">`` tag, and any ``<a>``'s will be classed with a '**navbar-link**'.
@param string $pull Either '**left**' or '**right**'.
@return string
@example
```php
echo $bp-... | [
"Add",
"a",
"string",
"of",
"text",
"to",
"your",
"navbar",
"."
] | train | https://github.com/Kylob/Bootstrap/blob/0d7677a90656fbc461eabb5512ab16f9d5f728c6/src/Navbar.php#L162-L167 |
SAREhub/PHP_Commons | src/SAREhub/Commons/Misc/TimeProvider.php | TimeProvider.freezeTime | public function freezeTime($now = null)
{
return $this->frozenTime = ($now === null ? $this->now() : $now);
} | php | public function freezeTime($now = null)
{
return $this->frozenTime = ($now === null ? $this->now() : $now);
} | [
"public",
"function",
"freezeTime",
"(",
"$",
"now",
"=",
"null",
")",
"{",
"return",
"$",
"this",
"->",
"frozenTime",
"=",
"(",
"$",
"now",
"===",
"null",
"?",
"$",
"this",
"->",
"now",
"(",
")",
":",
"$",
"now",
")",
";",
"}"
] | Sets const time, now() call will return 'frozen' time
@param null|int $now When null sets time from now() call as 'frozenTime'
@return int Returns frozen time value | [
"Sets",
"const",
"time",
"now",
"()",
"call",
"will",
"return",
"frozen",
"time"
] | train | https://github.com/SAREhub/PHP_Commons/blob/4e1769ab6411a584112df1151dcc90e6b82fe2bb/src/SAREhub/Commons/Misc/TimeProvider.php#L46-L49 |
freyo/flysystem-qcloud-cos-v3 | src/Client/Cosapi.php | Cosapi.createFolder | public static function createFolder($bucketName, $path, $bizAttr = null)
{
$path = self::normalizerPath($path, true);
$path = self::cosUrlEncode($path);
$expired = self::time() + self::EXPIRED_SECONDS;
$url = self::generateResUrl($bucketName, $path);
$sign = Auth::appSign($ex... | php | public static function createFolder($bucketName, $path, $bizAttr = null)
{
$path = self::normalizerPath($path, true);
$path = self::cosUrlEncode($path);
$expired = self::time() + self::EXPIRED_SECONDS;
$url = self::generateResUrl($bucketName, $path);
$sign = Auth::appSign($ex... | [
"public",
"static",
"function",
"createFolder",
"(",
"$",
"bucketName",
",",
"$",
"path",
",",
"$",
"bizAttr",
"=",
"null",
")",
"{",
"$",
"path",
"=",
"self",
"::",
"normalizerPath",
"(",
"$",
"path",
",",
"true",
")",
";",
"$",
"path",
"=",
"self",... | 创建目录.
@param string $bucketName bucket名称
@param string $path 目录路径
@param string $bizAttr 目录属性
@return array | [
"创建目录",
"."
] | train | https://github.com/freyo/flysystem-qcloud-cos-v3/blob/6bddbc22396aa1228942ec4c0ce46935d415f3b4/src/Client/Cosapi.php#L101-L128 |
freyo/flysystem-qcloud-cos-v3 | src/Client/Cosapi.php | Cosapi.prefixSearch | public static function prefixSearch(
$bucketName, $prefix, $num = 20,
$pattern = 'eListBoth', $order = 0,
$context = null)
{
$path = self::normalizerPath($prefix);
return self::listBase($bucketName, $path, $num,
$pattern, $... | php | public static function prefixSearch(
$bucketName, $prefix, $num = 20,
$pattern = 'eListBoth', $order = 0,
$context = null)
{
$path = self::normalizerPath($prefix);
return self::listBase($bucketName, $path, $num,
$pattern, $... | [
"public",
"static",
"function",
"prefixSearch",
"(",
"$",
"bucketName",
",",
"$",
"prefix",
",",
"$",
"num",
"=",
"20",
",",
"$",
"pattern",
"=",
"'eListBoth'",
",",
"$",
"order",
"=",
"0",
",",
"$",
"context",
"=",
"null",
")",
"{",
"$",
"path",
"... | 目录列表(前缀搜索).
@param string $bucketName bucket名称
@param string $prefix 列出含此前缀的所有文件
@param int $num 拉取的总数
@param string $pattern eListBoth(默认),ListDirOnly,eListFileOnly
@param int $order 默认正序(=0), 填1为反序,
@param string $context 透传字段,用于翻页,前端不需理解,需要往前/往后翻页则透传回来
@return array | [
"目录列表",
"(",
"前缀搜索",
")",
"."
] | train | https://github.com/freyo/flysystem-qcloud-cos-v3/blob/6bddbc22396aa1228942ec4c0ce46935d415f3b4/src/Client/Cosapi.php#L165-L174 |
freyo/flysystem-qcloud-cos-v3 | src/Client/Cosapi.php | Cosapi.statFolder | public static function statFolder($bucketName, $path)
{
$path = self::normalizerPath($path, true);
return self::statBase($bucketName, $path);
} | php | public static function statFolder($bucketName, $path)
{
$path = self::normalizerPath($path, true);
return self::statBase($bucketName, $path);
} | [
"public",
"static",
"function",
"statFolder",
"(",
"$",
"bucketName",
",",
"$",
"path",
")",
"{",
"$",
"path",
"=",
"self",
"::",
"normalizerPath",
"(",
"$",
"path",
",",
"true",
")",
";",
"return",
"self",
"::",
"statBase",
"(",
"$",
"bucketName",
","... | 查询目录信息.
@param string $bucketName bucket名称
@param string $path 目录路径
@return array | [
"查询目录信息",
"."
] | train | https://github.com/freyo/flysystem-qcloud-cos-v3/blob/6bddbc22396aa1228942ec4c0ce46935d415f3b4/src/Client/Cosapi.php#L200-L205 |
freyo/flysystem-qcloud-cos-v3 | src/Client/Cosapi.php | Cosapi.delFolder | public static function delFolder($bucketName, $path)
{
$path = self::normalizerPath($path, true);
return self::delBase($bucketName, $path);
} | php | public static function delFolder($bucketName, $path)
{
$path = self::normalizerPath($path, true);
return self::delBase($bucketName, $path);
} | [
"public",
"static",
"function",
"delFolder",
"(",
"$",
"bucketName",
",",
"$",
"path",
")",
"{",
"$",
"path",
"=",
"self",
"::",
"normalizerPath",
"(",
"$",
"path",
",",
"true",
")",
";",
"return",
"self",
"::",
"delBase",
"(",
"$",
"bucketName",
",",
... | 删除目录.
@param string $bucketName bucket名称
@param string $path 目录路径
注意不能删除bucket下根目录/
@return array | [
"删除目录",
"."
] | train | https://github.com/freyo/flysystem-qcloud-cos-v3/blob/6bddbc22396aa1228942ec4c0ce46935d415f3b4/src/Client/Cosapi.php#L216-L221 |
freyo/flysystem-qcloud-cos-v3 | src/Client/Cosapi.php | Cosapi.move | public static function move($bucketName, $srcPath, $dstPath, $toOverWrite = 0)
{
$srcPath = self::normalizerPath($srcPath);
$dstPath = self::normalizerPath($dstPath);
$srcPath = self::cosUrlEncode($srcPath);
$url = self::generateResUrl($bucketName, $srcPath);
$sign = Auth::a... | php | public static function move($bucketName, $srcPath, $dstPath, $toOverWrite = 0)
{
$srcPath = self::normalizerPath($srcPath);
$dstPath = self::normalizerPath($dstPath);
$srcPath = self::cosUrlEncode($srcPath);
$url = self::generateResUrl($bucketName, $srcPath);
$sign = Auth::a... | [
"public",
"static",
"function",
"move",
"(",
"$",
"bucketName",
",",
"$",
"srcPath",
",",
"$",
"dstPath",
",",
"$",
"toOverWrite",
"=",
"0",
")",
"{",
"$",
"srcPath",
"=",
"self",
"::",
"normalizerPath",
"(",
"$",
"srcPath",
")",
";",
"$",
"dstPath",
... | 移动(重命名)文件.
@param string $bucketName bucket名称
@param string $srcPath 源文件路径
@param string $dstPath 目的文件名(可以是单独文件名也可以是带目录的文件名)
@param int $toOverWrite 是否覆盖(当目的文件名已经存在同名文件时是否覆盖)
@return array | [
"移动",
"(",
"重命名",
")",
"文件",
"."
] | train | https://github.com/freyo/flysystem-qcloud-cos-v3/blob/6bddbc22396aa1228942ec4c0ce46935d415f3b4/src/Client/Cosapi.php#L257-L286 |
freyo/flysystem-qcloud-cos-v3 | src/Client/Cosapi.php | Cosapi.uploadfile | private static function uploadfile($bucketName, $srcPath, $dstPath, $bizAttr = null, $insertOnly = null)
{
$srcPath = realpath($srcPath);
$dstPath = self::cosUrlEncode($dstPath);
if (filesize($srcPath) >= self::MAX_UNSLICE_FILE_SIZE) {
return [
'code' => s... | php | private static function uploadfile($bucketName, $srcPath, $dstPath, $bizAttr = null, $insertOnly = null)
{
$srcPath = realpath($srcPath);
$dstPath = self::cosUrlEncode($dstPath);
if (filesize($srcPath) >= self::MAX_UNSLICE_FILE_SIZE) {
return [
'code' => s... | [
"private",
"static",
"function",
"uploadfile",
"(",
"$",
"bucketName",
",",
"$",
"srcPath",
",",
"$",
"dstPath",
",",
"$",
"bizAttr",
"=",
"null",
",",
"$",
"insertOnly",
"=",
"null",
")",
"{",
"$",
"srcPath",
"=",
"realpath",
"(",
"$",
"srcPath",
")",... | 内部方法, 上传文件.
@param string $bucketName bucket名称
@param string $srcPath 本地文件路径
@param string $dstPath 上传的文件路径
@param string $bizAttr 文件属性
@param int $insertOnly 是否覆盖同名文件:0 覆盖,1:不覆盖
@return array | [
"内部方法",
"上传文件",
"."
] | train | https://github.com/freyo/flysystem-qcloud-cos-v3/blob/6bddbc22396aa1228942ec4c0ce46935d415f3b4/src/Client/Cosapi.php#L329-L373 |
freyo/flysystem-qcloud-cos-v3 | src/Client/Cosapi.php | Cosapi.upload_slice | private static function upload_slice(
$bucketName, $srcPath, $dstPath,
$bizAttr = null, $sliceSize = null, $insertOnly = null)
{
$srcPath = realpath($srcPath);
$fileSize = filesize($srcPath);
$dstPath = self::cosUrlEncode($dstPath);
$expired = self::time() + self::EX... | php | private static function upload_slice(
$bucketName, $srcPath, $dstPath,
$bizAttr = null, $sliceSize = null, $insertOnly = null)
{
$srcPath = realpath($srcPath);
$fileSize = filesize($srcPath);
$dstPath = self::cosUrlEncode($dstPath);
$expired = self::time() + self::EX... | [
"private",
"static",
"function",
"upload_slice",
"(",
"$",
"bucketName",
",",
"$",
"srcPath",
",",
"$",
"dstPath",
",",
"$",
"bizAttr",
"=",
"null",
",",
"$",
"sliceSize",
"=",
"null",
",",
"$",
"insertOnly",
"=",
"null",
")",
"{",
"$",
"srcPath",
"=",... | 内部方法,上传文件.
@param string $bucketName bucket名称
@param string $srcPath 本地文件路径
@param string $dstPath 上传的文件路径
@param string $bizAttr 文件属性
@param string $sliceSize 分片大小
@param int $insertOnly 是否覆盖同名文件:0 覆盖,1:不覆盖
@return array | [
"内部方法",
"上传文件",
"."
] | train | https://github.com/freyo/flysystem-qcloud-cos-v3/blob/6bddbc22396aa1228942ec4c0ce46935d415f3b4/src/Client/Cosapi.php#L387-L438 |
freyo/flysystem-qcloud-cos-v3 | src/Client/Cosapi.php | Cosapi.upload_prepare | private static function upload_prepare(
$fileSize, $sha1, $sliceSize,
$sign, $url, $bizAttr = null, $insertOnly = null)
{
$data = [
'op' => 'upload_slice',
'filesize' => $fileSize,
'sha' => $sha1,
];
if (isset($bizAttr) && strle... | php | private static function upload_prepare(
$fileSize, $sha1, $sliceSize,
$sign, $url, $bizAttr = null, $insertOnly = null)
{
$data = [
'op' => 'upload_slice',
'filesize' => $fileSize,
'sha' => $sha1,
];
if (isset($bizAttr) && strle... | [
"private",
"static",
"function",
"upload_prepare",
"(",
"$",
"fileSize",
",",
"$",
"sha1",
",",
"$",
"sliceSize",
",",
"$",
"sign",
",",
"$",
"url",
",",
"$",
"bizAttr",
"=",
"null",
",",
"$",
"insertOnly",
"=",
"null",
")",
"{",
"$",
"data",
"=",
... | 第一个分片控制消息.
@param string $fileSize 文件大小
@param string $sha1 文件sha值
@param string $sliceSize 分片大小
@param string $sign 签名
@param string $url URL
@param string $bizAttr 文件属性
@param string $insertOnly 同名文件是否覆盖
@return array | [
"第一个分片控制消息",
"."
] | train | https://github.com/freyo/flysystem-qcloud-cos-v3/blob/6bddbc22396aa1228942ec4c0ce46935d415f3b4/src/Client/Cosapi.php#L453-L490 |
freyo/flysystem-qcloud-cos-v3 | src/Client/Cosapi.php | Cosapi.updateBase | private static function updateBase($bucketName, $path,
$bizAttr = null, $authority = null, $custom_headers_array = null)
{
$path = self::cosUrlEncode($path);
$url = self::generateResUrl($bucketName, $path);
$sign = Auth::appSign_once(
$path, $bucketName);... | php | private static function updateBase($bucketName, $path,
$bizAttr = null, $authority = null, $custom_headers_array = null)
{
$path = self::cosUrlEncode($path);
$url = self::generateResUrl($bucketName, $path);
$sign = Auth::appSign_once(
$path, $bucketName);... | [
"private",
"static",
"function",
"updateBase",
"(",
"$",
"bucketName",
",",
"$",
"path",
",",
"$",
"bizAttr",
"=",
"null",
",",
"$",
"authority",
"=",
"null",
",",
"$",
"custom_headers_array",
"=",
"null",
")",
"{",
"$",
"path",
"=",
"self",
"::",
"cos... | 内部公共方法(更新文件和更新文件夹).
@param string $bucketName bucket名称
@param string $path 路径
@param string $bizAttr 文件/目录属性
@param string $authority : eInvalid/eWRPrivate(私有)/eWPrivateRPublic(公有读写)
@param array $custom_headers_array 携带的用户自定义头域,包括
'Cache-Control' => '*'
'Content-Typ... | [
"内部公共方法",
"(",
"更新文件和更新文件夹",
")",
"."
] | train | https://github.com/freyo/flysystem-qcloud-cos-v3/blob/6bddbc22396aa1228942ec4c0ce46935d415f3b4/src/Client/Cosapi.php#L682-L737 |
freyo/flysystem-qcloud-cos-v3 | src/Client/Cosapi.php | Cosapi.statBase | private static function statBase($bucketName, $path)
{
$path = self::cosUrlEncode($path);
$expired = self::time() + self::EXPIRED_SECONDS;
$url = self::generateResUrl($bucketName, $path);
$sign = Auth::appSign($expired, $bucketName);
$data = [
'op' => 'stat',
... | php | private static function statBase($bucketName, $path)
{
$path = self::cosUrlEncode($path);
$expired = self::time() + self::EXPIRED_SECONDS;
$url = self::generateResUrl($bucketName, $path);
$sign = Auth::appSign($expired, $bucketName);
$data = [
'op' => 'stat',
... | [
"private",
"static",
"function",
"statBase",
"(",
"$",
"bucketName",
",",
"$",
"path",
")",
"{",
"$",
"path",
"=",
"self",
"::",
"cosUrlEncode",
"(",
"$",
"path",
")",
";",
"$",
"expired",
"=",
"self",
"::",
"time",
"(",
")",
"+",
"self",
"::",
"EX... | 内部方法.
@param string $bucketName bucket名称
@param string $path 文件/目录路径
@return array | [
"内部方法",
"."
] | train | https://github.com/freyo/flysystem-qcloud-cos-v3/blob/6bddbc22396aa1228942ec4c0ce46935d415f3b4/src/Client/Cosapi.php#L747-L770 |
freyo/flysystem-qcloud-cos-v3 | src/Client/Cosapi.php | Cosapi.delBase | private static function delBase($bucketName, $path)
{
if ($path == '/') {
return [
'code' => self::COSAPI_PARAMS_ERROR,
'message' => 'can not delete bucket using api! go to http://console.qcloud.com/cos to operate bucket',
];
... | php | private static function delBase($bucketName, $path)
{
if ($path == '/') {
return [
'code' => self::COSAPI_PARAMS_ERROR,
'message' => 'can not delete bucket using api! go to http://console.qcloud.com/cos to operate bucket',
];
... | [
"private",
"static",
"function",
"delBase",
"(",
"$",
"bucketName",
",",
"$",
"path",
")",
"{",
"if",
"(",
"$",
"path",
"==",
"'/'",
")",
"{",
"return",
"[",
"'code'",
"=>",
"self",
"::",
"COSAPI_PARAMS_ERROR",
",",
"'message'",
"=>",
"'can not delete buck... | 内部私有方法.
@param string $bucketName bucket名称
@param string $path 文件/目录路径路径
@return array | [
"内部私有方法",
"."
] | train | https://github.com/freyo/flysystem-qcloud-cos-v3/blob/6bddbc22396aa1228942ec4c0ce46935d415f3b4/src/Client/Cosapi.php#L780-L813 |
freyo/flysystem-qcloud-cos-v3 | src/Client/Cosapi.php | Cosapi.sendRequest | private static function sendRequest($req)
{
$rsp = Http::send($req);
$ret = json_decode($rsp, true);
if ($ret) {
if (0 === $ret['code']) {
return $ret;
} else {
return [
'code' => $ret['code'],
... | php | private static function sendRequest($req)
{
$rsp = Http::send($req);
$ret = json_decode($rsp, true);
if ($ret) {
if (0 === $ret['code']) {
return $ret;
} else {
return [
'code' => $ret['code'],
... | [
"private",
"static",
"function",
"sendRequest",
"(",
"$",
"req",
")",
"{",
"$",
"rsp",
"=",
"Http",
"::",
"send",
"(",
"$",
"req",
")",
";",
"$",
"ret",
"=",
"json_decode",
"(",
"$",
"rsp",
",",
"true",
")",
";",
"if",
"(",
"$",
"ret",
")",
"{"... | 内部公共方法, 发送消息.
@param array $req
@return array | [
"内部公共方法",
"发送消息",
"."
] | train | https://github.com/freyo/flysystem-qcloud-cos-v3/blob/6bddbc22396aa1228942ec4c0ce46935d415f3b4/src/Client/Cosapi.php#L847-L870 |
freyo/flysystem-qcloud-cos-v3 | src/Client/Cosapi.php | Cosapi.normalizerPath | private static function normalizerPath($path, $isfolder = false)
{
if (preg_match('/^\//', $path) == 0) {
$path = '/'.$path;
}
if ($isfolder == true) {
if (preg_match('/\/$/', $path) == 0) {
$path = $path.'/';
}
}
return $... | php | private static function normalizerPath($path, $isfolder = false)
{
if (preg_match('/^\//', $path) == 0) {
$path = '/'.$path;
}
if ($isfolder == true) {
if (preg_match('/\/$/', $path) == 0) {
$path = $path.'/';
}
}
return $... | [
"private",
"static",
"function",
"normalizerPath",
"(",
"$",
"path",
",",
"$",
"isfolder",
"=",
"false",
")",
"{",
"if",
"(",
"preg_match",
"(",
"'/^\\//'",
",",
"$",
"path",
")",
"==",
"0",
")",
"{",
"$",
"path",
"=",
"'/'",
".",
"$",
"path",
";",... | 内部方法, 规整文件路径.
@param string $path 文件路径
@param bool $isfolder 是否为文件夹
@return string | [
"内部方法",
"规整文件路径",
"."
] | train | https://github.com/freyo/flysystem-qcloud-cos-v3/blob/6bddbc22396aa1228942ec4c0ce46935d415f3b4/src/Client/Cosapi.php#L907-L920 |
CakeCMS/Core | src/View/Helper/DocumentHelper.php | DocumentHelper.assets | public function assets($type = 'css')
{
$output = [];
$assets = $this->Assets->getAssets($type);
foreach ($assets as $asset) {
$output[] = $asset['output'];
}
return implode($this->eol, $output);
} | php | public function assets($type = 'css')
{
$output = [];
$assets = $this->Assets->getAssets($type);
foreach ($assets as $asset) {
$output[] = $asset['output'];
}
return implode($this->eol, $output);
} | [
"public",
"function",
"assets",
"(",
"$",
"type",
"=",
"'css'",
")",
"{",
"$",
"output",
"=",
"[",
"]",
";",
"$",
"assets",
"=",
"$",
"this",
"->",
"Assets",
"->",
"getAssets",
"(",
"$",
"type",
")",
";",
"foreach",
"(",
"$",
"assets",
"as",
"$",... | Get assets fot layout render.
@param string $type
@return string | [
"Get",
"assets",
"fot",
"layout",
"render",
"."
] | train | https://github.com/CakeCMS/Core/blob/f9cba7aa0043a10e5c35bd45fbad158688a09a96/src/View/Helper/DocumentHelper.php#L118-L127 |
CakeCMS/Core | src/View/Helper/DocumentHelper.php | DocumentHelper.beforeLayout | public function beforeLayout(Event $event, $layoutFile)
{
$pluginEvent = Plugin::getData('Core', 'View.beforeLayout');
if (is_callable($pluginEvent->find(0)) && Plugin::hasManifestEvent('View.beforeLayout')) {
call_user_func_array($pluginEvent->find(0), [$this->_View, $event, $layoutFile... | php | public function beforeLayout(Event $event, $layoutFile)
{
$pluginEvent = Plugin::getData('Core', 'View.beforeLayout');
if (is_callable($pluginEvent->find(0)) && Plugin::hasManifestEvent('View.beforeLayout')) {
call_user_func_array($pluginEvent->find(0), [$this->_View, $event, $layoutFile... | [
"public",
"function",
"beforeLayout",
"(",
"Event",
"$",
"event",
",",
"$",
"layoutFile",
")",
"{",
"$",
"pluginEvent",
"=",
"Plugin",
"::",
"getData",
"(",
"'Core'",
",",
"'View.beforeLayout'",
")",
";",
"if",
"(",
"is_callable",
"(",
"$",
"pluginEvent",
... | Is called before layout rendering starts. Receives the layout filename as an argument.
@param Event $event
@param string $layoutFile
@return void
@throws \JBZoo\Utils\Exception | [
"Is",
"called",
"before",
"layout",
"rendering",
"starts",
".",
"Receives",
"the",
"layout",
"filename",
"as",
"an",
"argument",
"."
] | train | https://github.com/CakeCMS/Core/blob/f9cba7aa0043a10e5c35bd45fbad158688a09a96/src/View/Helper/DocumentHelper.php#L138-L144 |
CakeCMS/Core | src/View/Helper/DocumentHelper.php | DocumentHelper.beforeRender | public function beforeRender(Event $event, $viewFile)
{
$this->Assets->loadPluginAssets();
$pluginEvent = Plugin::getData('Core', 'View.beforeRender');
if (is_callable($pluginEvent->find(0)) && Plugin::hasManifestEvent('View.beforeRender')) {
call_user_func_array($pluginEvent->f... | php | public function beforeRender(Event $event, $viewFile)
{
$this->Assets->loadPluginAssets();
$pluginEvent = Plugin::getData('Core', 'View.beforeRender');
if (is_callable($pluginEvent->find(0)) && Plugin::hasManifestEvent('View.beforeRender')) {
call_user_func_array($pluginEvent->f... | [
"public",
"function",
"beforeRender",
"(",
"Event",
"$",
"event",
",",
"$",
"viewFile",
")",
"{",
"$",
"this",
"->",
"Assets",
"->",
"loadPluginAssets",
"(",
")",
";",
"$",
"pluginEvent",
"=",
"Plugin",
"::",
"getData",
"(",
"'Core'",
",",
"'View.beforeRen... | Is called after the controller’s beforeRender method but before the controller renders view and layout.
Receives the file being rendered as an argument.
@param Event $event
@param string $viewFile
@return void
@throws \JBZoo\Less\Exception
@throws \JBZoo\Utils\Exception | [
"Is",
"called",
"after",
"the",
"controller’s",
"beforeRender",
"method",
"but",
"before",
"the",
"controller",
"renders",
"view",
"and",
"layout",
".",
"Receives",
"the",
"file",
"being",
"rendered",
"as",
"an",
"argument",
"."
] | train | https://github.com/CakeCMS/Core/blob/f9cba7aa0043a10e5c35bd45fbad158688a09a96/src/View/Helper/DocumentHelper.php#L157-L165 |
CakeCMS/Core | src/View/Helper/DocumentHelper.php | DocumentHelper.beforeRenderFile | public function beforeRenderFile(Event $event, $viewFile)
{
$pluginEvent = Plugin::getData('Core', 'View.beforeRenderFile');
if (is_callable($pluginEvent->find(0)) && Plugin::hasManifestEvent('View.beforeRenderFile')) {
call_user_func_array($pluginEvent->find(0), [$this->_View, $event, $... | php | public function beforeRenderFile(Event $event, $viewFile)
{
$pluginEvent = Plugin::getData('Core', 'View.beforeRenderFile');
if (is_callable($pluginEvent->find(0)) && Plugin::hasManifestEvent('View.beforeRenderFile')) {
call_user_func_array($pluginEvent->find(0), [$this->_View, $event, $... | [
"public",
"function",
"beforeRenderFile",
"(",
"Event",
"$",
"event",
",",
"$",
"viewFile",
")",
"{",
"$",
"pluginEvent",
"=",
"Plugin",
"::",
"getData",
"(",
"'Core'",
",",
"'View.beforeRenderFile'",
")",
";",
"if",
"(",
"is_callable",
"(",
"$",
"pluginEven... | Is called before each view file is rendered. This includes elements, views, parent views and layouts.
@param Event $event
@param string $viewFile
@return void
@throws \JBZoo\Utils\Exception | [
"Is",
"called",
"before",
"each",
"view",
"file",
"is",
"rendered",
".",
"This",
"includes",
"elements",
"views",
"parent",
"views",
"and",
"layouts",
"."
] | train | https://github.com/CakeCMS/Core/blob/f9cba7aa0043a10e5c35bd45fbad158688a09a96/src/View/Helper/DocumentHelper.php#L176-L182 |
CakeCMS/Core | src/View/Helper/DocumentHelper.php | DocumentHelper.getBodyClasses | public function getBodyClasses()
{
$prefix = ($this->request->getParam('prefix')) ? 'prefix-' . $this->request->getParam('prefix') : 'prefix-site';
$classes = [
$prefix,
'theme-' . Str::low($this->_View->theme),
'plugin-' . Str::low($this->_View->plugin),
... | php | public function getBodyClasses()
{
$prefix = ($this->request->getParam('prefix')) ? 'prefix-' . $this->request->getParam('prefix') : 'prefix-site';
$classes = [
$prefix,
'theme-' . Str::low($this->_View->theme),
'plugin-' . Str::low($this->_View->plugin),
... | [
"public",
"function",
"getBodyClasses",
"(",
")",
"{",
"$",
"prefix",
"=",
"(",
"$",
"this",
"->",
"request",
"->",
"getParam",
"(",
"'prefix'",
")",
")",
"?",
"'prefix-'",
".",
"$",
"this",
"->",
"request",
"->",
"getParam",
"(",
"'prefix'",
")",
":",... | Get body classes by view data.
@return string | [
"Get",
"body",
"classes",
"by",
"view",
"data",
"."
] | train | https://github.com/CakeCMS/Core/blob/f9cba7aa0043a10e5c35bd45fbad158688a09a96/src/View/Helper/DocumentHelper.php#L189-L208 |
CakeCMS/Core | src/View/Helper/DocumentHelper.php | DocumentHelper.head | public function head()
{
$output = [
'meta' => $this->_View->fetch('meta'),
'assets' => $this->assets('css'),
'fetch_css' => $this->_View->fetch('css'),
'fetch_css_bottom' => $this->_View->fetch('css_bottom'),
];
r... | php | public function head()
{
$output = [
'meta' => $this->_View->fetch('meta'),
'assets' => $this->assets('css'),
'fetch_css' => $this->_View->fetch('css'),
'fetch_css_bottom' => $this->_View->fetch('css_bottom'),
];
r... | [
"public",
"function",
"head",
"(",
")",
"{",
"$",
"output",
"=",
"[",
"'meta'",
"=>",
"$",
"this",
"->",
"_View",
"->",
"fetch",
"(",
"'meta'",
")",
",",
"'assets'",
"=>",
"$",
"this",
"->",
"assets",
"(",
"'css'",
")",
",",
"'fetch_css'",
"=>",
"$... | Create head for layout.
@return string | [
"Create",
"head",
"for",
"layout",
"."
] | train | https://github.com/CakeCMS/Core/blob/f9cba7aa0043a10e5c35bd45fbad158688a09a96/src/View/Helper/DocumentHelper.php#L215-L225 |
CakeCMS/Core | src/View/Helper/DocumentHelper.php | DocumentHelper.initialize | public function initialize(array $config)
{
parent::initialize($config);
$this->dir = Configure::read('Cms.docDir');
$this->locale = Configure::read('App.defaultLocale');
$this->charset = Str::low(Configure::read('App.encoding'));
$this->eol = (Configure::read('debu... | php | public function initialize(array $config)
{
parent::initialize($config);
$this->dir = Configure::read('Cms.docDir');
$this->locale = Configure::read('App.defaultLocale');
$this->charset = Str::low(Configure::read('App.encoding'));
$this->eol = (Configure::read('debu... | [
"public",
"function",
"initialize",
"(",
"array",
"$",
"config",
")",
"{",
"parent",
"::",
"initialize",
"(",
"$",
"config",
")",
";",
"$",
"this",
"->",
"dir",
"=",
"Configure",
"::",
"read",
"(",
"'Cms.docDir'",
")",
";",
"$",
"this",
"->",
"locale",... | Constructor hook method.
@param array $config | [
"Constructor",
"hook",
"method",
"."
] | train | https://github.com/CakeCMS/Core/blob/f9cba7aa0043a10e5c35bd45fbad158688a09a96/src/View/Helper/DocumentHelper.php#L232-L241 |
CakeCMS/Core | src/View/Helper/DocumentHelper.php | DocumentHelper.lang | public function lang($isLang = true)
{
list($lang, $region) = explode('_', $this->locale);
return ($isLang) ? Str::low($lang) : Str::low($region);
} | php | public function lang($isLang = true)
{
list($lang, $region) = explode('_', $this->locale);
return ($isLang) ? Str::low($lang) : Str::low($region);
} | [
"public",
"function",
"lang",
"(",
"$",
"isLang",
"=",
"true",
")",
"{",
"list",
"(",
"$",
"lang",
",",
"$",
"region",
")",
"=",
"explode",
"(",
"'_'",
",",
"$",
"this",
"->",
"locale",
")",
";",
"return",
"(",
"$",
"isLang",
")",
"?",
"Str",
"... | Site language.
@param bool|true $isLang
@return string
@throws \Exception | [
"Site",
"language",
"."
] | train | https://github.com/CakeCMS/Core/blob/f9cba7aa0043a10e5c35bd45fbad158688a09a96/src/View/Helper/DocumentHelper.php#L251-L255 |
CakeCMS/Core | src/View/Helper/DocumentHelper.php | DocumentHelper.meta | public function meta(array $rows, $block = null)
{
$output = [];
foreach ($rows as $row) {
$output[] = trim($row);
}
$output = implode($this->eol, $output) . $this->eol;
if ($block !== null) {
$this->_View->append($block, $output);
return... | php | public function meta(array $rows, $block = null)
{
$output = [];
foreach ($rows as $row) {
$output[] = trim($row);
}
$output = implode($this->eol, $output) . $this->eol;
if ($block !== null) {
$this->_View->append($block, $output);
return... | [
"public",
"function",
"meta",
"(",
"array",
"$",
"rows",
",",
"$",
"block",
"=",
"null",
")",
"{",
"$",
"output",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"rows",
"as",
"$",
"row",
")",
"{",
"$",
"output",
"[",
"]",
"=",
"trim",
"(",
"$",
"ro... | Creates a link to an external resource and handles basic meta tags.
@param array $rows
@param null $block
@return null|string | [
"Creates",
"a",
"link",
"to",
"an",
"external",
"resource",
"and",
"handles",
"basic",
"meta",
"tags",
"."
] | train | https://github.com/CakeCMS/Core/blob/f9cba7aa0043a10e5c35bd45fbad158688a09a96/src/View/Helper/DocumentHelper.php#L264-L279 |
CakeCMS/Core | src/View/Helper/DocumentHelper.php | DocumentHelper.type | public function type()
{
$lang = $this->lang();
$html = [
'<!doctype html>',
'<!--[if lt IE 7]><html class="no-js lt-ie9 lt-ie8 lt-ie7 ie6" '
. 'lang="' . $lang . '" dir="' . $this->dir . '"> <![endif]-->',
'<!--[if IE 7]><html class="no-js lt-ie9 lt-i... | php | public function type()
{
$lang = $this->lang();
$html = [
'<!doctype html>',
'<!--[if lt IE 7]><html class="no-js lt-ie9 lt-ie8 lt-ie7 ie6" '
. 'lang="' . $lang . '" dir="' . $this->dir . '"> <![endif]-->',
'<!--[if IE 7]><html class="no-js lt-ie9 lt-i... | [
"public",
"function",
"type",
"(",
")",
"{",
"$",
"lang",
"=",
"$",
"this",
"->",
"lang",
"(",
")",
";",
"$",
"html",
"=",
"[",
"'<!doctype html>'",
",",
"'<!--[if lt IE 7]><html class=\"no-js lt-ie9 lt-ie8 lt-ie7 ie6\" '",
".",
"'lang=\"'",
".",
"$",
"lang",
... | Create html 5 document type.
@return string
@throws \Exception | [
"Create",
"html",
"5",
"document",
"type",
"."
] | train | https://github.com/CakeCMS/Core/blob/f9cba7aa0043a10e5c35bd45fbad158688a09a96/src/View/Helper/DocumentHelper.php#L288-L305 |
CakeCMS/Core | src/View/Helper/DocumentHelper.php | DocumentHelper._assignMeta | protected function _assignMeta($key)
{
if (Arr::key($key, $this->_View->viewVars)) {
$this->_View->assign($key, $this->_View->viewVars[$key]);
}
return $this;
} | php | protected function _assignMeta($key)
{
if (Arr::key($key, $this->_View->viewVars)) {
$this->_View->assign($key, $this->_View->viewVars[$key]);
}
return $this;
} | [
"protected",
"function",
"_assignMeta",
"(",
"$",
"key",
")",
"{",
"if",
"(",
"Arr",
"::",
"key",
"(",
"$",
"key",
",",
"$",
"this",
"->",
"_View",
"->",
"viewVars",
")",
")",
"{",
"$",
"this",
"->",
"_View",
"->",
"assign",
"(",
"$",
"key",
",",... | Assign data from view vars.
@param string $key
@return $this | [
"Assign",
"data",
"from",
"view",
"vars",
"."
] | train | https://github.com/CakeCMS/Core/blob/f9cba7aa0043a10e5c35bd45fbad158688a09a96/src/View/Helper/DocumentHelper.php#L313-L320 |
lode/fem | src/mysql.php | mysql.connect | public static function connect($config=null) {
if (empty($config)) {
$config = self::get_config();
}
self::$connection = new \mysqli($config['host'], $config['user'], $config['pass'], $config['name'], $config['port']);
self::$connection->set_charset('utf8');
$sql_modes = [
// force correct column types
... | php | public static function connect($config=null) {
if (empty($config)) {
$config = self::get_config();
}
self::$connection = new \mysqli($config['host'], $config['user'], $config['pass'], $config['name'], $config['port']);
self::$connection->set_charset('utf8');
$sql_modes = [
// force correct column types
... | [
"public",
"static",
"function",
"connect",
"(",
"$",
"config",
"=",
"null",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"config",
")",
")",
"{",
"$",
"config",
"=",
"self",
"::",
"get_config",
"(",
")",
";",
"}",
"self",
"::",
"$",
"connection",
"=",
... | connects to the database, defined by ::get_config()
makes sure we have a strict and unicode aware connection
@see http://stackoverflow.com/questions/5741187/sql-injection-that-gets-around-mysql-real-escape-string
@param array $config optional, containing 'host', 'user', 'pass', 'name', and 'port' values
@return void | [
"connects",
"to",
"the",
"database",
"defined",
"by",
"::",
"get_config",
"()",
"makes",
"sure",
"we",
"have",
"a",
"strict",
"and",
"unicode",
"aware",
"connection"
] | train | https://github.com/lode/fem/blob/c1c466c1a904d99452b341c5ae7cbc3e22b106e1/src/mysql.php#L39-L63 |
lode/fem | src/mysql.php | mysql.select | public static function select($type, $sql, $binds=null) {
if (in_array($type, self::$types) == false) {
$exception = bootstrap::get_library('exception');
throw new $exception('unknown select type');
}
$results = self::query($sql, $binds);
return self::{'as_'.$type}($results);
} | php | public static function select($type, $sql, $binds=null) {
if (in_array($type, self::$types) == false) {
$exception = bootstrap::get_library('exception');
throw new $exception('unknown select type');
}
$results = self::query($sql, $binds);
return self::{'as_'.$type}($results);
} | [
"public",
"static",
"function",
"select",
"(",
"$",
"type",
",",
"$",
"sql",
",",
"$",
"binds",
"=",
"null",
")",
"{",
"if",
"(",
"in_array",
"(",
"$",
"type",
",",
"self",
"::",
"$",
"types",
")",
"==",
"false",
")",
"{",
"$",
"exception",
"=",
... | executes a SELECT statement, and returns the result as array, row, or single field
@param string $type one of the ::AS_* consts
@param string $sql the base sql statement
@param array $binds bind values for the given sql, @see ::merge()
@return array result set | [
"executes",
"a",
"SELECT",
"statement",
"and",
"returns",
"the",
"result",
"as",
"array",
"row",
"or",
"single",
"field"
] | train | https://github.com/lode/fem/blob/c1c466c1a904d99452b341c5ae7cbc3e22b106e1/src/mysql.php#L91-L99 |
lode/fem | src/mysql.php | mysql.query | public static function query($sql, $binds=null) {
if (!empty($binds)) {
$sql = self::merge($sql, $binds);
}
// secure against wild update/delete statements
if (preg_match('{^(UPDATE|DELETE)\s}', $sql) && preg_match('{\s(WHERE|LIMIT)\s}', $sql) == false) {
$exception = bootstrap::get_library('exception');
th... | php | public static function query($sql, $binds=null) {
if (!empty($binds)) {
$sql = self::merge($sql, $binds);
}
// secure against wild update/delete statements
if (preg_match('{^(UPDATE|DELETE)\s}', $sql) && preg_match('{\s(WHERE|LIMIT)\s}', $sql) == false) {
$exception = bootstrap::get_library('exception');
th... | [
"public",
"static",
"function",
"query",
"(",
"$",
"sql",
",",
"$",
"binds",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"binds",
")",
")",
"{",
"$",
"sql",
"=",
"self",
"::",
"merge",
"(",
"$",
"sql",
",",
"$",
"binds",
")",
";... | executes any query on the database
protects against unsafe UPDATE or DELETE statements
blocks when they don't contain a WHERE or LIMIT clause
@param string $sql the base sql statement
@param array $binds bind values for the given sql, @see ::merge()
@return mysqli_result | [
"executes",
"any",
"query",
"on",
"the",
"database"
] | train | https://github.com/lode/fem/blob/c1c466c1a904d99452b341c5ae7cbc3e22b106e1/src/mysql.php#L111-L123 |
lode/fem | src/mysql.php | mysql.raw | public static function raw($sql) {
$exception = bootstrap::get_library('exception');
$response = bootstrap::get_library('response');
if (is_null(self::$connection)) {
throw new $exception('no db connection', $response::STATUS_SERVICE_UNAVAILABLE);
}
$result = self::$connection->query($sql);
self::$error_... | php | public static function raw($sql) {
$exception = bootstrap::get_library('exception');
$response = bootstrap::get_library('response');
if (is_null(self::$connection)) {
throw new $exception('no db connection', $response::STATUS_SERVICE_UNAVAILABLE);
}
$result = self::$connection->query($sql);
self::$error_... | [
"public",
"static",
"function",
"raw",
"(",
"$",
"sql",
")",
"{",
"$",
"exception",
"=",
"bootstrap",
"::",
"get_library",
"(",
"'exception'",
")",
";",
"$",
"response",
"=",
"bootstrap",
"::",
"get_library",
"(",
"'response'",
")",
";",
"if",
"(",
"is_n... | executes a query on the database
similar to ::query(), except nothing is modified or checked anymore
@param string $sql
@return mysqli_result | [
"executes",
"a",
"query",
"on",
"the",
"database",
"similar",
"to",
"::",
"query",
"()",
"except",
"nothing",
"is",
"modified",
"or",
"checked",
"anymore"
] | train | https://github.com/lode/fem/blob/c1c466c1a904d99452b341c5ae7cbc3e22b106e1/src/mysql.php#L132-L155 |
lode/fem | src/mysql.php | mysql.get_config | protected static function get_config() {
if (getenv('APP_MYSQL')) {
$config = parse_url(getenv('APP_MYSQL'));
// strip of the leading slash
$config['name'] = substr($config['path'], 1);
// cleanup
unset($config['scheme']);
unset($config['path']);
}
else {
$config_file = \alsvanzelf\fem\ROOT_DIR.'... | php | protected static function get_config() {
if (getenv('APP_MYSQL')) {
$config = parse_url(getenv('APP_MYSQL'));
// strip of the leading slash
$config['name'] = substr($config['path'], 1);
// cleanup
unset($config['scheme']);
unset($config['path']);
}
else {
$config_file = \alsvanzelf\fem\ROOT_DIR.'... | [
"protected",
"static",
"function",
"get_config",
"(",
")",
"{",
"if",
"(",
"getenv",
"(",
"'APP_MYSQL'",
")",
")",
"{",
"$",
"config",
"=",
"parse_url",
"(",
"getenv",
"(",
"'APP_MYSQL'",
")",
")",
";",
"// strip of the leading slash",
"$",
"config",
"[",
... | collects the config for connecting from:
- an environment variable `APP_MYSQL`
- a `config/mysql.ini` file
@note in the ini file, the password is expected to be in a base64 encoded format
to help against shoulder surfing
@return array with 'host', 'user', 'pass', 'name', 'port' values | [
"collects",
"the",
"config",
"for",
"connecting",
"from",
":",
"-",
"an",
"environment",
"variable",
"APP_MYSQL",
"-",
"a",
"config",
"/",
"mysql",
".",
"ini",
"file"
] | train | https://github.com/lode/fem/blob/c1c466c1a904d99452b341c5ae7cbc3e22b106e1/src/mysql.php#L167-L200 |
lode/fem | src/mysql.php | mysql.merge | private static function merge($sql, $binds) {
if (is_array($binds) == false) {
$binds = (array)$binds;
}
if (is_null(self::$connection)) {
$exception = bootstrap::get_library('exception');
$response = bootstrap::get_library('response');
throw new $exception('no db connection', $response::STATUS_SERVICE_UNAV... | php | private static function merge($sql, $binds) {
if (is_array($binds) == false) {
$binds = (array)$binds;
}
if (is_null(self::$connection)) {
$exception = bootstrap::get_library('exception');
$response = bootstrap::get_library('response');
throw new $exception('no db connection', $response::STATUS_SERVICE_UNAV... | [
"private",
"static",
"function",
"merge",
"(",
"$",
"sql",
",",
"$",
"binds",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"binds",
")",
"==",
"false",
")",
"{",
"$",
"binds",
"=",
"(",
"array",
")",
"$",
"binds",
";",
"}",
"if",
"(",
"is_null",
... | merges bind values while escaping them
$sql can contain printf conversion specifications, i.e.:
- SELECT * WHERE `foo` = '%s';
- SELECT * WHERE `foo` > %d;
@param string $sql the base sql statement
@param array $binds bind values for the given sql
@return string input sql merged with bind values | [
"merges",
"bind",
"values",
"while",
"escaping",
"them"
] | train | https://github.com/lode/fem/blob/c1c466c1a904d99452b341c5ae7cbc3e22b106e1/src/mysql.php#L213-L228 |
webforge-labs/psc-cms | lib/Psc/Graph/Graph.php | Graph.add | public function add(Vertice $u, Vertice $v = NULL) {
/* wichtig hier ist dass wir nicht nur $this->addV($u) machen sondern auch die
zurückgegebene reference für E->add() benutzen
da sonst der Parameter zu E hinzugefügt wird, der nicht zwingend identisch mit der
gespeicherten Vertice sein muss... | php | public function add(Vertice $u, Vertice $v = NULL) {
/* wichtig hier ist dass wir nicht nur $this->addV($u) machen sondern auch die
zurückgegebene reference für E->add() benutzen
da sonst der Parameter zu E hinzugefügt wird, der nicht zwingend identisch mit der
gespeicherten Vertice sein muss... | [
"public",
"function",
"add",
"(",
"Vertice",
"$",
"u",
",",
"Vertice",
"$",
"v",
"=",
"NULL",
")",
"{",
"/* wichtig hier ist dass wir nicht nur $this->addV($u) machen sondern auch die\n zurückgegebene reference für E->add() benutzen\n da sonst der Parameter zu E hinzugefügt w... | Fügt Knoten/Kanten dem Graphen hinzu
Sind $u und $v nicht im Graphen enthalten, werden sie hinzugefügt.
Sind beide Parameter übergeben wird zusätzlich eine Kante von $u nach $v hinzugefügt
@param Vertice $u
@param Vertice $v ist $v gesetzt wird eine Kante zwischen $u und $v hinzugefügt. | [
"Fügt",
"Knoten",
"/",
"Kanten",
"dem",
"Graphen",
"hinzu"
] | train | https://github.com/webforge-labs/psc-cms/blob/467bfa2547e6b4fa487d2d7f35fa6cc618dbc763/lib/Psc/Graph/Graph.php#L64-L79 |
webforge-labs/psc-cms | lib/Psc/Graph/Graph.php | Graph.addV | public function addV(Vertice $u) {
if (!array_key_exists($u->label,$this->V))
$this->V[$u->label] =& $u;
return $this->V[$u->label];
} | php | public function addV(Vertice $u) {
if (!array_key_exists($u->label,$this->V))
$this->V[$u->label] =& $u;
return $this->V[$u->label];
} | [
"public",
"function",
"addV",
"(",
"Vertice",
"$",
"u",
")",
"{",
"if",
"(",
"!",
"array_key_exists",
"(",
"$",
"u",
"->",
"label",
",",
"$",
"this",
"->",
"V",
")",
")",
"$",
"this",
"->",
"V",
"[",
"$",
"u",
"->",
"label",
"]",
"=",
"&",
"$... | Fügt dem Graphen einen Knoten hinzu
@return Vertice gibt die eingefügte Vertice zurück | [
"Fügt",
"dem",
"Graphen",
"einen",
"Knoten",
"hinzu"
] | train | https://github.com/webforge-labs/psc-cms/blob/467bfa2547e6b4fa487d2d7f35fa6cc618dbc763/lib/Psc/Graph/Graph.php#L86-L91 |
webforge-labs/psc-cms | lib/Psc/Graph/Graph.php | Graph.remove | public function remove(Vertice $u, Vertice $v = NULL) {
if (!isset($v)) {
$this->E->erase($v); // entferne alle Kanten
$this->remove($v); // entferne den Knoten
} else {
$this->E->remove($u,$v); // entferne die Kante
}
return $this;
} | php | public function remove(Vertice $u, Vertice $v = NULL) {
if (!isset($v)) {
$this->E->erase($v); // entferne alle Kanten
$this->remove($v); // entferne den Knoten
} else {
$this->E->remove($u,$v); // entferne die Kante
}
return $this;
} | [
"public",
"function",
"remove",
"(",
"Vertice",
"$",
"u",
",",
"Vertice",
"$",
"v",
"=",
"NULL",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"v",
")",
")",
"{",
"$",
"this",
"->",
"E",
"->",
"erase",
"(",
"$",
"v",
")",
";",
"// entferne alle ... | Entfernt einen Knoten/eine Kante aus dem Graphen
@param Vertice $v ist $v gesetzt wird eine Kante zwischen $u und $v entfernt. | [
"Entfernt",
"einen",
"Knoten",
"/",
"eine",
"Kante",
"aus",
"dem",
"Graphen"
] | train | https://github.com/webforge-labs/psc-cms/blob/467bfa2547e6b4fa487d2d7f35fa6cc618dbc763/lib/Psc/Graph/Graph.php#L98-L106 |
webforge-labs/psc-cms | lib/Psc/Graph/Graph.php | Graph.get | public function get($input) {
if ($input instanceof Vertice && $this->has($input)) {
return $this->V[$input->label];
} elseif (array_key_exists($input, $this->V)) {
return $this->V[$input];
} else {
return NULL;
}
} | php | public function get($input) {
if ($input instanceof Vertice && $this->has($input)) {
return $this->V[$input->label];
} elseif (array_key_exists($input, $this->V)) {
return $this->V[$input];
} else {
return NULL;
}
} | [
"public",
"function",
"get",
"(",
"$",
"input",
")",
"{",
"if",
"(",
"$",
"input",
"instanceof",
"Vertice",
"&&",
"$",
"this",
"->",
"has",
"(",
"$",
"input",
")",
")",
"{",
"return",
"$",
"this",
"->",
"V",
"[",
"$",
"input",
"->",
"label",
"]",... | Gibt einen Knoten des Graphen zurück
@return Vertice | [
"Gibt",
"einen",
"Knoten",
"des",
"Graphen",
"zurück"
] | train | https://github.com/webforge-labs/psc-cms/blob/467bfa2547e6b4fa487d2d7f35fa6cc618dbc763/lib/Psc/Graph/Graph.php#L123-L131 |
shi-yang/yii2-masonry | Masonry.php | Masonry.registerPlugin | protected function registerPlugin()
{
$id = $this->options['id'];
//get the displayed view and register the needed assets
$view = $this->getView();
MasonryAsset::register($view);
ImagesLoadedAsset::register($view);
$js = [];
$js[] = "var mscontainer$id = $('... | php | protected function registerPlugin()
{
$id = $this->options['id'];
//get the displayed view and register the needed assets
$view = $this->getView();
MasonryAsset::register($view);
ImagesLoadedAsset::register($view);
$js = [];
$js[] = "var mscontainer$id = $('... | [
"protected",
"function",
"registerPlugin",
"(",
")",
"{",
"$",
"id",
"=",
"$",
"this",
"->",
"options",
"[",
"'id'",
"]",
";",
"//get the displayed view and register the needed assets",
"$",
"view",
"=",
"$",
"this",
"->",
"getView",
"(",
")",
";",
"MasonryAss... | Registers the widget and the related events | [
"Registers",
"the",
"widget",
"and",
"the",
"related",
"events"
] | train | https://github.com/shi-yang/yii2-masonry/blob/7f50f65325af9d7e3a24eb20b99594ed4df14b44/Masonry.php#L73-L87 |
Sedona-Solutions/sedona-sbo | src/Sedona/SBOGeneratorBundle/Generator/DoctrineTranslationGenerator.php | DoctrineTranslationGenerator.generate | public function generate(BundleInterface $bundle, $entity, ClassMetadataInfo $metadata, $forceOverwrite)
{
$parts = explode('\\', $entity);
$entityClass = array_pop($parts);
$langs = ['fr', 'en'];
$this->className = $entityClass.'Type';
$dirPath = $bundle->getPath().'/Resou... | php | public function generate(BundleInterface $bundle, $entity, ClassMetadataInfo $metadata, $forceOverwrite)
{
$parts = explode('\\', $entity);
$entityClass = array_pop($parts);
$langs = ['fr', 'en'];
$this->className = $entityClass.'Type';
$dirPath = $bundle->getPath().'/Resou... | [
"public",
"function",
"generate",
"(",
"BundleInterface",
"$",
"bundle",
",",
"$",
"entity",
",",
"ClassMetadataInfo",
"$",
"metadata",
",",
"$",
"forceOverwrite",
")",
"{",
"$",
"parts",
"=",
"explode",
"(",
"'\\\\'",
",",
"$",
"entity",
")",
";",
"$",
... | Generates the entity form class if it does not exist.
@param BundleInterface $bundle The bundle in which to create the class
@param string $entity The entity relative class name
@param ClassMetadataInfo $metadata The entity metadata class | [
"Generates",
"the",
"entity",
"form",
"class",
"if",
"it",
"does",
"not",
"exist",
"."
] | train | https://github.com/Sedona-Solutions/sedona-sbo/blob/8548be4170d191cb1a3e263577aaaab49f04d5ce/src/Sedona/SBOGeneratorBundle/Generator/DoctrineTranslationGenerator.php#L54-L100 |
ClanCats/Core | src/bundles/Database/Query/Insert.php | Query_Insert.values | public function values( array $values )
{
// do nothing if we get nothing
if ( empty( $values ) )
{
return $this;
}
// check if the the passed array is a collection.
// because we want to be able to insert bulk values.
if ( !\CCArr::is_collection( $values ) )
{
$values = array( $values );
}
... | php | public function values( array $values )
{
// do nothing if we get nothing
if ( empty( $values ) )
{
return $this;
}
// check if the the passed array is a collection.
// because we want to be able to insert bulk values.
if ( !\CCArr::is_collection( $values ) )
{
$values = array( $values );
}
... | [
"public",
"function",
"values",
"(",
"array",
"$",
"values",
")",
"{",
"// do nothing if we get nothing",
"if",
"(",
"empty",
"(",
"$",
"values",
")",
")",
"{",
"return",
"$",
"this",
";",
"}",
"// check if the the passed array is a collection.",
"// because we want... | Add values to the insert
@param array $values
@return void | [
"Add",
"values",
"to",
"the",
"insert"
] | train | https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/bundles/Database/Query/Insert.php#L45-L72 |
meccado/acl-admin-control-panel | src/Http/Controllers/Admin/MenuController.php | MenuController.index | public function index()
{
if ( \Auth::user()->roles[0]->can('menu-read' ) ) {
$items = $this->menus->with('roles')
->where('parent_id', '=', '0')
->orderBy('sort_order', 'ASC')->get();
return \View::make('acl::admin.menus.index', [
'items' => $items,
'title' => 'list',... | php | public function index()
{
if ( \Auth::user()->roles[0]->can('menu-read' ) ) {
$items = $this->menus->with('roles')
->where('parent_id', '=', '0')
->orderBy('sort_order', 'ASC')->get();
return \View::make('acl::admin.menus.index', [
'items' => $items,
'title' => 'list',... | [
"public",
"function",
"index",
"(",
")",
"{",
"if",
"(",
"\\",
"Auth",
"::",
"user",
"(",
")",
"->",
"roles",
"[",
"0",
"]",
"->",
"can",
"(",
"'menu-read'",
")",
")",
"{",
"$",
"items",
"=",
"$",
"this",
"->",
"menus",
"->",
"with",
"(",
"'rol... | Display a listing of the resource.
@return \Illuminate\Http\Response | [
"Display",
"a",
"listing",
"of",
"the",
"resource",
"."
] | train | https://github.com/meccado/acl-admin-control-panel/blob/50ac4c0dbf8bd49944ecad6a70708a70411b7378/src/Http/Controllers/Admin/MenuController.php#L31-L43 |
meccado/acl-admin-control-panel | src/Http/Controllers/Admin/MenuController.php | MenuController.create | public function create()
{
if ( \Auth::user()->roles[0]->can('menu-create' ) ) {
$items = $this->menus->pluck('name', 'id')->toarray();
$roles = Role::pluck('name', 'id')->toarray();
$selected = [];
return \View::make('acl::admin.menus.create', [
'items' => $items,
'rol... | php | public function create()
{
if ( \Auth::user()->roles[0]->can('menu-create' ) ) {
$items = $this->menus->pluck('name', 'id')->toarray();
$roles = Role::pluck('name', 'id')->toarray();
$selected = [];
return \View::make('acl::admin.menus.create', [
'items' => $items,
'rol... | [
"public",
"function",
"create",
"(",
")",
"{",
"if",
"(",
"\\",
"Auth",
"::",
"user",
"(",
")",
"->",
"roles",
"[",
"0",
"]",
"->",
"can",
"(",
"'menu-create'",
")",
")",
"{",
"$",
"items",
"=",
"$",
"this",
"->",
"menus",
"->",
"pluck",
"(",
"... | Show the form for creating a new resource.
@return \Illuminate\Http\Response | [
"Show",
"the",
"form",
"for",
"creating",
"a",
"new",
"resource",
"."
] | train | https://github.com/meccado/acl-admin-control-panel/blob/50ac4c0dbf8bd49944ecad6a70708a70411b7378/src/Http/Controllers/Admin/MenuController.php#L50-L64 |
meccado/acl-admin-control-panel | src/Http/Controllers/Admin/MenuController.php | MenuController.show | public function show($id)
{
if ( \Auth::user()->roles[0]->can('menu-read' ) ) {
$menu = $this->menus->findOrFail($id);
return view('admin.menus.show', compact('menu'));
}
return \Redirect::route('admin.menus.index')->withErrors(trans('acl::dashboard.unauthorized_access'));
} | php | public function show($id)
{
if ( \Auth::user()->roles[0]->can('menu-read' ) ) {
$menu = $this->menus->findOrFail($id);
return view('admin.menus.show', compact('menu'));
}
return \Redirect::route('admin.menus.index')->withErrors(trans('acl::dashboard.unauthorized_access'));
} | [
"public",
"function",
"show",
"(",
"$",
"id",
")",
"{",
"if",
"(",
"\\",
"Auth",
"::",
"user",
"(",
")",
"->",
"roles",
"[",
"0",
"]",
"->",
"can",
"(",
"'menu-read'",
")",
")",
"{",
"$",
"menu",
"=",
"$",
"this",
"->",
"menus",
"->",
"findOrFa... | Display the specified resource.
@param int $id
@return \Illuminate\Http\Response | [
"Display",
"the",
"specified",
"resource",
"."
] | train | https://github.com/meccado/acl-admin-control-panel/blob/50ac4c0dbf8bd49944ecad6a70708a70411b7378/src/Http/Controllers/Admin/MenuController.php#L95-L102 |
meccado/acl-admin-control-panel | src/Http/Controllers/Admin/MenuController.php | MenuController.edit | public function edit($id)
{
if ( \Auth::user()->roles[0]->can('menu-update' ) ) {
$menu = $this->menus->findOrFail($id);
$items = $this->menus->pluck('name', 'id')->toarray();
$roles = Role::lists('name', 'id')->toarray();
$selected = $menu->roles->pluck('id')->toarray();
... | php | public function edit($id)
{
if ( \Auth::user()->roles[0]->can('menu-update' ) ) {
$menu = $this->menus->findOrFail($id);
$items = $this->menus->pluck('name', 'id')->toarray();
$roles = Role::lists('name', 'id')->toarray();
$selected = $menu->roles->pluck('id')->toarray();
... | [
"public",
"function",
"edit",
"(",
"$",
"id",
")",
"{",
"if",
"(",
"\\",
"Auth",
"::",
"user",
"(",
")",
"->",
"roles",
"[",
"0",
"]",
"->",
"can",
"(",
"'menu-update'",
")",
")",
"{",
"$",
"menu",
"=",
"$",
"this",
"->",
"menus",
"->",
"findOr... | Show the form for editing the specified resource.
@param int $id
@return \Illuminate\Http\Response | [
"Show",
"the",
"form",
"for",
"editing",
"the",
"specified",
"resource",
"."
] | train | https://github.com/meccado/acl-admin-control-panel/blob/50ac4c0dbf8bd49944ecad6a70708a70411b7378/src/Http/Controllers/Admin/MenuController.php#L110-L121 |
meccado/acl-admin-control-panel | src/Http/Controllers/Admin/MenuController.php | MenuController.update | public function update(Request $request, $id)
{
if ( \Auth::user()->roles[0]->can('menu-update' ) ) {
$input = $request->all();
$input['url'] = "admin/".str_plural(Str::lower($input['name'] != 'Dashboard' ? $string=str_replace(" ","_", $input['name']) : ''));
$menu = $this->menus->find... | php | public function update(Request $request, $id)
{
if ( \Auth::user()->roles[0]->can('menu-update' ) ) {
$input = $request->all();
$input['url'] = "admin/".str_plural(Str::lower($input['name'] != 'Dashboard' ? $string=str_replace(" ","_", $input['name']) : ''));
$menu = $this->menus->find... | [
"public",
"function",
"update",
"(",
"Request",
"$",
"request",
",",
"$",
"id",
")",
"{",
"if",
"(",
"\\",
"Auth",
"::",
"user",
"(",
")",
"->",
"roles",
"[",
"0",
"]",
"->",
"can",
"(",
"'menu-update'",
")",
")",
"{",
"$",
"input",
"=",
"$",
"... | Update the specified resource in storage.
@param \Illuminate\Http\Request $request
@param int $id
@return \Illuminate\Http\Response | [
"Update",
"the",
"specified",
"resource",
"in",
"storage",
"."
] | train | https://github.com/meccado/acl-admin-control-panel/blob/50ac4c0dbf8bd49944ecad6a70708a70411b7378/src/Http/Controllers/Admin/MenuController.php#L130-L147 |
meccado/acl-admin-control-panel | src/Http/Controllers/Admin/MenuController.php | MenuController.destroy | public function destroy($id)
{
if ( \Auth::user()->roles[0]->can('menu-delete' ) ) {
$this->menus->findOrFail($id)->delete();
return \Redirect::route('admin.menus.index', [
])->withMessage(trans('acl::menu.menus-controller-successfully_deleted'));
}
retu... | php | public function destroy($id)
{
if ( \Auth::user()->roles[0]->can('menu-delete' ) ) {
$this->menus->findOrFail($id)->delete();
return \Redirect::route('admin.menus.index', [
])->withMessage(trans('acl::menu.menus-controller-successfully_deleted'));
}
retu... | [
"public",
"function",
"destroy",
"(",
"$",
"id",
")",
"{",
"if",
"(",
"\\",
"Auth",
"::",
"user",
"(",
")",
"->",
"roles",
"[",
"0",
"]",
"->",
"can",
"(",
"'menu-delete'",
")",
")",
"{",
"$",
"this",
"->",
"menus",
"->",
"findOrFail",
"(",
"$",
... | Remove the specified resource from storage.
@param int $id
@return \Illuminate\Http\Response | [
"Remove",
"the",
"specified",
"resource",
"from",
"storage",
"."
] | train | https://github.com/meccado/acl-admin-control-panel/blob/50ac4c0dbf8bd49944ecad6a70708a70411b7378/src/Http/Controllers/Admin/MenuController.php#L155-L163 |
joomlatools/joomlatools-platform-legacy | code/error/error.php | JError.getError | public static function getError($unset = false)
{
JLog::add('JError::getError() is deprecated.', JLog::WARNING, 'deprecated');
if (!isset(self::$stack[0]))
{
return false;
}
if ($unset)
{
$error = array_shift(self::$stack);
}
else
{
$error = &self::$stack[0];
}
return $error;
} | php | public static function getError($unset = false)
{
JLog::add('JError::getError() is deprecated.', JLog::WARNING, 'deprecated');
if (!isset(self::$stack[0]))
{
return false;
}
if ($unset)
{
$error = array_shift(self::$stack);
}
else
{
$error = &self::$stack[0];
}
return $error;
} | [
"public",
"static",
"function",
"getError",
"(",
"$",
"unset",
"=",
"false",
")",
"{",
"JLog",
"::",
"add",
"(",
"'JError::getError() is deprecated.'",
",",
"JLog",
"::",
"WARNING",
",",
"'deprecated'",
")",
";",
"if",
"(",
"!",
"isset",
"(",
"self",
"::",... | Method for retrieving the last exception object in the error stack
@param boolean $unset True to remove the error from the stack.
@return JException|boolean Last JException object in the error stack or boolean false if none exist
@deprecated 12.1
@since 11.1 | [
"Method",
"for",
"retrieving",
"the",
"last",
"exception",
"object",
"in",
"the",
"error",
"stack"
] | train | https://github.com/joomlatools/joomlatools-platform-legacy/blob/3a76944e2f2c415faa6504754c75321a3b478c06/code/error/error.php#L123-L142 |
joomlatools/joomlatools-platform-legacy | code/error/error.php | JError.addToStack | public static function addToStack(JException &$e)
{
JLog::add('JError::addToStack() is deprecated.', JLog::WARNING, 'deprecated');
self::$stack[] = &$e;
} | php | public static function addToStack(JException &$e)
{
JLog::add('JError::addToStack() is deprecated.', JLog::WARNING, 'deprecated');
self::$stack[] = &$e;
} | [
"public",
"static",
"function",
"addToStack",
"(",
"JException",
"&",
"$",
"e",
")",
"{",
"JLog",
"::",
"add",
"(",
"'JError::addToStack() is deprecated.'",
",",
"JLog",
"::",
"WARNING",
",",
"'deprecated'",
")",
";",
"self",
"::",
"$",
"stack",
"[",
"]",
... | Method to add non-JError thrown JExceptions to the JError stack for debugging purposes
@param JException &$e Add an exception to the stack.
@return void
@since 11.1
@deprecated 12.1 | [
"Method",
"to",
"add",
"non",
"-",
"JError",
"thrown",
"JExceptions",
"to",
"the",
"JError",
"stack",
"for",
"debugging",
"purposes"
] | train | https://github.com/joomlatools/joomlatools-platform-legacy/blob/3a76944e2f2c415faa6504754c75321a3b478c06/code/error/error.php#L169-L174 |
joomlatools/joomlatools-platform-legacy | code/error/error.php | JError.raise | public static function raise($level, $code, $msg, $info = null, $backtrace = false)
{
JLog::add('JError::raise() is deprecated.', JLog::WARNING, 'deprecated');
// Build error object
$class = $code == 404 ? 'JExceptionNotFound' : 'JException';
$exception = new $class($msg, $code, $level, $info, $backtrace)... | php | public static function raise($level, $code, $msg, $info = null, $backtrace = false)
{
JLog::add('JError::raise() is deprecated.', JLog::WARNING, 'deprecated');
// Build error object
$class = $code == 404 ? 'JExceptionNotFound' : 'JException';
$exception = new $class($msg, $code, $level, $info, $backtrace)... | [
"public",
"static",
"function",
"raise",
"(",
"$",
"level",
",",
"$",
"code",
",",
"$",
"msg",
",",
"$",
"info",
"=",
"null",
",",
"$",
"backtrace",
"=",
"false",
")",
"{",
"JLog",
"::",
"add",
"(",
"'JError::raise() is deprecated.'",
",",
"JLog",
"::"... | Create a new JException object given the passed arguments
@param integer $level The error level - use any of PHP's own error levels for
this: E_ERROR, E_WARNING, E_NOTICE, E_USER_ERROR,
E_USER_WARNING, E_USER_NOTICE.
@param string $code The application-internal error code for this error
@param stri... | [
"Create",
"a",
"new",
"JException",
"object",
"given",
"the",
"passed",
"arguments"
] | train | https://github.com/joomlatools/joomlatools-platform-legacy/blob/3a76944e2f2c415faa6504754c75321a3b478c06/code/error/error.php#L195-L204 |
joomlatools/joomlatools-platform-legacy | code/error/error.php | JError.throwError | public static function throwError(&$exception)
{
JLog::add('JError::throwError() is deprecated.', JLog::WARNING, 'deprecated');
static $thrown = false;
// If thrown is hit again, we've come back to JError in the middle of throwing another JError, so die!
if ($thrown)
{
self::handleEcho($exception, array... | php | public static function throwError(&$exception)
{
JLog::add('JError::throwError() is deprecated.', JLog::WARNING, 'deprecated');
static $thrown = false;
// If thrown is hit again, we've come back to JError in the middle of throwing another JError, so die!
if ($thrown)
{
self::handleEcho($exception, array... | [
"public",
"static",
"function",
"throwError",
"(",
"&",
"$",
"exception",
")",
"{",
"JLog",
"::",
"add",
"(",
"'JError::throwError() is deprecated.'",
",",
"JLog",
"::",
"WARNING",
",",
"'deprecated'",
")",
";",
"static",
"$",
"thrown",
"=",
"false",
";",
"/... | Throw an error
@param JException &$exception An exception to throw.
@return JException A reference to the handled JException object
@deprecated 12.1 Use PHP Exception
@see JException
@since 11.1 | [
"Throw",
"an",
"error"
] | train | https://github.com/joomlatools/joomlatools-platform-legacy/blob/3a76944e2f2c415faa6504754c75321a3b478c06/code/error/error.php#L217-L257 |
joomlatools/joomlatools-platform-legacy | code/error/error.php | JError.raiseError | public static function raiseError($code, $msg, $info = null)
{
JLog::add('JError::raiseError() is deprecated.', JLog::WARNING, 'deprecated');
return self::raise(E_ERROR, $code, $msg, $info, true);
} | php | public static function raiseError($code, $msg, $info = null)
{
JLog::add('JError::raiseError() is deprecated.', JLog::WARNING, 'deprecated');
return self::raise(E_ERROR, $code, $msg, $info, true);
} | [
"public",
"static",
"function",
"raiseError",
"(",
"$",
"code",
",",
"$",
"msg",
",",
"$",
"info",
"=",
"null",
")",
"{",
"JLog",
"::",
"add",
"(",
"'JError::raiseError() is deprecated.'",
",",
"JLog",
"::",
"WARNING",
",",
"'deprecated'",
")",
";",
"retur... | Wrapper method for the raise() method with predefined error level of E_ERROR and backtrace set to true.
@param string $code The application-internal error code for this error
@param string $msg The error message, which may also be shown the user if need be.
@param mixed $info Optional: Additional error i... | [
"Wrapper",
"method",
"for",
"the",
"raise",
"()",
"method",
"with",
"predefined",
"error",
"level",
"of",
"E_ERROR",
"and",
"backtrace",
"set",
"to",
"true",
"."
] | train | https://github.com/joomlatools/joomlatools-platform-legacy/blob/3a76944e2f2c415faa6504754c75321a3b478c06/code/error/error.php#L274-L279 |
joomlatools/joomlatools-platform-legacy | code/error/error.php | JError.raiseWarning | public static function raiseWarning($code, $msg, $info = null)
{
JLog::add('JError::raiseWarning() is deprecated.', JLog::WARNING, 'deprecated');
return self::raise(E_WARNING, $code, $msg, $info);
} | php | public static function raiseWarning($code, $msg, $info = null)
{
JLog::add('JError::raiseWarning() is deprecated.', JLog::WARNING, 'deprecated');
return self::raise(E_WARNING, $code, $msg, $info);
} | [
"public",
"static",
"function",
"raiseWarning",
"(",
"$",
"code",
",",
"$",
"msg",
",",
"$",
"info",
"=",
"null",
")",
"{",
"JLog",
"::",
"add",
"(",
"'JError::raiseWarning() is deprecated.'",
",",
"JLog",
"::",
"WARNING",
",",
"'deprecated'",
")",
";",
"r... | Wrapper method for the {@link raise()} method with predefined error level of E_WARNING and backtrace set to false.
@param string $code The application-internal error code for this error
@param string $msg The error message, which may also be shown the user if need be.
@param mixed $info Optional: Additio... | [
"Wrapper",
"method",
"for",
"the",
"{",
"@link",
"raise",
"()",
"}",
"method",
"with",
"predefined",
"error",
"level",
"of",
"E_WARNING",
"and",
"backtrace",
"set",
"to",
"false",
"."
] | train | https://github.com/joomlatools/joomlatools-platform-legacy/blob/3a76944e2f2c415faa6504754c75321a3b478c06/code/error/error.php#L296-L301 |
joomlatools/joomlatools-platform-legacy | code/error/error.php | JError.raiseNotice | public static function raiseNotice($code, $msg, $info = null)
{
JLog::add('JError::raiseNotice() is deprecated.', JLog::WARNING, 'deprecated');
return self::raise(E_NOTICE, $code, $msg, $info);
} | php | public static function raiseNotice($code, $msg, $info = null)
{
JLog::add('JError::raiseNotice() is deprecated.', JLog::WARNING, 'deprecated');
return self::raise(E_NOTICE, $code, $msg, $info);
} | [
"public",
"static",
"function",
"raiseNotice",
"(",
"$",
"code",
",",
"$",
"msg",
",",
"$",
"info",
"=",
"null",
")",
"{",
"JLog",
"::",
"add",
"(",
"'JError::raiseNotice() is deprecated.'",
",",
"JLog",
"::",
"WARNING",
",",
"'deprecated'",
")",
";",
"ret... | Wrapper method for the {@link raise()} method with predefined error level of E_NOTICE and backtrace set to false.
@param string $code The application-internal error code for this error
@param string $msg The error message, which may also be shown the user if need be.
@param mixed $info Optional: Addition... | [
"Wrapper",
"method",
"for",
"the",
"{",
"@link",
"raise",
"()",
"}",
"method",
"with",
"predefined",
"error",
"level",
"of",
"E_NOTICE",
"and",
"backtrace",
"set",
"to",
"false",
"."
] | train | https://github.com/joomlatools/joomlatools-platform-legacy/blob/3a76944e2f2c415faa6504754c75321a3b478c06/code/error/error.php#L318-L323 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.