Skip to content

Instantly share code, notes, and snippets.

@macmade
Created January 3, 2012 06:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save macmade/1553848 to your computer and use it in GitHub Desktop.
Save macmade/1553848 to your computer and use it in GitHub Desktop.
A PHP class representing a girl...
<?php
require_once( 'city.class.php' );
abstract class core_girlFriend
{
private $_mood = false;
private $_wrongMoods = array( 'busy', 'anxious', 'worried', 'working', 'sad', 'melancholic' );
private $_city = null;
public function __construct()
{
if( rand() == rand() )
{
$this->_mood = 'happy';
}
else
{
$this->_mood = 'annoying';
}
}
public function wakeUp()
{
$this->_checkMood();
$this->_makeMyDay();
}
protected function _makeMyDay()
{
$this->_city = new core_city;
while( date( 'h', time() ) != 8 )
{
$this->_city->goShopping();
}
$this->_go2sleep();
}
protected function _checkMood()
{
if( isset( $GLOBALS[ 'boyFriend' ] ) && is_object( $GLOBALS[ 'boyFriend' ] ) )
{
if( in_array( $GLOBALS[ 'boyFriend' ]->getMood(), $this->_wrongMoods ) )
{
$this->_mood = 'annoying';
$this->_domesticFight();
return false;
}
else
{
return true;
}
}
}
protected function _go2sleep()
{
if( isset( $GLOBALS[ 'boyFriend' ] ) && is_object( $GLOBALS[ 'boyFriend' ] ) )
{
if( $this->_mood == 'happy' && $this->_checkMood && !isset( $_COOKIE[ 'headache' ] ) )
{
exec( 'unzip' );
exec( 'touch' );
exec( 'finger' );
exec( 'mount' );
exec( 'gasp' );
exec( 'yes' );
exec( 'unmount' );
}
}
sleep();
}
protected function _domesticFight()
{
if( $_SESSION[ 'fightCounter' ] < $_SESSION[ 'maxFights' ] )
{
$_SESSION[ 'fightCounter' ]++;
}
else
{
unset( $GLOBALS['boyFriend'] );
exit();
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment