Constants.php 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. <?php
  2. /**
  3. * This file is part of workerman.
  4. *
  5. * Licensed under The MIT License
  6. * For full copyright and license information, please see the MIT-LICENSE.txt
  7. * Redistributions of files must retain the above copyright notice.
  8. *
  9. * @author walkor<walkor@workerman.net>
  10. * @copyright walkor<walkor@workerman.net>
  11. * @link http://www.workerman.net/
  12. * @license http://www.opensource.org/licenses/mit-license.php MIT License
  13. */
  14. // Date.timezone
  15. if (!ini_get('date.timezone')) {
  16. date_default_timezone_set('Asia/Shanghai');
  17. }
  18. // Display errors.
  19. ini_set('display_errors', 'on');
  20. // Reporting all.
  21. error_reporting(E_ALL);
  22. // Reset opcache.
  23. if (function_exists('opcache_reset')) {
  24. opcache_reset();
  25. }
  26. // For onError callback.
  27. define('WORKERMAN_CONNECT_FAIL', 1);
  28. // For onError callback.
  29. define('WORKERMAN_SEND_FAIL', 2);
  30. // Define OS Type
  31. define('OS_TYPE_LINUX', 'linux');
  32. define('OS_TYPE_WINDOWS', 'windows');
  33. // Compatible with php7
  34. if(!class_exists('Error'))
  35. {
  36. class Error extends Exception
  37. {
  38. }
  39. }