Advertisement
Guest User

Untitled

a guest
Nov 25th, 2015
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.59 KB | None | 0 0
  1. abstract class abstractClieent
  2. {
  3.  
  4.     public $debug = false;
  5.  
  6.     public function send()
  7.     {
  8.         $this->log('ne rabotaet');
  9.     }
  10.  
  11.     public function log($message)
  12.     {
  13.         if ($this->debug) {
  14.             file_put_contents($this->name . '.log', (new \DateTime('NOW'))->format('Y-m-d H:i:s') . ' ' . $message, FILE_APPEND | LOCK_EX);
  15.         }
  16.     }
  17.  
  18. }
  19.  
  20. class client extends abstractClient
  21. {
  22.  
  23.     public function parampampam()
  24.     {
  25.         $this->log('rabotaet');
  26.     }
  27.  
  28. }
  29.  
  30. $client = new client();
  31. $client->enableDebug();
  32. $client->parampampam();
  33. $client->send();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement