Constants.php 1.2 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. * @license http://www.opensource.org/licenses/mit-license.php MIT License
  12. *
  13. * @link http://www.workerman.net/
  14. */
  15. // Pcre.jit is not stable, temporarily disabled.
  16. ini_set('pcre.jit', 0);
  17. // For onError callback.
  18. const WORKERMAN_CONNECT_FAIL = 1;
  19. // For onError callback.
  20. const WORKERMAN_SEND_FAIL = 2;
  21. // Define OS Type
  22. const OS_TYPE_LINUX = 'linux';
  23. const OS_TYPE_WINDOWS = 'windows';
  24. // Compatible with php7
  25. if (!class_exists('Error')) {
  26. class Error extends Exception
  27. {
  28. }
  29. }
  30. if (!interface_exists('SessionHandlerInterface')) {
  31. interface SessionHandlerInterface {
  32. public function close();
  33. public function destroy($session_id);
  34. public function gc($maxlifetime);
  35. public function open($save_path ,$session_name);
  36. public function read($session_id);
  37. public function write($session_id , $session_data);
  38. }
  39. }