functions.php 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. <?php
  2. /*
  3. * This file is part of the Symfony package.
  4. *
  5. * (c) Fabien Potencier <fabien@symfony.com>
  6. *
  7. * For the full copyright and license information, please view the LICENSE
  8. * file that was distributed with this source code.
  9. */
  10. use Symfony\Component\Intl\Globals\IntlGlobals;
  11. if (!function_exists('intl_is_failure')) {
  12. /**
  13. * Stub implementation for the {@link intl_is_failure()} function of the intl
  14. * extension.
  15. *
  16. * @author Bernhard Schussek <bschussek@gmail.com>
  17. *
  18. * @param integer $errorCode The error code returned by intl_get_error_code().
  19. *
  20. * @return Boolean Whether the error code indicates an error.
  21. *
  22. * @see \Symfony\Component\Intl\Globals\StubIntlGlobals::isFailure
  23. */
  24. function intl_is_failure($errorCode)
  25. {
  26. return IntlGlobals::isFailure($errorCode);
  27. }
  28. /**
  29. * Stub implementation for the {@link intl_get_error_code()} function of the
  30. * intl extension.
  31. *
  32. * @author Bernhard Schussek <bschussek@gmail.com>
  33. *
  34. * @return Boolean The error code of the last intl function call or
  35. * IntlGlobals::U_ZERO_ERROR if no error occurred.
  36. *
  37. * @see \Symfony\Component\Intl\Globals\StubIntlGlobals::getErrorCode
  38. */
  39. function intl_get_error_code()
  40. {
  41. return IntlGlobals::getErrorCode();
  42. }
  43. /**
  44. * Stub implementation for the {@link intl_get_error_code()} function of the
  45. * intl extension.
  46. *
  47. * @author Bernhard Schussek <bschussek@gmail.com>
  48. *
  49. * @return Boolean The error message of the last intl function call or
  50. * "U_ZERO_ERROR" if no error occurred.
  51. *
  52. * @see \Symfony\Component\Intl\Globals\StubIntlGlobals::getErrorMessage
  53. */
  54. function intl_get_error_message()
  55. {
  56. return IntlGlobals::getErrorMessage();
  57. }
  58. /**
  59. * Stub implementation for the {@link intl_error_name()} function of the intl
  60. * extension.
  61. *
  62. * @param integer $errorCode The error code.
  63. *
  64. * @return string The name of the error code constant.
  65. *
  66. * @see \Symfony\Component\Intl\Globals\StubIntlGlobals::getErrorName
  67. */
  68. function intl_error_name($errorCode)
  69. {
  70. return IntlGlobals::getErrorName($errorCode);
  71. }
  72. }