Beispiel #1
0
    		{
    			echo "修改文件失败";
    		}
    	}
    	else 
    	{
    		echo "貌似不能使用修改功能";
    	}*/
}
//字符转换
function ubb($str)
{
    $str = str_replace("<", "&lt;", $str);
    $str = str_replace(">", "&gt;", $str);
    return $str;
}
//具体操作
if (!$action) {
    loadDir("..");
} elseif ($action == "edit") {
    readFiles($urlStr);
} elseif ($action == "doedit") {
    editFiles($urlStr);
} else {
    loadDir($fileName);
}
?>
</table>
</div>
</body>
</html>
//list of global variable
$connectionObj = '"connections":[';
$node_id = 0;
$node_x = 100;
$node_y = 100;
foreach ($_FILES['file']['name'] as $i => $name) {
    if ($_FILES['file']['error'][$i] == 4) {
        continue;
    }
    if ($_FILES['file']['error'][$i] == 0) {
        //$files[] = $_FILES["file"]["tmp_name"][$i];
        $files[$_FILES["file"]["name"][$i]] = $_FILES["file"]["tmp_name"][$i];
    }
}
foreach ($files as $file) {
    readFiles($file);
}
createJSONObject();
function readFiles($file)
{
    global $functionList;
    global $classList;
    global $globalVariable;
    $funct = NULL;
    $nbr_funct = 0;
    //number of function found
    $fh = fopen($file, 'r');
    while (!feof($fh)) {
        $line = fgets($fh);
        $line = preg_replace('/\\/{2}.*\\n*/', ' ', $line);
        //remove comment