Advertisement
Guest User

Untitled

a guest
May 4th, 2016
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.75 KB | None | 0 0
  1. trait userErrorAdviceTrait
  2. {
  3. public function userErrorAdvice()
  4. {
  5. $error = error_get_last();
  6. $_SESSION['errorStore'] = $error;
  7. $errorMessage = "No file exists for the PageController";
  8. if (strstr($error['message'], "No file exists for the PageController class"))
  9. {
  10. header('Location: http://192.171.127./~louis/errorAdvicePage.php?errorType=NoPageControllerError');
  11. exit;
  12. }
  13. }
  14. public function setUserErrorAdvice()
  15. {
  16. set_error_handler("userErrorAdvice");
  17. }
  18. }
  19.  
  20. use userErrorAdviceTrait;
  21. public static function makePageController($pageName)
  22. {
  23. //self::shutDownFunction();
  24. //self::shutdown_function();
  25. self::setUserErrorAdvice();
  26.  
  27. //Rest of code ....
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement