コード例 #1
0
ファイル: AlertAbstract.php プロジェクト: arkanmgerges/tasker
 /**
  * Prepare config and logger
  *
  * @param string  $message  Message of this exception
  * @param string  $file     File path and name where the exception has taken place
  * @param int     $lineNo   Line number where the exception has taken place
  */
 public function __construct($message, $file, $lineNo)
 {
     parent::__construct($message);
     $logger = Helper::getLogger(Logger::ALERT);
     $logger->alert('\'' . $message . '\' in file \'' . $file . '\', at line ' . $lineNo);
 }
コード例 #2
0
 /**
  * Prepare config and logger
  *
  * @param string  $message  Message of this exception
  * @param string  $file     File path and name where the exception has taken place
  * @param int     $lineNo   Line number where the exception has taken place
  */
 public function __construct($message, $file, $lineNo)
 {
     parent::__construct($message);
     $logger = Helper::getLogger(Logger::WARNING);
     $logger->warning('\'' . $message . '\' in file \'' . $file . '\', at line ' . $lineNo);
 }
コード例 #3
0
ファイル: MiscTest.php プロジェクト: arkanmgerges/tasker
 /**
  * @expectedException \Tasker\Exception\UnExpectedException
  */
 public function testThrowAnException()
 {
     ExceptionHelper::setConfigPath(__DIR__ . '/config.php');
     ExceptionHelper::setEnvironmentVariable('APP_ENV');
     throw new UnExpectedException('this is a test', __FILE__, __LINE__);
 }
コード例 #4
0
ファイル: Assign.php プロジェクト: arkanmgerges/tasker
 public function setEnvironmentVariable($environmentVariable = 'APP_ENV')
 {
     HelperTool::setEnvironmentVariable($environmentVariable);
     ExceptionHelper::setEnvironmentVariable($environmentVariable);
 }
コード例 #5
0
 /**
  * Prepare config and logger
  *
  * @param string  $message  Message of this exception
  * @param string  $file     File path and name where the exception has taken place
  * @param int     $lineNo   Line number where the exception has taken place
  */
 public function __construct($message, $file, $lineNo)
 {
     parent::__construct($message);
     $logger = Helper::getLogger(Logger::EMERGENCY);
     $logger->emergency('\'' . $message . '\' in file \'' . $file . '\', at line ' . $lineNo);
 }
コード例 #6
0
 /**
  * Prepare config and logger
  *
  * @param string  $message  Message of this exception
  * @param string  $file     File path and name where the exception has taken place
  * @param int     $lineNo   Line number where the exception has taken place
  */
 public function __construct($message, $file, $lineNo)
 {
     parent::__construct($message);
     $logger = Helper::getLogger(Logger::CRITICAL);
     $logger->critical('\'' . $message . '\' in file \'' . $file . '\', at line ' . $lineNo);
 }