One man's voice Thoughts, rants and commentary of a simple man

12Apr/090

On the third day

On the first day He was betrayed, brought before the religious leaders of the day and stood before those that hated him, accused of committing crimes that He did not commit. He did not defend himself against His accusers and did not hold them in contempt. He knew what He had to do and what He had to endure to bring to completion His mission. For His resolve He was forsaken, lied about, teased, mocked, beaten, humiliated, spat on, cursed, laughed and murdered. On the first day He died.

On the second day, while in the tomb prepared for Him, He battled against the enemies of God, taking back those that had gone before He had come. On a mission, He didn't waver and kept the commandment given Him by His father. On the second day He battled.

On the third He did something He promised He would do yet none gave Him the slightest chance of accomplishing - He conquered death, rose from the grave and took back the dominion man had given Satan over us. He took His place as the resurrected son of the most high God and began the last events in His ministry that would ever see Him in person. On the third day, He rose again, conquered death and brought victory to all those that would call Him savior.

As we enjoy the festivities on this day - the candy, the bunnies, the eggs, the color, the food, the family, the friendship and the fellowship - I pray that we remember that today is a celebration of life, rebirth, grace and victory. Christ died for all.

Yes, all, the whole of humanity. Saint and sinner alike. Actually, mostly for the sinner since all have sinned and fallen short of the glory of God. He died for the murderer, the cheater, the adulterer, the fornicator, the liar, the thief, the blasphemer, the rapist. He died for the man that cannot control his eye or his mouth. He died for the woman that has sexual inclination for another woman. He died for the disobedient child and the rebellious parent. He died for mankind, so that through His shed blood we could be cleansed of our sin and once again be able to fellowship directly with God the father.

Through grace we have been saved by faith. Faith that Christ was born of a virgin as the only begotten son of the living God. Faith that He walked the Earth as a man. Faith that He was betrayed and crucified. And faith that He ultimately rose again on the third day.

There is no earning salvation. There are no prerequisites to it either. The person that you are right now, the success or the failure, the dirty or the clean, the broken or the complete... you are exactly who Christ died for. Because God so loved the world that He gave His only begotten son that whoever believes in Him would not perish but have everlasting life.

Even if you are not a Christian or are resistant to the message of love that embodies who Christ is, my prayer today is that you remember why we celebrate the day we celebrate today. May God bless you, whoever and wherever you are.

11Apr/091

An outing of sorts

Today my wife needed a break badly. She has been without one for a while and asked me a couple of days ago whether last night would be alright for her to go out and have some "her" time. Last night did not exactly happen for her, but today did, so I gave her that time and decided I would spend some time taking the kids for a walk to get slushies because the kids really love doing that, generally it doesn't cost too much and it usually wears the kids out and makes for an excellent quiet time when we get home.

Quick tip for the husbands: Your wife needs a break. Whether she tells you or not is irrelevant. Give her a break frequently. She needs it and she will be very appreciative of your thoughtfulness toward her. And even if she isn't, you should do it anyway.

Quick tip for the fathers: Your kids need to get out the house. They need to blow off steam and they totally need to do that with their dads. This is not to say that they cannot get that with their moms. In fact kids need mom time too. But dad time is crucial, so if you have kids make time for them doing something you all can enjoy together.

So we set off on a walk, the six of us, to the 7-11 just down the street from us. The weather was nice, a little chilly but sunny, so the walk was pleasant right off the pop. We hit up 7-11 and grabbed slushies for all of us - well I prefer coffee so I did that instead - and a couple of bags of chips to snack on. Then we headed out to the front of the store to kick it and snack.

But that is something we always do, so I decided we would change things up a bit so instead of sitting out in front of the store we walked a little bit further to Mission Boulevard where we found a bench and sat on it, snacking and slurping and watching the cars pass us by. This is what it might have looked at from the cars' perspective:

the-kids

After our snack time and car watching was over was decided to cross the street and check out Mission San Jose. It wasn't until we got there that we realized it was going to cost more money that I brought with us so we just sort of hung around the outside and checked out as much as we could without spending any money doing it.

After a short while we decided to start the walk home with a planned stop at the Olive Hyde Art Gallery. This ended up being a much shorter trip than I wanted it to be seeing as the gallery was displaying quilts and artwork that ran as high as $10,000. If not for the fact that four of my kids suddenly had to go to the bathroom at the gallery we would have only been there for a couple of minutes. In fact we were there for almost a half hour.

After that we took a slow stroll home and ended our two hour walk by coming home and resting. So when Sandi got home from her alone time she was able to come home to a quiet, resting house. Now how could this day have gotten any better?

Think BBQ. I know I am.

10Apr/090

Responsibility and a dog

The Bernese Mountain Puppy

The Bernese Mountain Puppy

For a long while now the kids have been really leaning on me to get a dog. For the same amount of time I have loudly voiced my opposition to this idea. It is my opinion that before we bring another life into our family our entire family needs to learn how to be responsible enough to handle the things that we already have.

That means making sure to put stuff away when we are done using them, doing homework on time, going to sleep and waking up on time, treating others with respect and being obedient. And this is something that has, for the time they have wanted a dog, been a severe stumbling block for them. So getting a dog has remained pretty well out of reach for our family.

Until now. It seems that my wife has gotten the puppy bug pretty bad over the last month or so and has been pushing on the kids to get a grip on their responsibilities. And over the last month the notion of us getting a puppy has moved from being just a notion to being a full on possibility because mom is behind it now.

And me being the husband that I am, the awesome husband that I am, and wanting to give my wife everything she wants under the sun, have also taken a position in this quest to get a dog. So I am cranking up my efforts to bring awareness to the family what it is exactly that it will take for us to get a dog. Because I also want my kids to have what they want while at the same time giving them what they need. I think as a husband it is important to see the things that your wife wants and try to find a way to make it happen. And I think as a father that finding that place between giving your kids something to enjoy AND something to be responsible for is crucial to helping your kids develop.

So now it seems that we are working our tails off as a family to make sure we handle our responsibilities to prove that we can actually take on the added responsibility of a dog. I hope this pans out, for all our sakes. I know my family can do it. Maybe now with Sandi behind this we might see what my family can actually do when we really want something.

9Apr/090

The brilliant observation of a three year old

Last night, as we approached church, we all noticed a blimp flying off in the distance. As we got to church Sandi noticed that the blimp was getting lower and lower to the ground.

Thinking it was about to land, she said out loud "I wonder where the blimp is going to land? Is it going to land at the airport?"

Without skipping a beat my son, all three and half years old of him, says "No mom, it is going to land at the blimp port".

I love my son.

8Apr/090

The criminality of cash

Just about anyone that knows me knows that I tend to lean toward a conservative/independent political point of view in most of my thinking. I have had a dissatisfaction with our government and government policies for a while, though more recently I have grown increasingly vocal about it because of the glaring opposition I have toward president Obama's political views.

However there are times that I see things that were implemented under previous administrations that incense me as much as, if not more than, the current administrations decisions. Yesterday I got an email from Campaign for Liberty, an organization that supports Ron Paul and his political philosophies. They are more American Independent oriented politically and I do not necessarily agree with everything they preach, but in the case of the events mentioned in this email I could only be left with disgust toward the Bush administration for the implementation of policies that have affected good old American citizens who have been identified as displaying "terrorist" tendencies.

Campaign for Liberty’s very own Steve Bierfeldt has become an unexpected Internet sensation -- and the latest target of over-reaching federal government agents.

You see, Steve was detained by Airport Police and TSA officials shortly after the Campaign for Liberty regional conference in St. Louis.

The officials rudely berated and harassed Steve for 30 minutes in a secluded room at Lambert-St. Louis International Airport. Fortunately, Steve was able to record nearly all of the interrogation with his cell phone.

Steve’s alleged “crime”? Carrying $4,700 in checks and cash from Campaign for Liberty, along with various other materials from our conference.

The local and Federal agents harassed Steve. They were belligerent, cursing and using insulting language. They threatened to turn Steve over to the DEA and the FBI, all the while refusing to inform him of his legal rights or explain how cash and checks threatened airplane or airport security.

Throughout the interrogation, Steve remained polite but resolute and declined to answer the invasive questions without an adequate explanation from these federal and local agents as to why they needed to be answered. Without telling Steve what law he was accused of breaking, they continued their harassment.

Although they grew increasingly frustrated that he remained committed to exercising his rights, intervention from another officer eventually led the police to reluctantly release Steve.

Last Wednesday, Steve appeared on Judge Napolitano’s Freedom Watch to discuss the flagrant violation of his rights and to promote the importance of each of us defending our civil liberties.

Here is the video clip. Listen to the recording that is played during this video and how well Steve handled the interrogation he was put through. The TSA had absolutely no right to treat him the way they did. And the thought that he was detained simply because he had a few thousand dollars in cash and checks on him makes me even angrier. Imagine if you had money on you while trying to board a plane and were treated like a terrorist because of it. What the crap?

I wonder what it is going to take to keep this crap from happening anymore. No American citizen should be treated the way Steve was just because they are carrying cash and checks, especially when there is absolutely no cause for it. There were no reports of theft locally and no reports of criminal activity in which the suspect resembled Steve (at least none mentioned in the report of the story). I am amazed that the TSA and airport police have this level of authority to carry out actions of this nature without being under the scrutiny of some type of oversight agency. This freaks me out.

But more than anything it makes me yearn for change. I hope president Obama has something on his list of things to change that covers this.

7Apr/092

In memory – Sandra Cantu

A little over a week ago a news story broke in which an eight year old girl had gone missing in Tracy, California. Sandra Cantu, the eight year old girl, was last seen leaving a friends house and walking back to her home in a trailer park in Tracy. She was not seen after that.

Within four hours the missing persons report was filed and the police began investigating. The media began to report it and the community rallied around her and became hopeful that she would be found. It was a touching story and one that served to bring awareness to all families that no matter where you live you need to teach your children how to defend themselves, who to trust and what to do in situations that could result in their harm, abduction or worst of all, their death.

Well yesterday the worst of all possible scenarios was broadcast all over the central valley and bay area. Sandra Cantu, the eight year old girl who had gone missing just 10 days ago, was found dead in a suitcase in an irrigation pond on a farm just two miles away from Sandra Cantu's home.

As the father of five kids, four of whom are daughters and one of whom is eight, I was rattled by the news. Entirely too many children die each year for the stupidest of reasons. It sickens me and angers me when I hear that any kid has been violated in any way. Even worse is hearing about kids whose lives have been snuffed out because of someone with a penchant for causing harm to a child. I still get confused by acts like these, cowardly, selfish acts for which there is no logical explanation.

As a parent I feel it is my responsibility to make sure my kids are safe as much as possible. Doing that sometimes requires shock and awe tactics. Like relating to my kids that at any time, anyone that seeks to do them harm could very well present themselves in a way that appeals to my kids. My wife and I train up our children as best we can. And sometimes the best course of action is to let them in to stories like that of Sandra Cantu.

If you have kids I hope you take the time tonight to tell them just how much you love them. Make it a point to discuss this case with them and the importance of not trusting anyone they don't know. And make sure you take some time to pray for the family of Sandra Cantu. I cannot even imagine what they must be going through right now

6Apr/090

The case of the vanishing weekend

Monday always come faster than it should. It usually comes with a headache or some form of crankiness that can only be washed away with lots of coffee or nice words from a friend or coworker. Sometimes it comes cold and dreary in a way that makes you wish it wasn't there so you didn't have to experience the drab of that particular Monday. And sometimes it comes bright, shiny and warm in a way that makes you wish that you could have had that Monday two days earlier when you didn't have to go to work or to school or whatever.

Mine, today, came with no fanfare. In fact, it just came, almost as if Friday birthed it itself. What the crap? Where did my weekend go?

Tagged as: No Comments
5Apr/096

Christianity and the church

Since when has Christ been about getting people to church?
This morning at church my pastor showed a video he had put together as a pitch for his newest series that he is teaching. The series is about making church relevant and the pitch basically asked the question "What can we as Christians do to get those from the culture of the world... the unsaved, the student, the businessman, the Muslim (or other religion), the educated, etc ... to church?". As I sat and thought about that question for a minute the answer hit me like a ton of bibles. Stop trying to get people to church and start trying to take church to those people.

When did the focus of the gospel become about getting people to church? I understand the concept... get people to church where they can be fed, be led and be released into ministry. But even in that I am left wondering where the commandment was that Christ gave us to get people into a building.

If a church, as in a building, were so important don't you think there would have been mention of the synagogue Christ attended in the bible? Or any temple for that matter? The Word does mention they attended, but the importance of the building seems to wane right there.

There is no mention of a specific synagogue or specific temple, and I think that this is because the church, as it is referred to in the bible is not about a building but about the community of believers that are inspired by the Word of God. When Paul wrote letters to the church at Ephesus, Corinth, Phillipi, etc, he wasn't writing to the members of the First Assembly of God in Christ in that city, or the First Presbyterian Church in that city. No, he was writing to the body of Christ in that city, the community of believers that were gathered there. Somehow church has moved away from being the community of believers it used to be to now being a building where you can worship, pray, cry, hug and do all the things one does when they are "in church".

I am not part of the Christian church because on Sundays and Wednesdays I go to Jubilee Christian Center. I attend that church, but I am a Christian, a member of the Christian community, the collective body that calls itself by the name of the Son of God. I don't need a building to tell me that I am Christian. And neither do new believers.

In our zeal and zest to win souls for Christ I think us Christians are losing the breadth of the greatest commandments we were given by Christ: Love God, love your neighbors, love yourself, preach the gospel.

Why should we have to convince anyone of the love of God?
When is the last time someone had to convince you to go to the grocery store to get food so you and your family could eat? It seems stupid to even ask that question. We already know that if we need to get something to feed ourselves we go to where the supply is and get some.

Yet we as Christians are constantly trying to convince people that they need to stop living the way they are living and they need to go to church so they can be saved. Or we constantly try to get people to attend a church service with the hope or prayer that by attending that one service they will miraculously and immediately give their hearts to God and become a Christian. If we preach the gospel, the good news of our Lord Jesus Christ, why would there be a need for convincing? It is the good news.

If someone is hungry spiritually they will find food. If they are yearning for love, real love, they will seek it out and eventually they will find it. They don't need to be convinced that they need love or that they are hungry. They just need to be shown where the source of the supply is.

Imagine if a Christian actually did what Christ commanded and loved someone, regardless of their skin color, political affiliation, sexual orientation, lifestyle, age or cultural heritage. What could happen if we showed someone the love of Christ? And if they see it, and get hungrier for the blessings of God, what are the chances that they will seek a source of replenishment? Do you think you would need to convince them to go to the store to get the resource they'd need to be fed?

Yet we push on people as though they are some number, some statistic that would look good on a sheet of paper as we stand before the gates of heaven and the Judgment of God. "Look Father, I saved this many souls. See?". Why do I see God looking on that and responding with "And how many of them did you love without cause, as I have commanded you?".

Where is all this coming from?
I am really not sure why I have such an issue right now with Christianity as usual. I am just getting more and more turned off by how much of the bible we expect everyone else to learn while we choose to live outside of that covering. We are children of the most high. He is not only our God, he is our Father and our King. We don't need to convince anyone they are royalty. We only need to show them that they are loved by the King like we are loved.

But in order to do that we need to come to grips with the fact that that we are loved. And not for our works or souls won or church days attended or offerings given. We are loved because it pleases God to love His creation. He wants fellowship with us and wants us to bask in the love and mercy and grace and abundance and blessing that only He can give.

God's love is so much bigger than any person can imagine, it is bigger than words and bigger than anything we could ever even dream. But no one who doesn't know this will ever learn this if we, His chosen generation, continue to focus on putting a warm body in a chair while we completely forget to show them what love is, and specifically what God's love is all about.

It is my hope and prayer and desire to learn what it means to be loved by God. I struggle with this as much as the next guy. I know I am loved, but I sometimes wonder if the wretched person I am can separate me from that love. A part of me still wonders if God can really love a person like me. Most of me knows, however, that He loves me more than anything else in the world. I am the apple of His eye and He would willingly die for me.

In fact, He proved that He would on Calvary. Now if I could only wrap my head around how to show others that the same love God has for me he has for all I would so be able to put some feet to this disdain I have with "winning souls" and get to the business of loving my neighbor.

4Apr/099

Getting books details by ISBN in PHP

Sometimes I love being a geek. Today, as I set out to inventory my collection of almost 500 books or so, I wanted to find a fast way to get the information on the book I wanted based on the books ISBN. This was because I was already getting tired of typing five books into the inventory (yes, I am that lazy) and I really did not want to keep typing out the authors name, the title and the subtitle for each book.

So I went to ISBNdb.com and entered an ISBN thinking I would be able to just copy and paste the book information from the output. That turned out to be overwhelmingly difficult since their output of the search is really convoluted. I knew what I wanted to get and they didn't offer that.

But they did offer an API and, after reading their docs, I realized that I could write a script that would take an ISBN and return to me the information I was looking for in a way that I could just copy and paste it. Remarkably, it was faster and easier than I thought it would be. I actually developed this little snippet, freely available for you here, in about 5 minutes. Hope it helps you in some way, if you are looking for such a thing.

NOTE: Before using this code make sure to sign up for your own API key. In order to do that you will need to register for an account with ISBNdb.com and then create a key. But as soon as you do you will have immediate access to their API. The API is simple, responding to the request with a simple XML output. Anyhow, without further ado, here is the little script I put together to fetch me the data I was looking for the way I wanted it.

<?php
/**
 * Set this value to your own API key
 */
$apikey = '12345678';
 
/**
 * Initialize this var for use when forms are not posted
 */
$isbn = null;
 
/**
 * Initialize the result set var
 */
$rs = null;
 
/**
 * See if the form is posted
 */
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
  /**
   * Get the ISBN from the form
   * 
   * No, there is no validation on this. This 
   * was for me and I knew I would not be at
   * all trying to trick my own script. USE 
   * THIS AS IS AT YOUR OWN PERIL.
   */
  $isbn = $_POST['isbn'];
 
  /**
   * Get the result as a SimpleXML object
   */
  $rs = simplexml_load_file("http://isbndb.com/api/books.xml?access_key=$apikey&index1=isbn&value1=$isbn");
}
?>
<html>
<head><title>ISBN Check</title></head>
<body>
<form method="post" action="<?php echo basename(__FILE__) ?>">
  <p>
    Enter an ISBN:<br />
    <input type="text" size="40" name="isbn" id="isbn" value="<?php echo $isbn ?>" />
  </p>
  <p>
    <input type="submit" name="submit" value="Search ISBN" />
  </p>
</form>
<?php
/**
 * Only output more stuff if there is a result
 */
if ($rs) : ?>
<hr />
Results for ISBN: <?php echo $isbn ?>:
<?php 
/**
 * Results for a book are in $rs->BookList->BookData
 * 
 * You can see this using var_dump($rs);
 */ 
$book = $rs->BookList->BookData;
?>
<p>
  <strong><?php echo $book->Title; ?></strong><br />
  <?php echo !empty($book->TitleLong) ? $book->TitleLong . '<br />' : null; ?>
  <?php echo $book->AuthorsText; ?><br />
  <?php echo $book->PublisherText; ?><br />
  <?php echo $isbn; ?>
</p>
<?php endif; ?>
</body>
</html>

Typical output might look like (from one of the books I was checking on):


Results for ISBN: 0316116955:

The day the universe changed
James Burke
Boston : Little, Brown, c1985.
0316116955


I hope you enjoy this, if you happen to be looking for an ISBN search tool that you can run on your own. ;)

3Apr/090

A small cache routine in PHP

It has been a long time since I have posted anything PHP related so I decided that to end the week I would post something related to caching data to a file. File based cache's are probably not the sexiest thing around and more than likely not the best way to do things. But in my case I needed something light and small to house a small data set from a database server that was taking upwards of 35 seconds to return 20 rows of data.

I also only needed this cache in one place so in my original code I have it running a small procedural routine within a method. But I figured I would extend that process to be a little more flexible so I objectified it. Here is what I came up with:

NOTES:

  • The backend data is coming from a database in my sample. It could legitimately come from any place that takes a long time to retrieve though.
  • I am using a MySQL database backend in this example, driven by PDO
  • The database handle is assumed to have been created and is retrieved from a registry object in the example
  • The directory where the cache file will live will need to be writable by the web server
  • There is very little error handling in this code. I will leave that up to you.
  • Some of what is being done is tightly coupled internally and requires overwrites to change (path, filename, etc)
  • I have provided precious few examples.
<?php
/**
 * Small abstract class that handles the non-specifics of the cache routine
 */
abstract class SmallCache {
  /**
   * Directory path to the cache file 
   * 
   * @access protected
   * @var string
   */
  protected $_cachePath;
 
  /**
   * Name of the cache file
   * 
   * @access protected
   * @var string
   */
  protected $_cacheFile;
 
  /**
   * Flag that checks to see if the file is writable
   * 
   * @access protected
   * @var boolean
   */
  protected $_cacheFileWritable = true;
 
  /**
   * Default expiration time of the cache
   * 
   * @access protected
   * @var int
   */
  protected $_cacheExpiry = 3600;
 
  /**
   * Right now
   * 
   * @access protected
   * @var int
   */
  protected $_currentTime;
 
  /**
   * Object constructor
   * 
   * @access public
   * @param string $cacheFile Name of the file to write to
   * @param string $cachePath Path to the directory where the file will live
   * @param int $cacheExpiry Time in seconds the cache should stay alive
   */
  public function __construct($cacheFile = null, $cachePath = null, $cacheExpiry = null) {
    $this->setPath($cachePath);
    $this->setFile($cacheFile);
    $this->setExpiry($cacheExpiry);
    $this->_currentTime = time();
  }
 
  /**
   * Abstracted method that each child should implement
   */
  abstract public function fetch();
 
  /**
   * Simple sets a path if one is given
   * 
   * NOTE: The path should end with a slash 
   * 
   * @access public
   * @param string $path The path to the directory where the cache files live
   */
  public function setPath($path) {
    $this->_cachePath = $path ? 
      rtrim($path, '\/') . DIRECTORY_SEPARATOR : 
      realpath('.') . DIRECTORY_SEPARATOR . 'cache' . DIRECTORY_SEPARATOR;
  }
 
  /**
   * Sets the cache file name
   * 
   * @access public
   * @param string $file Name of the file to write and read the cache
   * @param boolean $useCachePath If true, will prepend the file name with the 
   *                              cache path
   */
  public function setFile($file, $useCachePath = false) {
    // If there is a file name given...
    if ($file) {
      // Prepend the path if it is being asked for
      if ($useCachePath) {
        $file = $this->_cachePath . $file;
      }
 
      // Set the name
      $this->_cacheFile = $file;
    } else {
      // Build a name
      $this->_cacheFile = $this->_cachePath . get_class($this) . '-cache-file.php';
    }
  }
 
  /**
   * Sets the cache file expiration time duration
   * 
   * @access public
   * @param int $expiry Time in seconds to keep the cache before dumping and 
   *                    starting over
   */
  public function setExpiry($expiry) {
    if ($expiry !== null) {
      $this->_cacheExpiry = intval($cacheExpiry);
    }
  }
 
  /**
   * Gets the current contents if there is one
   * 
   * @access public
   * @return mixed Null if there is none, otherwise whatever is in the cache
   */
  public function get() {
    // See if we need to make the temp file
    if (!file_exists($this->_cacheFile)) {
      // This will simply make an empty file for writing. Maybe.
      if (!touch($this->_cacheFile)) {
        $this->_cacheFileWritable = false;
      }
 
      // Send back something to be used by the child
      return null;
    } else {
      // Get the cached data
      return include_once $this->_cacheFile;
    }
  }
 
  /**
   * Writes data to the cache file
   * 
   * @access public 
   * @param string $data The contents of the cache file as a string
   */
  public function put($data) {
    // Write it now if we can
    if ($this->_cacheFileWritable) {
      $fh = fopen($this->_cacheFile, 'w');
      fwrite($fh, $data);
      fclose($fh);
    }
  }
}
 
// Simple sample implementation
class SlowQueryCache extends SmallCache {
  public function fetch() {
    // Get the cache data
    $filedata = $this->get();
 
    // Now see if we have a cache and if the cache is young enough, if not, make the cache and use the data now
    if ( ($filedata && $this->_currentTime - $filedata['timestamp'] > $this->_cacheExpiry) || !$filedata) {
      // Set the query - pretend it is a MySQL query
      $sql = 'call some_proc_that_might_take_long()';
 
      /** 
       * Get the result set
       * 
       * In our case we are pretending to use PDO - substitute your own DB
       * handler code here
       * 
       * We are also pretending to get our DB handle from a registry in 
       * our library
       */
      $db = Libregistry::getInstance()->get('objectdbmysql');
 
      /** 
       * Call the query
       * 
       * I am leaving error handling up to you.
       */
      $rs = $db->query($sql);
 
      // Fileinfo is what is going to go into the file
      $fileinfo  = "<?php\n";
      $fileinfo .= "\$data = array(\n\t'timestamp' => $this->_currentTime,\n\t'rows' => array(\n";
 
      // File data is what would normally come from the cache
      $filedata['timestamp'] = $this->_currentTime;
      $filedata['rows'] = array(); // Clears out any old crap
 
      /**
       * Loop and build
       * 
       * This will be entirely dependent on your data structure and how 
       * you expect to access the data from within the cache
       */ 
      while ($row = $rs->fetch()) {
        $fileinfo .= "\t\t'$row[id]' => array('name' => '$row[name]', 'age' => '$row[age]'),\n";
        $filedata['rows'][$row['id']] = array('name' => $row['name'], 'age' => $row['age']);
      }
      $fileinfo .= "\t),\n);\nreturn \$data;";
 
      // Write it now if we can
      $this->put($fileinfo);
    }
 
    // Send back the data we have
    return $filedata;
  }
}
 
// Tests
$cache = new SlowQueryCache('cache/slowquery.php');
$data = $cache->fetch();
var_dump($data);
?>

Basically what this does is check to see if there is a cache file. If there is, it gets it and reads it and looks at the time written into the cache file to compare the current time minus the cache time against the expiry limit. If the cache is expired, the data is collected from the database, a result array is build and the result array is then written, as a string of PHP code to the cache file while the array data is returned.

If the cache has not yet expired then the original cache data is returned.

Keep in mind that this is still very tailored to my personal needs. But it should be easily enough transitioned to something more useful with a little tweaking. And yes, I know that this can be done in a better, more robust and sexier way. But this worked for me and I figured I'd share it in case it might work for you.