Tag: Php Script
Waking Up PHP
by Stephen Blair on Apr.25, 2009, under A PHP Life
My PHP Coffee Mug script has inspired a new category on my blog called A PHP Life and here is the latest addition!
Stay tuned for more to come!
// Waking Up PHP | Stephen R. Blair | www.srblair.com
function morningAlarm() {
//The snooze button has not been smashed yet
$snoozeCount = 0;
//The alarm is buzzing
if(isset($alarm)) {
if($snoozeCount <= 3) { //If you have not hit the snooze button at least 3 times...
$snoozeCount++; //Go ahead and hit it again!
} else {
$wakeUp = true; //Otherwise, wake your ass up!
}
}
}
PHP Coffee Mug v1.0
by Stephen Blair on Apr.24, 2009, under A PHP Life
A co-worker and myself went to Starbucks today where I decided that I really could use an office coffee mug to keep at work. I of course chose the largest mug they had which also just happens to come with a porcelain pen that you can use to write on it and eventually heat treat to make permanent. As I was sitting here writing code for work I was also thinking about what clever sayings or cool pictures I could put on my new coffee mug. The mixture of work and play came out as a random coffee mug php script I have come to label as “PHP Coffee Mug v1.0″.
I hope you enjoy my random and utterly useless coffee mug script!
// PHP Coffee Mug v1.0 | Stephen R. Blair | www.srblair.com
require_once('coffee_cup.php');
if($coffeeCup == empty) {
//Check to see if there is a fresh pot of coffee
if($coffeePot != 'fresh') {
//Make a fresh pot of coffee
makeCoffee();
} else {
//Pour coffee into the coffee cup
pourCoffee();
//Drink the coffee!
drinkCoffee();
}
} else {
//Check the date for the coffee in the mug
if($date > $dateExpire) {
//Rinse out the cup if it is old coffee
rinseCup();
//Check to see if there is a fresh pot of coffee
if($coffeePot != 'fresh') {
//Make a fresh pot of coffee
makeCoffee();
} else {
//Pour coffee into the coffee cup
pourCoffee();
}
} else {
//The coffee is fine, drink it!
drinkCoffee();
}
}


















