Constants.php 970 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  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. // Display errors.
  15. ini_set('display_errors', 'on');
  16. // Reporting all.
  17. error_reporting(E_ALL);
  18. // Reset opcache.
  19. if (function_exists('opcache_reset')) {
  20. opcache_reset();
  21. }
  22. // For onError callback.
  23. define('WORKERMAN_CONNECT_FAIL', 1);
  24. // For onError callback.
  25. define('WORKERMAN_SEND_FAIL', 2);
  26. // Define OS Type
  27. define('OS_TYPE_LINUX', 'linux');
  28. define('OS_TYPE_WINDOWS', 'windows');
  29. define('NO_CLI', PHP_SAPI !== 'cli');
  30. // Compatible with php7
  31. if(!class_exists('Error'))
  32. {
  33. class Error extends Exception
  34. {
  35. }
  36. }