Пример #1
0
 public function __construct()
 {
     if (!defined('STDOUT')) {
         throw new Exception('STDOUT stream not available');
     }
     parent::__construct(STDOUT);
 }
Пример #2
0
 /**
  * Open a file on the filesystem.
  * @param string $file   full path and file name of target file
  */
 public function __construct($file)
 {
     if (!$file) {
         throw new \InvalidArgumentException('No file specified');
     } elseif (!($stream = fopen($file, 'a+'))) {
         throw new Exception("Unable to open log file: {$file}");
     }
     parent::__construct($stream);
 }