requirements.php 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. <?php
  2. /**
  3. * @link http://www.yiiframework.com/
  4. * @copyright Copyright (c) 2008 Yii Software LLC
  5. * @license http://www.yiiframework.com/license/
  6. */
  7. /* @var $this YiiRequirementChecker */
  8. /**
  9. * These are the Yii core requirements for the [[YiiRequirementChecker]] instance.
  10. * These requirements are mandatory for any Yii application.
  11. */
  12. return array(
  13. array(
  14. 'name' => 'PHP version',
  15. 'mandatory' => true,
  16. 'condition' => version_compare(PHP_VERSION, '5.4.0', '>='),
  17. 'by' => '<a href="http://www.yiiframework.com">Yii Framework</a>',
  18. 'memo' => 'PHP 5.4.0 or higher is required.',
  19. ),
  20. array(
  21. 'name' => 'Reflection extension',
  22. 'mandatory' => true,
  23. 'condition' => class_exists('Reflection', false),
  24. 'by' => '<a href="http://www.yiiframework.com">Yii Framework</a>',
  25. ),
  26. array(
  27. 'name' => 'PCRE extension',
  28. 'mandatory' => true,
  29. 'condition' => extension_loaded('pcre'),
  30. 'by' => '<a href="http://www.yiiframework.com">Yii Framework</a>',
  31. ),
  32. array(
  33. 'name' => 'SPL extension',
  34. 'mandatory' => true,
  35. 'condition' => extension_loaded('SPL'),
  36. 'by' => '<a href="http://www.yiiframework.com">Yii Framework</a>',
  37. ),
  38. array(
  39. 'name' => 'Ctype extension',
  40. 'mandatory' => true,
  41. 'condition' => extension_loaded('ctype'),
  42. 'by' => '<a href="http://www.yiiframework.com">Yii Framework</a>'
  43. ),
  44. array(
  45. 'name' => 'MBString extension',
  46. 'mandatory' => true,
  47. 'condition' => extension_loaded('mbstring'),
  48. 'by' => '<a href="https://secure.php.net/manual/en/book.mbstring.php">Multibyte string</a> processing',
  49. 'memo' => 'Required for multibyte encoding string processing.'
  50. ),
  51. array(
  52. 'name' => 'OpenSSL extension',
  53. 'mandatory' => false,
  54. 'condition' => extension_loaded('openssl'),
  55. 'by' => '<a href="http://www.yiiframework.com/doc-2.0/yii-base-security.html">Security Component</a>',
  56. 'memo' => 'Required by encrypt and decrypt methods.'
  57. ),
  58. array(
  59. 'name' => 'Intl extension',
  60. 'mandatory' => false,
  61. 'condition' => $this->checkPhpExtensionVersion('intl', '1.0.2', '>='),
  62. 'by' => '<a href="https://secure.php.net/manual/en/book.intl.php">Internationalization</a> support',
  63. 'memo' => 'PHP Intl extension 1.0.2 or higher is required when you want to use advanced parameters formatting
  64. in <code>Yii::t()</code>, non-latin languages with <code>Inflector::slug()</code>,
  65. <abbr title="Internationalized domain names">IDN</abbr>-feature of
  66. <code>EmailValidator</code> or <code>UrlValidator</code> or the <code>yii\i18n\Formatter</code> class.'
  67. ),
  68. array(
  69. 'name' => 'ICU version',
  70. 'mandatory' => false,
  71. 'condition' => defined('INTL_ICU_VERSION') && version_compare(INTL_ICU_VERSION, '49', '>='),
  72. 'by' => '<a href="https://secure.php.net/manual/en/book.intl.php">Internationalization</a> support',
  73. 'memo' => 'ICU 49.0 or higher is required when you want to use <code>#</code> placeholder in plural rules
  74. (for example, plural in
  75. <a href=\"http://www.yiiframework.com/doc-2.0/yii-i18n-formatter.html#asRelativeTime%28%29-detail\">
  76. Formatter::asRelativeTime()</a>) in the <code>yii\i18n\Formatter</code> class. Your current ICU version is ' .
  77. (defined('INTL_ICU_VERSION') ? INTL_ICU_VERSION : '(ICU is missing)') . '.'
  78. ),
  79. array(
  80. 'name' => 'ICU Data version',
  81. 'mandatory' => false,
  82. 'condition' => defined('INTL_ICU_DATA_VERSION') && version_compare(INTL_ICU_DATA_VERSION, '49.1', '>='),
  83. 'by' => '<a href="https://secure.php.net/manual/en/book.intl.php">Internationalization</a> support',
  84. 'memo' => 'ICU Data 49.1 or higher is required when you want to use <code>#</code> placeholder in plural rules
  85. (for example, plural in
  86. <a href=\"http://www.yiiframework.com/doc-2.0/yii-i18n-formatter.html#asRelativeTime%28%29-detail\">
  87. Formatter::asRelativeTime()</a>) in the <code>yii\i18n\Formatter</code> class. Your current ICU Data version is ' .
  88. (defined('INTL_ICU_DATA_VERSION') ? INTL_ICU_DATA_VERSION : '(ICU Data is missing)') . '.'
  89. ),
  90. array(
  91. 'name' => 'Fileinfo extension',
  92. 'mandatory' => false,
  93. 'condition' => extension_loaded('fileinfo'),
  94. 'by' => '<a href="https://secure.php.net/manual/en/book.fileinfo.php">File Information</a>',
  95. 'memo' => 'Required for files upload to detect correct file mime-types.'
  96. ),
  97. array(
  98. 'name' => 'DOM extension',
  99. 'mandatory' => false,
  100. 'condition' => extension_loaded('dom'),
  101. 'by' => '<a href="https://secure.php.net/manual/en/book.dom.php">Document Object Model</a>',
  102. 'memo' => 'Required for REST API to send XML responses via <code>yii\web\XmlResponseFormatter</code>.'
  103. ),
  104. array(
  105. 'name' => 'IPv6 support',
  106. 'mandatory' => false,
  107. 'condition' => strlen(@inet_pton('2001:db8::1')) === 16,
  108. 'by' => 'IPv6 expansion in <a href="http://www.yiiframework.com/doc-2.0/yii-validators-ipvalidator.html">IpValidator</a>',
  109. 'memo' => 'When <a href="http://www.yiiframework.com/doc-2.0/yii-validators-ipvalidator.html#$expandIPv6-detail">IpValidator::expandIPv6</a>
  110. property is set to <code>true</code>, PHP must support IPv6 protocol stack. Currently PHP constant <code>AF_INET6</code> is not defined
  111. and IPv6 is probably unsupported.'
  112. )
  113. );