本文整理汇总了PHP中tree::insert方法的典型用法代码示例。如果您正苦于以下问题:PHP tree::insert方法的具体用法?PHP tree::insert怎么用?PHP tree::insert使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类tree
的用法示例。
在下文中一共展示了tree::insert方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: tree
public function tree()
{
$git = new Git();
$repositories = new repositories($this->getDb());
$tree = new tree($this->getDb());
//$tree_data=$tree->delete();
//$repo_name = 'gitosis-admin';
$all_repos = $repositories->select('*');
//$repo_tree = $git->git_tree($repo_name);
//$repo_tree = $git->git_tree();
/*foreach($repo_tree as $repo_tree_term)
{
$tree->insert($repo_tree_term);
}*/
foreach ($all_repos as $repo) {
display($repo);
$repo_name = isset($repo['name']) ? $repo['name'] : false;
if ($repo_name) {
$repo_trees = $git->git_tree($repo_name);
display($repo_trees);
if (count($repo_trees) > 0) {
foreach ($repo_trees as $tree_term) {
if (isset($tree_term['repo']) && isset($tree_term['commit']) && $tree_term['repo'] != '' && $tree_term['commit'] != '') {
$old_data = $tree->select('*', 'WHERE repo="' . $tree_term['repo'] . '" AND commit="' . $tree_term['commit'] . '"');
if (!isset($old_data[0]['id'])) {
$tree->insert($tree_term);
}
}
}
}
}
}
}