Created
March 31, 2014 03:39
-
-
Save travisfont/9884821 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php /** By, Travis van der Font - 2014 **/ | |
| // -- hide this - logger function - log the even how you wish --// | |
| class logger | |
| { | |
| protected static function call_pie_log($arguments) | |
| { | |
| echo '<br/>log a bake for pie<br/>'; | |
| var_dump($arguments); | |
| return true; | |
| } | |
| } | |
| // --- end --// | |
| // -- process function - your core functions -- // | |
| class process extends logger | |
| { | |
| protected static function function_pie($arguments) | |
| { | |
| echo '<br/>inside the pie function<br/>'; | |
| var_dump($arguments); | |
| // end of the function return the logger | |
| return parent::call_pie_log($arguments); | |
| } | |
| } | |
| // --- end process function -- // | |
| // -- hide this function - never touch it -- // | |
| class observer extends process | |
| { | |
| public function __call($method, $arguments) | |
| { | |
| return process::{'function_'.$method}($arguments); | |
| } | |
| } | |
| // --- end --- /// | |
| final class cooking extends observer | |
| { | |
| /* | |
| private $amount; | |
| private $type; | |
| function __construct() | |
| { | |
| $this->amount = 3; | |
| $this->type = 'apples'; | |
| } | |
| */ | |
| public function bake() | |
| { | |
| $this->pie(3, 'apples'); | |
| } | |
| } | |
| // initializing | |
| $obj = new cooking; | |
| $obj->bake(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment