Пример #1
0
            }
            if ($item == "." || $item == "..") {
                continue;
            }
            $fullfilename = realpath($path . "/" . $item);
            if (is_dir($fullfilename)) {
                $this->Run($fullfilename);
            } else {
                //echo ">>> $fullfilename <br/>\n";
                if ($this->IsSkip($fullfilename) == true) {
                    continue;
                }
                echo ">>> {$fullfilename} <br/>\n";
                $this->Route($fullfilename);
            }
        }
    }
    public function getStrings()
    {
        return $this->_strings;
    }
}
$Tool = new ToolsGetCNLine();
$Tool->Init(dirname(__FILE__) . "/result.txt");
$Tool->Run(dirname(__FILE__) . "/../..");
//$Tool->Route("/data/home/steven/public_html/miniwtm_dev/app/miniwtm/FileImport.php");
echo "<pre>Terry at [" . __FILE__ . "(line:" . __LINE__ . ")]\nWhen [Wed Aug 25 09:43:12 CST 2010] :\n ";
//var_dump( $Tool->getStrings() );
var_export($Tool->getStrings());
echo "</pre>";
exit;
Пример #2
0
        $handle = opendir($path);
        if ($handle == false) {
            echo ">>> Error: Open dir failed! <br/>\n";
            return false;
        }
        while (true) {
            $item = readdir($handle);
            if ($item == false) {
                break;
            }
            if ($item == "." || $item == "..") {
                continue;
            }
            $fullfilename = $path . "/" . $item;
            if (is_dir($fullfilename)) {
                $this->Run($fullfilename);
            } else {
                //echo ">>> $fullfilename <br/>\n";
                if ($this->IsSkip($fullfilename) == true) {
                    continue;
                }
                echo ">>> {$fullfilename} <br/>\n";
                $this->Route($fullfilename);
            }
        }
    }
}
$Tool = new ToolsGetCNLine();
$Tool->Init("/data/home/steven/public_html/result.txt");
$Tool->Run("/data/home/steven/public_html/miniwtm_dev");
//$Tool->Route("/data/home/steven/public_html/miniwtm_dev/app/miniwtm/FileImport.php");