Work continues.
Been doing a bit more work on www.ather-tech.net/refactor (UPDATE: 2.0 went live, link is now broken) as of late, for the most part the Class is “Method-Complete” although that may change. All that remains now is to clean up the code, and bugfix up to a final version (2.0.0).
On the Index side of things, the code is a tad more complex than the basic example I demonstrated previously:
< ?php
include('refactor_test.php');
$AthList = new AthList($_GET["path"]);
$AthList->SetExclude(".,..,error_log");
$list = $AthList->GetList(false);
$regex = array (
0 => "[\{FDATA\}]",
1 => "[\{VER\}]",
2 => "[\{FPATH\}]"
);
$replacement = array (
0 => $AthList->PrintList($list),
1 => $AthList->GetVersion(),
2 => $AthList->GetPath()
);
$file = fopen("markup.htm", "r");
$markup = fread($file, filesize("markup.htm"));
$markup = preg_replace($regex, $replacement, $markup);
fclose($file);
echo $markup;
?>
The extra code is just to load my markup (XHTML 1.0) file, and parse through with preg_replace() and two indexed arrays to insert the relevant data pulled from the class into the markup framework. I might look into integrating this functionality into the AthList class and providing two methods for both Basic and Rich output.
Any questions or suggestions are welcome.