Skip to content
Permalink
Browse files

Regenerate ext dir

  • Loading branch information...
sergeyklay committed May 18, 2019
1 parent 777038d commit 366504670702a911ce3561c1883a8861d25eb662
Showing with 15,225 additions and 35,735 deletions.
  1. +16 −189 ext/kernel/array.c
  2. +0 −2 ext/kernel/fcall.c
  3. +4 −21 ext/kernel/main.c
  4. +1 −1 ext/kernel/main.h
  5. +0 −4 ext/kernel/object.c
  6. +1 −1 ext/phalcon/24__closure.zep.c
  7. +1 −1 ext/phalcon/25__closure.zep.c
  8. +372 −883 ext/phalcon/acl/adapter/memory.zep.c
  9. +4 −4 ext/phalcon/acl/adapter/memory.zep.h
  10. +4 −4 ext/phalcon/acl/adapterinterface.zep.h
  11. +20 −45 ext/phalcon/annotations/adapter.zep.c
  12. +1 −1 ext/phalcon/annotations/adapter/memory.zep.c
  13. +37 −91 ext/phalcon/annotations/annotation.zep.c
  14. +51 −143 ext/phalcon/annotations/collection.zep.c
  15. +4 −4 ext/phalcon/annotations/collection.zep.h
  16. +38 −109 ext/phalcon/annotations/reader.zep.c
  17. +40 −94 ext/phalcon/annotations/reflection.zep.c
  18. +6 −9 ext/phalcon/assets/collection.zep.c
  19. +12 −14 ext/phalcon/assets/inline/css.zep.c
  20. +12 −14 ext/phalcon/assets/inline/js.zep.c
  21. +301 −744 ext/phalcon/assets/manager.zep.c
  22. +2 −2 ext/phalcon/assets/manager.zep.h
  23. +20 −45 ext/phalcon/cache/adapterfactory.zep.c
  24. +40 −111 ext/phalcon/cache/cache.zep.c
  25. +73 −159 ext/phalcon/cli/console.zep.c
  26. +129 −386 ext/phalcon/cli/router.zep.c
  27. +2 −2 ext/phalcon/cli/router.zep.h
  28. +15 −36 ext/phalcon/cli/router/route.zep.c
  29. +2 −2 ext/phalcon/cli/routerinterface.zep.h
  30. +18 −39 ext/phalcon/collection.zep.c
  31. +86 −194 ext/phalcon/config.zep.c
  32. +38 −97 ext/phalcon/config/adapter/grouped.zep.c
  33. +104 −235 ext/phalcon/config/adapter/ini.zep.c
  34. +39 −41 ext/phalcon/config/factory.zep.c
  35. +40 −91 ext/phalcon/crypt.zep.c
  36. +276 −653 ext/phalcon/db/adapter.zep.c
  37. +4 −4 ext/phalcon/db/adapter.zep.h
  38. +168 −478 ext/phalcon/db/adapter/pdo.zep.c
  39. +458 −1,003 ext/phalcon/db/adapter/pdo/mysql.zep.c
  40. +6 −6 ext/phalcon/db/adapter/pdo/mysql.zep.h
  41. +463 −987 ext/phalcon/db/adapter/pdo/postgresql.zep.c
  42. +4 −4 ext/phalcon/db/adapter/pdo/postgresql.zep.h
  43. +347 −811 ext/phalcon/db/adapter/pdo/sqlite.zep.c
  44. +6 −6 ext/phalcon/db/adapter/pdo/sqlite.zep.h
  45. +6 −6 ext/phalcon/db/adapterinterface.zep.h
  46. +230 −552 ext/phalcon/db/dialect.zep.c
  47. +167 −367 ext/phalcon/db/dialect/mysql.zep.c
  48. +185 −394 ext/phalcon/db/dialect/postgresql.zep.c
  49. +180 −393 ext/phalcon/db/dialect/sqlite.zep.c
  50. +1 −1 ext/phalcon/db/profiler.zep.c
  51. +2 −2 ext/phalcon/db/profiler.zep.h
  52. +297 −564 ext/phalcon/debug.zep.c
  53. +459 −750 ext/phalcon/debug/dump.zep.c
  54. +30 −62 ext/phalcon/di.zep.c
  55. +2 −2 ext/phalcon/di.zep.h
  56. +4 −6 ext/phalcon/di/service.zep.c
  57. +135 −304 ext/phalcon/di/service/builder.zep.c
  58. +2 −2 ext/phalcon/diinterface.zep.h
  59. +4 −4 ext/phalcon/dispatcher.zep.c
  60. +12 −35 ext/phalcon/escaper.zep.c
  61. +3 −3 ext/phalcon/events/manager.zep.c
  62. +61 −126 ext/phalcon/filter/filterlocator.zep.c
  63. +1 −1 ext/phalcon/filter/filterlocatorfactory.zep.c
  64. +1 −1 ext/phalcon/filter/sanitize/boolval.zep.c
  65. +1 −2 ext/phalcon/firewall/adapter.zep.c
  66. +44 −69 ext/phalcon/firewall/adapter/acl.zep.c
  67. +95 −185 ext/phalcon/firewall/adapter/annotations.zep.c
  68. +44 −69 ext/phalcon/firewall/adapter/micro/acl.zep.c
  69. +26 −55 ext/phalcon/flash.zep.c
  70. +9 −27 ext/phalcon/flash/direct.zep.c
  71. +17 −38 ext/phalcon/flash/session.zep.c
  72. +4 −4 ext/phalcon/forms/element.zep.c
  73. +2 −2 ext/phalcon/forms/element.zep.h
  74. +15 −36 ext/phalcon/forms/element/select.zep.c
  75. +2 −2 ext/phalcon/forms/elementinterface.zep.h
  76. +145 −389 ext/phalcon/forms/form.zep.c
  77. +2 −2 ext/phalcon/forms/form.zep.h
  78. +2 −2 ext/phalcon/forms/manager.zep.c
  79. +104 −264 ext/phalcon/helper/arr.zep.c
  80. +48 −118 ext/phalcon/helper/str.zep.c
  81. +62 −100 ext/phalcon/html/breadcrumbs.zep.c
  82. +45 −103 ext/phalcon/html/helper/abstracthelper.zep.c
  83. +1 −1 ext/phalcon/html/helper/anchor.zep.c
  84. +1 −1 ext/phalcon/html/helper/anchorraw.zep.c
  85. +1 −1 ext/phalcon/html/helper/form.zep.c
  86. +1 −1 ext/phalcon/html/helper/img.zep.c
  87. +128 −297 ext/phalcon/html/tag.zep.c
  88. +20 −45 ext/phalcon/html/tagfactory.zep.c
  89. +2 −3 ext/phalcon/http/cookie.zep.c
  90. +67 −121 ext/phalcon/http/message/request.zep.c
  91. +40 −94 ext/phalcon/http/message/response.zep.c
  92. +85 −169 ext/phalcon/http/message/serverrequest.zep.c
  93. +81 −176 ext/phalcon/http/message/uri.zep.c
  94. +472 −1,328 ext/phalcon/http/request.zep.c
  95. +2 −2 ext/phalcon/http/request.zep.h
  96. +2 −2 ext/phalcon/http/requestinterface.zep.h
  97. +60 −114 ext/phalcon/http/response.zep.c
  98. +10 −30 ext/phalcon/http/response/cookies.zep.c
  99. +56 −125 ext/phalcon/http/response/headers.zep.c
  100. +195 −829 ext/phalcon/loader.zep.c
  101. +13 −32 ext/phalcon/logger/adapter/abstractadapter.zep.c
  102. +18 −41 ext/phalcon/logger/formatter/abstractformatter.zep.c
  103. +29 −73 ext/phalcon/logger/logger.zep.c
  104. +30 −84 ext/phalcon/messages/messages.zep.c
  105. +72 −164 ext/phalcon/mvc/collection.zep.c
  106. +2 −2 ext/phalcon/mvc/collection.zep.h
  107. +8 −27 ext/phalcon/mvc/collection/behavior/softdelete.zep.c
  108. +8 −27 ext/phalcon/mvc/collection/behavior/timestampable.zep.c
  109. +41 −86 ext/phalcon/mvc/collection/manager.zep.c
  110. +2 −2 ext/phalcon/mvc/collectioninterface.zep.h
  111. +311 −585 ext/phalcon/mvc/micro.zep.c
  112. +1 −2 ext/phalcon/mvc/micro/collection.zep.c
  113. +1,691 −4,218 ext/phalcon/mvc/model.zep.c
  114. +2 −2 ext/phalcon/mvc/model.zep.h
  115. +21 −40 ext/phalcon/mvc/model/behavior/softdelete.zep.c
  116. +8 −27 ext/phalcon/mvc/model/behavior/timestampable.zep.c
  117. +99 −217 ext/phalcon/mvc/model/binder.zep.c
  118. +132 −252 ext/phalcon/mvc/model/criteria.zep.c
  119. +233 −485 ext/phalcon/mvc/model/manager.zep.c
  120. +7 −19 ext/phalcon/mvc/model/manager.zep.h
  121. +8 −24 ext/phalcon/mvc/model/managerinterface.zep.h
  122. +4 −4 ext/phalcon/mvc/model/metadata.zep.c
  123. +405 −870 ext/phalcon/mvc/model/metadata/strategy/annotations.zep.c
  124. +66 −157 ext/phalcon/mvc/model/metadata/strategy/introspection.zep.c
  125. +1,918 −4,345 ext/phalcon/mvc/model/query.zep.c
  126. +333 −656 ext/phalcon/mvc/model/query/builder.zep.c
  127. +2 −2 ext/phalcon/mvc/model/query/status.zep.h
  128. +2 −2 ext/phalcon/mvc/model/query/statusinterface.zep.h
  129. +4 −4 ext/phalcon/mvc/model/resultset.zep.h
  130. +109 −280 ext/phalcon/mvc/model/resultset/complex.zep.c
  131. +50 −215 ext/phalcon/mvc/model/resultset/simple.zep.c
  132. +4 −4 ext/phalcon/mvc/model/resultsetinterface.zep.h
  133. +2 −2 ext/phalcon/mvc/model/transaction/failed.zep.h
  134. +67 −191 ext/phalcon/mvc/model/transaction/manager.zep.c
  135. +2 −2 ext/phalcon/mvc/model/validationfailed.zep.h
  136. +2 −2 ext/phalcon/mvc/modelinterface.zep.h
  137. +293 −793 ext/phalcon/mvc/router.zep.c
  138. +2 −2 ext/phalcon/mvc/router.zep.h
  139. +127 −461 ext/phalcon/mvc/router/annotations.zep.c
  140. +1 −1 ext/phalcon/mvc/router/group.zep.c
  141. +2 −2 ext/phalcon/mvc/router/group.zep.h
  142. +2 −2 ext/phalcon/mvc/router/groupinterface.zep.h
  143. +15 −36 ext/phalcon/mvc/router/route.zep.c
  144. +2 −2 ext/phalcon/mvc/routerinterface.zep.h
  145. +248 −671 ext/phalcon/mvc/view.zep.c
  146. +22 −46 ext/phalcon/mvc/view/engine/php.zep.c
  147. +22 −46 ext/phalcon/mvc/view/engine/volt.zep.c
  148. +623 −1,246 ext/phalcon/mvc/view/engine/volt/compiler.zep.c
  149. +120 −241 ext/phalcon/mvc/view/simple.zep.c
  150. +18 −46 ext/phalcon/security/random.zep.c
  151. +18 −40 ext/phalcon/service/locator.zep.c
  152. +23 −58 ext/phalcon/session/adapter/stream.zep.c
  153. +12 −17 ext/phalcon/session/manager.zep.c
  154. +55 −148 ext/phalcon/storage/adapter/stream.zep.c
  155. +20 −45 ext/phalcon/storage/adapterfactory.zep.c
  156. +20 −45 ext/phalcon/storage/serializerfactory.zep.c
  157. +144 −312 ext/phalcon/tag.zep.c
  158. +58 −126 ext/phalcon/tag/select.zep.c
  159. +1 −2 ext/phalcon/translate/adapter/csv.zep.c
  160. +19 −40 ext/phalcon/translate/adapter/gettext.zep.c
  161. +19 −47 ext/phalcon/translate/interpolator/associativearray.zep.c
  162. +2 −3 ext/phalcon/url.zep.c
  163. +117 −400 ext/phalcon/validation.zep.c
  164. +1 −1 ext/phalcon/validation/validator.zep.c
  165. +25 −53 ext/phalcon/validation/validator/creditcard.zep.c
  166. +205 −220 ext/phalcon/validation/validator/file.zep.c
  167. +7 −9 ext/phalcon/validation/validator/stringlength.zep.c
  168. +337 −1,277 ext/phalcon/validation/validator/uniqueness.zep.c
  169. +1 −1 ext/php_phalcon.h
@@ -26,16 +26,13 @@
#include "php_ext.h"
#include <ext/standard/php_array.h>
#include <Zend/zend_hash.h>
#include <Zend/zend_interfaces.h>

#include "kernel/main.h"
#include "kernel/memory.h"
#include "kernel/debug.h"
#include "kernel/array.h"
#include "kernel/operators.h"
#include "kernel/backtrace.h"
#include "kernel/object.h"
#include "kernel/fcall.h"

void ZEPHIR_FASTCALL zephir_create_array(zval *return_value, uint size, int initialize)
{
@@ -93,21 +90,7 @@ int zephir_array_isset_fetch(zval *fetched, const zval *arr, zval *index, int re
HashTable *h;
zval *result;

if (UNEXPECTED(Z_TYPE_P(arr) == IS_OBJECT && zephir_instance_of_ev((zval *)arr, (const zend_class_entry *)zend_ce_arrayaccess))) {
zend_long ZEPHIR_LAST_CALL_STATUS;
zval exist;
ZVAL_UNDEF(&exist);
ZEPHIR_CALL_METHOD(&exist, (zval *)arr, "offsetexists", NULL, 0, index);
if (ZEPHIR_LAST_CALL_STATUS != FAILURE && zend_is_true(&exist)) {
ZEPHIR_CALL_METHOD(fetched, (zval *)arr, "offsetget", NULL, 0, index);

return 1;
}

ZVAL_NULL(fetched);

return 0;
} else if (UNEXPECTED(Z_TYPE_P(arr) != IS_ARRAY)) {
if (UNEXPECTED(Z_TYPE_P(arr) != IS_ARRAY)) {
ZVAL_NULL(fetched);

return 0;
@@ -162,24 +145,8 @@ int zephir_array_isset_fetch(zval *fetched, const zval *arr, zval *index, int re
int zephir_array_isset_string_fetch(zval *fetched, const zval *arr, char *index, uint index_length, int readonly)
{
zval *zv;
if (UNEXPECTED(Z_TYPE_P(arr) == IS_OBJECT && zephir_instance_of_ev((zval *)arr, (const zend_class_entry *)zend_ce_arrayaccess))) {
zend_long ZEPHIR_LAST_CALL_STATUS;
zval exist, offset;
ZVAL_UNDEF(&exist);
ZVAL_STRINGL(&offset, index, index_length);

ZEPHIR_CALL_METHOD(&exist, (zval *)arr, "offsetexists", NULL, 0, &offset);
zval_ptr_dtor(&offset);
if (ZEPHIR_LAST_CALL_STATUS != FAILURE && zend_is_true(&exist)) {
ZEPHIR_CALL_METHOD(fetched, (zval *)arr, "offsetget", NULL, 0, &offset);

return 1;
}

ZVAL_NULL(fetched);

return 0;
} else if (EXPECTED(Z_TYPE_P(arr) == IS_ARRAY)) {
if (EXPECTED(Z_TYPE_P(arr) == IS_ARRAY)) {
if ((zv = zend_hash_str_find(Z_ARRVAL_P(arr), index, index_length)) != NULL) {
zephir_ensure_array(zv);

@@ -200,23 +167,8 @@ int zephir_array_isset_string_fetch(zval *fetched, const zval *arr, char *index,
int zephir_array_isset_long_fetch(zval *fetched, const zval *arr, unsigned long index, int readonly)
{
zval *zv;

if (UNEXPECTED(Z_TYPE_P(arr) == IS_OBJECT && zephir_instance_of_ev((zval *)arr, (const zend_class_entry *)zend_ce_arrayaccess))) {
zend_long ZEPHIR_LAST_CALL_STATUS;
zval exist, offset;
ZVAL_UNDEF(&exist);
ZVAL_LONG(&offset, index);
ZEPHIR_CALL_METHOD(&exist, (zval *)arr, "offsetexists", NULL, 0, &offset);
if (ZEPHIR_LAST_CALL_STATUS != FAILURE && zend_is_true(&exist)) {
ZEPHIR_CALL_METHOD(fetched, (zval *)arr, "offsetget", NULL, 0, &offset);

return 1;
}

ZVAL_NULL(fetched);

return 0;
} else if (EXPECTED(Z_TYPE_P(arr) == IS_ARRAY)) {
if (EXPECTED(Z_TYPE_P(arr) == IS_ARRAY)) {
if ((zv = zend_hash_index_find(Z_ARRVAL_P(arr), index)) != NULL) {
zephir_ensure_array(zv);

@@ -238,21 +190,7 @@ int ZEPHIR_FASTCALL zephir_array_isset(const zval *arr, zval *index)
{
HashTable *h;

if (UNEXPECTED(!arr)) {
return 0;
}

if (UNEXPECTED(Z_TYPE_P(arr) == IS_OBJECT && zephir_instance_of_ev((zval *)arr, (const zend_class_entry *)zend_ce_arrayaccess))) {
zend_long ZEPHIR_LAST_CALL_STATUS;
zval exist;
ZVAL_UNDEF(&exist);
ZEPHIR_CALL_METHOD(&exist, (zval *)arr, "offsetexists", NULL, 0, index);
if (zend_is_true(&exist)) {
return 1;
}

return 0;
} else if (UNEXPECTED(Z_TYPE_P(arr) != IS_ARRAY)) {
if (UNEXPECTED(!arr || Z_TYPE_P(arr) != IS_ARRAY)) {
return 0;
}

@@ -283,19 +221,7 @@ int ZEPHIR_FASTCALL zephir_array_isset(const zval *arr, zval *index)

int ZEPHIR_FASTCALL zephir_array_isset_string(const zval *arr, const char *index, uint index_length)
{
if (UNEXPECTED(Z_TYPE_P(arr) == IS_OBJECT && zephir_instance_of_ev((zval *)arr, (const zend_class_entry *)zend_ce_arrayaccess))) {
zend_long ZEPHIR_LAST_CALL_STATUS;
zval exist, offset;
ZVAL_UNDEF(&exist);
ZVAL_STRINGL(&offset, index, index_length);
ZEPHIR_CALL_METHOD(&exist, (zval *)arr, "offsetexists", NULL, 0, &offset);
zval_ptr_dtor(&offset);
if (ZEPHIR_LAST_CALL_STATUS != FAILURE && zend_is_true(&exist)) {
return 1;
}

return 0;
} else if (EXPECTED(Z_TYPE_P(arr) == IS_ARRAY)) {
if (EXPECTED(Z_TYPE_P(arr) == IS_ARRAY)) {
return zend_hash_str_exists(Z_ARRVAL_P(arr), index, index_length);
}

@@ -304,18 +230,7 @@ int ZEPHIR_FASTCALL zephir_array_isset_string(const zval *arr, const char *index

int ZEPHIR_FASTCALL zephir_array_isset_long(const zval *arr, unsigned long index)
{
if (UNEXPECTED(Z_TYPE_P(arr) == IS_OBJECT && zephir_instance_of_ev((zval *)arr, (const zend_class_entry *)zend_ce_arrayaccess))) {
zend_long ZEPHIR_LAST_CALL_STATUS;
zval exist, offset;
ZVAL_UNDEF(&exist);
ZVAL_LONG(&offset, index);
ZEPHIR_CALL_METHOD(&exist, (zval *)arr, "offsetexists", NULL, 0, &offset);
if (ZEPHIR_LAST_CALL_STATUS != FAILURE && zend_is_true(&exist)) {
return 1;
}

return 0;
} else if (EXPECTED(Z_TYPE_P(arr) == IS_ARRAY)) {
if (EXPECTED(Z_TYPE_P(arr) == IS_ARRAY)) {
return zend_hash_index_exists(Z_ARRVAL_P(arr), index);
}

@@ -326,16 +241,8 @@ int ZEPHIR_FASTCALL zephir_array_unset(zval *arr, zval *index, int flags)
{
HashTable *ht;

if (UNEXPECTED(Z_TYPE_P(arr) == IS_OBJECT && zephir_instance_of_ev(arr, (const zend_class_entry *)zend_ce_arrayaccess))) {
zend_long ZEPHIR_LAST_CALL_STATUS;
ZEPHIR_CALL_METHOD(NULL, arr, "offsetunset", NULL, 0, index);
if (ZEPHIR_LAST_CALL_STATUS != FAILURE) {
return 1;
}

return 0;
} else if (Z_TYPE_P(arr) != IS_ARRAY) {
return 0;
if (Z_TYPE_P(arr) != IS_ARRAY) {
return FAILURE;
}

if ((flags & PH_SEPARATE) == PH_SEPARATE) {
@@ -372,18 +279,7 @@ int ZEPHIR_FASTCALL zephir_array_unset(zval *arr, zval *index, int flags)

int ZEPHIR_FASTCALL zephir_array_unset_string(zval *arr, const char *index, uint index_length, int flags)
{
if (UNEXPECTED(Z_TYPE_P(arr) == IS_OBJECT && zephir_instance_of_ev(arr, (const zend_class_entry *)zend_ce_arrayaccess))) {
zend_long ZEPHIR_LAST_CALL_STATUS;
zval offset;
ZVAL_STRINGL(&offset, index, index_length);
ZEPHIR_CALL_METHOD(NULL, arr, "offsetunset", NULL, 0, &offset);
zval_ptr_dtor(&offset);
if (ZEPHIR_LAST_CALL_STATUS != FAILURE) {
return 1;
}

return 0;
} else if (Z_TYPE_P(arr) != IS_ARRAY) {
if (Z_TYPE_P(arr) != IS_ARRAY) {
return 0;
}

@@ -396,18 +292,7 @@ int ZEPHIR_FASTCALL zephir_array_unset_string(zval *arr, const char *index, uint

int ZEPHIR_FASTCALL zephir_array_unset_long(zval *arr, unsigned long index, int flags)
{
if (UNEXPECTED(Z_TYPE_P(arr) == IS_OBJECT && zephir_instance_of_ev(arr, (const zend_class_entry *)zend_ce_arrayaccess))) {
zend_long ZEPHIR_LAST_CALL_STATUS;
zval offset;
ZVAL_LONG(&offset, index);
ZEPHIR_CALL_METHOD(NULL, arr, "offsetunset", NULL, 0, &offset);

if (ZEPHIR_LAST_CALL_STATUS != FAILURE) {
return 1;
}

return 0;
} else if (Z_TYPE_P(arr) != IS_ARRAY) {
if (Z_TYPE_P(arr) != IS_ARRAY) {
return 0;
}

@@ -441,15 +326,7 @@ int zephir_array_fetch(zval *return_value, zval *arr, zval *index, int flags ZEP
ulong uidx = 0;
char *sidx = NULL;

if (UNEXPECTED(Z_TYPE_P(arr) == IS_OBJECT && zephir_instance_of_ev(arr, (const zend_class_entry *)zend_ce_arrayaccess))) {
zend_long ZEPHIR_LAST_CALL_STATUS;
ZEPHIR_CALL_METHOD(return_value, arr, "offsetget", NULL, 0, index);
if (ZEPHIR_LAST_CALL_STATUS != FAILURE) {
return SUCCESS;
}

return FAILURE;
} else if (Z_TYPE_P(arr) == IS_ARRAY) {
if (Z_TYPE_P(arr) == IS_ARRAY) {
ht = Z_ARRVAL_P(arr);
switch (Z_TYPE_P(index)) {
case IS_NULL:
@@ -517,18 +394,7 @@ int zephir_array_fetch_string(zval *return_value, zval *arr, const char *index,
{
zval *zv;

if (UNEXPECTED(Z_TYPE_P(arr) == IS_OBJECT && zephir_instance_of_ev(arr, (const zend_class_entry *)zend_ce_arrayaccess))) {
zend_long ZEPHIR_LAST_CALL_STATUS;
zval offset;
ZVAL_STRINGL(&offset, index, index_length);
ZEPHIR_CALL_METHOD(return_value, arr, "offsetget", NULL, 0, &offset);
zval_ptr_dtor(&offset);
if (ZEPHIR_LAST_CALL_STATUS != FAILURE) {
return SUCCESS;
}

return FAILURE;
} else if (EXPECTED(Z_TYPE_P(arr) == IS_ARRAY)) {
if (EXPECTED(Z_TYPE_P(arr) == IS_ARRAY)) {
if ((zv = zend_hash_str_find(Z_ARRVAL_P(arr), index, index_length)) != NULL) {

if ((flags & PH_READONLY) == PH_READONLY) {
@@ -560,17 +426,7 @@ int zephir_array_fetch_long(zval *return_value, zval *arr, unsigned long index,
{
zval *zv;

if (UNEXPECTED(Z_TYPE_P(arr) == IS_OBJECT && zephir_instance_of_ev(arr, (const zend_class_entry *)zend_ce_arrayaccess))) {
zend_long ZEPHIR_LAST_CALL_STATUS;
zval offset;
ZVAL_LONG(&offset, index);
ZEPHIR_CALL_METHOD(return_value, arr, "offsetget", NULL, 0, &offset);
if (ZEPHIR_LAST_CALL_STATUS != FAILURE) {
return SUCCESS;
}

return FAILURE;
} else if (EXPECTED(Z_TYPE_P(arr) == IS_ARRAY)) {
if (EXPECTED(Z_TYPE_P(arr) == IS_ARRAY)) {
if ((zv = zend_hash_index_find(Z_ARRVAL_P(arr), index)) != NULL) {

if ((flags & PH_READONLY) == PH_READONLY) {
@@ -630,15 +486,7 @@ int zephir_array_update_zval(zval *arr, zval *index, zval *value, int flags)
HashTable *ht;
zval *ret = NULL;

if (UNEXPECTED(Z_TYPE_P(arr) == IS_OBJECT && zephir_instance_of_ev(arr, (const zend_class_entry *)zend_ce_arrayaccess))) {
zend_long ZEPHIR_LAST_CALL_STATUS;
ZEPHIR_CALL_METHOD(NULL, arr, "offsetset", NULL, 0, index, value);
if (ZEPHIR_LAST_CALL_STATUS != FAILURE) {
return SUCCESS;
}

return FAILURE;
} else if (Z_TYPE_P(arr) != IS_ARRAY) {
if (Z_TYPE_P(arr) != IS_ARRAY) {
zend_error(E_WARNING, "Cannot use a scalar value as an array (2)");
return FAILURE;
}
@@ -694,18 +542,7 @@ int zephir_array_update_zval(zval *arr, zval *index, zval *value, int flags)
int zephir_array_update_string(zval *arr, const char *index, uint index_length, zval *value, int flags)
{

if (UNEXPECTED(Z_TYPE_P(arr) == IS_OBJECT && zephir_instance_of_ev(arr, (const zend_class_entry *)zend_ce_arrayaccess))) {
zend_long ZEPHIR_LAST_CALL_STATUS;
zval offset;
ZVAL_STRINGL(&offset, index, index_length);
ZEPHIR_CALL_METHOD(NULL, arr, "offsetset", NULL, 0, &offset, value);
zval_ptr_dtor(&offset);
if (ZEPHIR_LAST_CALL_STATUS != FAILURE) {
return SUCCESS;
}

return FAILURE;
} else if (Z_TYPE_P(arr) != IS_ARRAY) {
if (Z_TYPE_P(arr) != IS_ARRAY) {
zend_error(E_WARNING, "Cannot use a scalar value as an array (3)");
return FAILURE;
}
@@ -728,17 +565,7 @@ int zephir_array_update_string(zval *arr, const char *index, uint index_length,

int zephir_array_update_long(zval *arr, unsigned long index, zval *value, int flags ZEPHIR_DEBUG_PARAMS)
{
if (UNEXPECTED(Z_TYPE_P(arr) == IS_OBJECT && zephir_instance_of_ev(arr, (const zend_class_entry *)zend_ce_arrayaccess))) {
zend_long ZEPHIR_LAST_CALL_STATUS;
zval offset;
ZVAL_LONG(&offset, index);
ZEPHIR_CALL_METHOD(NULL, arr, "offsetset", NULL, 0, &offset, value);
if (ZEPHIR_LAST_CALL_STATUS != FAILURE) {
return SUCCESS;
}

return FAILURE;
} else if (Z_TYPE_P(arr) != IS_ARRAY) {
if (Z_TYPE_P(arr) != IS_ARRAY) {
zend_error(E_WARNING, "Cannot use a scalar value as an array in %s on line %d", file, line);
return FAILURE;
}
@@ -421,8 +421,6 @@ int zephir_call_user_function(zval *object_pp, zend_class_entry *obj_ce, zephir_
}
else if (FAILURE == status || EG(exception)) {
ZVAL_NULL(retval_ptr);
} else if (Z_TYPE_P(retval_ptr) == IS_ARRAY) {
SEPARATE_ARRAY(retval_ptr);
}

return status;
@@ -23,7 +23,6 @@
#include "kernel/main.h"
#include "kernel/memory.h"
#include "kernel/fcall.h"
#include "kernel/object.h"
#include "kernel/exception.h"


@@ -33,9 +32,7 @@ zend_string* i_self = NULL;

int zephir_is_iterable_ex(zval *arr, int duplicate)
{
if (UNEXPECTED(Z_TYPE_P(arr) == IS_OBJECT && zephir_instance_of_ev(arr, (const zend_class_entry *)zend_ce_iterator))) {
return 1;
} else if (UNEXPECTED(Z_TYPE_P(arr) != IS_ARRAY)) {
if (UNEXPECTED(Z_TYPE_P(arr) != IS_ARRAY)) {
return 0;
}
//TODO: duplicate
@@ -85,10 +82,9 @@ int zephir_fetch_parameters(int num_args, int required_args, int optional_args,
/**
* Gets the global zval into PG macro
*/
int zephir_get_global(zval *arr, const char *global, unsigned int global_length)
int zephir_get_global(zval **arr, const char *global, unsigned int global_length)
{
zval *gv;
zend_array *symbol_table;
zend_bool jit_initialization = PG(auto_globals_jit);
zend_string *str = zend_string_init(global, global_length, 0);

@@ -100,27 +96,14 @@ int zephir_get_global(zval *arr, const char *global, unsigned int global_length)
if ((gv = zend_hash_find_ind(&EG(symbol_table), str)) != NULL) {
ZVAL_DEREF(gv);
if (Z_TYPE_P(gv) == IS_ARRAY) {
if (Z_REFCOUNTED_P(gv)) {
ZVAL_COPY_VALUE(arr, gv);
Z_SET_REFCOUNT_P(arr, 1);
} else {
ZVAL_DUP(arr, gv);
zend_hash_update(&EG(symbol_table), str, arr);
}
*arr = gv;
zend_string_release(str);
return SUCCESS;
}
}
}

array_init(arr);
if (!(&EG(symbol_table))) {
symbol_table = zend_rebuild_symbol_table();
} else {
symbol_table = &EG(symbol_table);
}
zend_hash_update(symbol_table, str, arr);

*arr = NULL;
zend_string_release(str);
return FAILURE;
}

0 comments on commit 3665046

Please sign in to comment.
You can’t perform that action at this time.