コード例 #1
0
</head>

<body>
<h1>Interactive Decision Tree - Editor</h1>
<div id="debug"></div>
<?php 
switch ($cmd) {
    case 'edit-tree':
    case 'new-tree':
        showTreeForm($tree, $revision);
        if (!empty($tree->treeID)) {
            $tree->overview();
        }
        break;
    case 'save-tree':
        saveTree($tree, $revision);
        showTreeForm($tree, $revision);
        $tree->overview();
        break;
    case 'save-branch':
        saveBranch($tree);
        $tree->saveData();
        showTreeForm($tree, $revision);
        $tree->overview();
        break;
    case 'edit-branch':
    case 'new-branch':
        showBranchForm($tree, $branchID);
        break;
    default:
        showList($tree);
コード例 #2
0
ファイル: analyzer.php プロジェクト: pekand/grep
function scanPHP(&$paths, $db, $printStatus = false)
{
    foreach ($paths as $key => $value) {
        if ($value['ext'] == 'php') {
            $path = $value['path'];
            if (insertFile($db, $path)) {
                cleanElement($db, $path);
                if ($printStatus) {
                    echo "SCAN " . $path . PHP_EOL;
                }
                $path_parts = pathinfo($path);
                insertElement($db, $path, $path_parts['filename'], $path_parts['extension'], "", 'file', 0);
                $content = file_get_contents($path);
                $tokens = token_get_all($content);
                /*if($path  == '/var/www/src/grep/test.php')
                       	{
                        	echo "<pre>";
                        	var_dump($tokens);
                			echo "</pre>";
                		}*/
                $tree = array();
                scanTree($tree, $tokens, 0);
                /*if($path  == '/var/www/src/grep/test.php')
                       	{
                			echo "<pre>";
                        	var_dump($tree);
                			echo "</pre>";
                		}*/
                saveTree($tree, $tokens, $path, $db);
            } else {
                if ($printStatus) {
                    echo "SKIP " . $path . PHP_EOL;
                }
            }
        }
    }
}