I have been neglecting this blog for far too long, and now that I have some more thoughts I’d though I would sit down and write out an update.
Code-wise, alot has changed since the last post. I completed my refactor of AthList and then went onto AthLoad which was completed fairly quickly. After that I did some refresh work on the site homepage, feature additions to both AthList and AthLoad, and I completed a commissioned app for a friend of mine.
As of late however work has been slow, I’ve been plotting out a major rewrite of AthList and AthLoad, which involves essentially stripping out all code that is not related to the class’s specific functionality, this effort has generated a 3rd class, called AthLog (User Log-in handler, original naming eh?) which along with it’s sibling Ath- classes will make up a reusable class library called AthX. Although this is somewhat pushed to the side until my host updates to PHP 5.3.
Recently I’ve been working with n00berific on a project we affectionately call “Dumpass Chat” (Don’t ask) which is coming along nicely. noob is handling the JScript aspect while I write the XHTML and CSS, the PHP is a joint effort. You can check out DAC at http://chat.ather-tech.net/
If you’ve commented on here, then I apologise as in my haste to erase the bulk of spam I pretty much erased everything. I’ll try and keep a close eye on the comments in the future.
So in ending, I hope to have some new code snippets up soon, probably from AthX and/or DAC. Until then!
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.
This new wordpress release is all flashy and neat isn’t it.
In other news however, my refactoring of AthList is making nice progress. The basics of the new class are working and getting it all working has allowed me to take a new fresher look at the code, and thus I’ve been able to make a couple of optimisations.
You can see my current work-in-progress at www.ather-tech.net/refactor, it is currently missing a couple of features found in the 1.x branch such as “Up” navigation and File-type icons. My plan is to get “Up” functionality working first, and then the File-type icons when n00berific can spare some time. *nudge-nudge*
The current code to return a basic list is simple:
<?php
include(‘refactor_test.php’);
$AthList = new AthList($_GET["path"]);
$AthList->SetExclude(“.,..,error_log”);
$list = $AthList->GetList(true);
echo $AthList->PrintList($list);
?>
I shall be providing documentation of the AthList class once I’ve completed implementing all of the current 1.x features in 2.x, until then.
Happy coding!